summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init/km-python.el18
1 files changed, 13 insertions, 5 deletions
diff --git a/init/km-python.el b/init/km-python.el
index f5bbc85..9940611 100644
--- a/init/km-python.el
+++ b/init/km-python.el
@@ -1,7 +1,3 @@
-(defun km/python-sysexit ()
- (interactive)
- (insert "sys.exit()"))
-
(defun km/python-shebang ()
(interactive)
(km/shebang "python"))
@@ -20,7 +16,19 @@ from colors import brew, fgry, bgry")
(insert km/python-analysis-imports))
(defun km/python-hook ()
- (local-set-key (kbd "C-c p e") 'km/python-sysexit)
(local-set-key (kbd "C-c p s") 'km/python-shebang)
(local-set-key (kbd "C-c p a") 'km/python-insert-analysis-imports))
(add-hook 'python-mode-hook 'km/python-hook)
+
+;; http://www.emacswiki.org/emacs/PythonProgrammingInEmacs#toc5
+(setq
+ python-shell-interpreter "ipython"
+ python-shell-interpreter-args ""
+ python-shell-prompt-regexp "In \\[[0-9]+\\]: "
+ python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: "
+ python-shell-completion-setup-code
+ "from IPython.core.completerlib import module_completion"
+ python-shell-completion-module-string-code
+ "';'.join(module_completion('''%s'''))\n"
+ python-shell-completion-string-code
+ "';'.join(get_ipython().Completer.all_completions('''%s'''))\n")