Python: Use a hook to set evil-shift-width locally

It was being set globally before.
This commit is contained in:
James Nguyen 2017-12-12 19:45:14 -08:00
parent 77e6377f56
commit 701dae45ad
1 changed files with 5 additions and 1 deletions

View File

@ -30,9 +30,13 @@
(require 'evil)
(require 'python)
(defun evil-collection-python-set-evil-shift-width ()
"Set `evil-shift-width' according to `python-indent-offset'."
(setq evil-shift-width python-indent-offset))
(defun evil-collection-python-setup ()
"Set up `evil' bindings for `python'."
(setq evil-shift-width python-indent-offset)
(add-hook 'python-mode-hook #'evil-collection-python-set-evil-shift-width)
(evil-define-key 'normal python-mode-map
"gz" 'python-shell-switch-to-shell))