2

For code editing, and maybe other things too (but not for modes where the tab key has a special behaviour, notably org-mode), I want the tab key to indent, even when in evil normal (or motion) state.

What's the best way to do that?

Currently when I hit tab in evil normal mode in say lisp-mode, there is no effect (that would also be true for python-mode, except I have a special hack for that one case).

I'm using GNU emacs 25 (not spacemacs)

2 Answers 2

3

If you don't care about TAB/C-i not being available (which would normally jump to the last location), just unbind it:

(with-eval-after-load 'evil-maps
  (define-key evil-motion-state-map (kbd "TAB") nil))

Alternatively, customize the user variable responsible for establishing the key binding before loading Evil:

(setq evil-want-C-i-jump nil)
2
  • I'm curious what binding "normal" evil or emacs users use? Though I've been using emacs with vi key bindings for years, I've always ignored both emacs' and vim's defaults for this... Jun 12, 2016 at 16:21
  • It is possible to indent in insert state, so I've used that initially, but later unbound TAB, later did some hackery to have the jump functionality on C-i and indentation on TAB.
    – wasamasa
    Jun 12, 2016 at 18:37
0

In normal mode, you can simply type ">" and then [RETURN] and the paragraph will have the indentation you want. "<" and then [RETURN] to put it back. You can also select the lines and then press ">" (or "<")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.