Without more information, I believe I understand the problem to be that desire is for evil-shift-width
to be set to 4 in python-mode
and 2 in ruby-mode
(for two examples), yet it is always set to 2.
The problem in this case comes from the fact that indent
isn't defined globally in Emacs, and certainly not in python-mode
. In python-mode
there is a variable python-indent
, which is set to 4, and that is the variable to use.
While annoying to have to use custom variables for each of the major modes, that's what each of the modes actually use, and that's probably the solution that will actually work:
(add-hook 'python-mode-hook
(function (lambda ()
(setq evil-shift-width python-indent))))
(add-hook 'ruby-mode-hook
(function (lambda ()
(setq evil-shift-width ruby-indent-level))))
Adding a new one for each major-mode you want supported.