summaryrefslogtreecommitdiff
path: root/lisp/init-python.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-01-23 23:23:05 -0500
committerKyle Meyer <kyle@kyleam.com>2015-01-27 01:01:05 -0500
commitd9cae60fa5048abd3528f96a285109329639fda6 (patch)
treef4e25372dd4e8c466c82a09cd11c1dd5cb882487 /lisp/init-python.el
parent06d5146080137650645ad0750e23c8a238754ea6 (diff)
downloademacs.d-d9cae60fa5048abd3528f96a285109329639fda6.tar.gz
Improve organization and consistency of files
- Add pages and more headings for large files. - Try to use consistent order for file (or page) structure. * Loading * Settings * Hooks * Any mode activation or function calls * My functions * Key bindings
Diffstat (limited to 'lisp/init-python.el')
-rw-r--r--lisp/init-python.el38
1 files changed, 18 insertions, 20 deletions
diff --git a/lisp/init-python.el b/lisp/init-python.el
index b16a005..2003777 100644
--- a/lisp/init-python.el
+++ b/lisp/init-python.el
@@ -1,9 +1,17 @@
+(setq python-fill-docstring-style 'pep-257-nn)
+
+(setq jedi:tooltip-method nil
+ ac-auto-start nil)
+
+(add-to-list 'interpreter-mode-alist '("python2" . python-mode))
+(add-to-list 'interpreter-mode-alist '("python3" . python-mode))
(add-hook 'python-mode-hook 'jedi:setup)
(add-hook 'python-mode-hook 'auto-complete-mode)
-(setq jedi:tooltip-method nil
- ac-auto-start nil)
+(defun km/python-hook ()
+ (set (make-local-variable 'compile-command) "py.test"))
+(add-hook 'python-mode-hook 'km/python-hook)
;; http://www.emacswiki.org/emacs/PythonProgrammingInEmacs#toc5
(defun km/setup-ipython-shell ()
@@ -95,33 +103,23 @@ This is inspired by `ess-eval-function-or-paragraph-and-step'."
(goto-char pos)
n))
-(define-prefix-command 'km/python-prefix-map)
-(define-key km/python-prefix-map "t" 'km/find-python-test-file-other-window)
-
(after 'python
- (define-key python-mode-map (kbd "C-c m") 'km/python-prefix-map)
+ (key-chord-define python-mode-map ";w" 'auto-complete)
+ (define-key python-mode-map (kbd "C-c C-.")
+ 'km/python-shell-send-buffer-up-to-point)
+ (define-key python-mode-map (kbd "C-c C-b") 'python-shell-send-buffer)
;; Rebind `python-shell-send-buffer'.
(define-key python-mode-map (kbd "C-c C-c")
'km/python-shell-send-function-or-paragraph-and-step)
- (define-key python-mode-map (kbd "C-c C-b") 'python-shell-send-buffer)
- (define-key python-mode-map (kbd "C-c C-.")
- 'km/python-shell-send-buffer-up-to-point)
-
- (key-chord-define python-mode-map ";w" 'auto-complete)
;; Swap `python-shell-send-defun' and `python-eldoc-at-point'.
(define-key python-mode-map (kbd "C-c C-f") 'python-shell-send-defun)
- (define-key python-mode-map (kbd "C-M-x") 'python-eldoc-at-point))
-
-(defun km/python-hook ()
- (set (make-local-variable 'compile-command) "py.test"))
-
-(add-hook 'python-mode-hook 'km/python-hook)
+ (define-key python-mode-map (kbd "C-M-x") 'python-eldoc-at-point)
-(add-to-list 'interpreter-mode-alist '("python2" . python-mode))
-(add-to-list 'interpreter-mode-alist '("python3" . python-mode))
+ (define-prefix-command 'km/python-prefix-map)
+ (define-key python-mode-map (kbd "C-c m") 'km/python-prefix-map)
-(setq python-fill-docstring-style 'pep-257-nn)
+ (define-key km/python-prefix-map "t" 'km/find-python-test-file-other-window))
(provide 'init-python)