summaryrefslogtreecommitdiff
path: root/evil-collection-python.el
diff options
context:
space:
mode:
Diffstat (limited to 'evil-collection-python.el')
-rw-r--r--evil-collection-python.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/evil-collection-python.el b/evil-collection-python.el
index 0b8e7d0..5f87dfb 100644
--- a/evil-collection-python.el
+++ b/evil-collection-python.el
@@ -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))