python-mode: s-r now runs code
This commit is contained in:
parent
b147c7c8b8
commit
d9815ec47f
1 changed files with 15 additions and 2 deletions
|
@ -1,9 +1,22 @@
|
|||
|
||||
(require-package 'jedi)
|
||||
|
||||
(add-hook 'python-mode-hook 'jedi:setup)
|
||||
(if (not (file-directory-p "~/.emacs.d/.python-environments/default/"))
|
||||
(jedi:install-server))
|
||||
|
||||
(add-hook 'python-mode-hook 'jedi:setup)
|
||||
(add-hook 'python-mode-hook
|
||||
(lambda ( )
|
||||
;; Don't remap backspace. Leave it to autopair, please.
|
||||
(define-key python-mode-map [backspace] nil)
|
||||
(evil-define-key 'normal python-mode-map (kbd "s-r")
|
||||
(lambda() (interactive) (shell-command-on-region (point-min) (point-max) "python")))
|
||||
(evil-define-key 'visual python-mode-map (kbd "s-r")
|
||||
(lambda() (interactive) (shell-command-on-region (region-beginning) (region-end) "python")))
|
||||
|
||||
;; Let autopair work with triple-quotes
|
||||
(setq autopair-handle-action-fns
|
||||
(list #'autopair-default-handle-action
|
||||
#'autopair-python-triple-quote-action))))
|
||||
|
||||
;;
|
||||
(provide 'env-python-mode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue