python-mode: s-r now runs code

This commit is contained in:
Henrik Lissner 2014-07-23 23:15:24 -04:00
parent b147c7c8b8
commit d9815ec47f

View file

@ -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)