Redefine and add some key binding for python-mode.el.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Fri, 12 Feb 2016 23:06:29 +0200
changeset 1337 a0eadfd4cff0
parent 1336 7c93663d44f3
child 1338 a49cca7037ba
Redefine and add some key binding for python-mode.el.
.emacs-my
--- a/.emacs-my	Fri Feb 12 18:04:15 2016 +0200
+++ b/.emacs-my	Fri Feb 12 23:06:29 2016 +0200
@@ -2747,9 +2747,12 @@
 
 (my--eval-after-load python-mode
   (when (and (boundp 'py-version) (equal py-version "5.1.0"))
-    (setq-default py-which-shell py-python-command)
     ;; (py-toggle-shells 'cpython)
-    ))
+    (setq-default py-which-shell py-python-command))
+  (when (boundp 'py-version)
+    (define-key python-mode-map [C-backspace] 'backward-kill-word)
+    (define-key python-mode-map [?\C-c ?p] 'py-execute-paragraph)
+    (define-key python-mode-map [?\C-c ?r] 'py-execute-region)))
 
 (my--eval-after-load python
   (define-key inferior-python-mode-map "\C-c\C-f" 'python-describe-symbol))