1

This took me way too long to figure out so I'm asking the question and answering it.

In my .emacs/init.el I was trying many things:

(with-eval-after-load 'evil-maps (define-key evil-insert-state-map (kbd "\t") '[???]))

What's the value I put in there? All I want to do is to have the tab key get me from insert mode to normal mode!

  • (Probably a duplicate of a bunch of other questions too.) – Drew Jan 24 '17 at 16:46
  • To add to that, this breaks the repeat last action functionality (.). Should I downvote my own question? – meh Jan 24 '17 at 17:17
  • I do agree it is a possible duplicate of the post you link to. I have the lines in that post in my init.el. However, as an emacs newbie, I would have liked to see a post like that one specific to rebinding the TAB key. Which I did not find. However, I'm unfamiliar with the etiquette of this SE. Should I not do that? ie. do: There's a post for binding keys X and Y, here's one for keys Z, N. – meh Jan 24 '17 at 17:24
  • Nothing wrong with posing such a question. But it is better if you first search for an existing Q & A that is relevant (saves site maintenance). The point in this case is that whether binding TAB or binding C-f, the question and answer are essentially the same. In this case, there is the addition of eval-after-load (or with-eval-after-load), as there is also in the duplicate I found. – Drew Jan 24 '17 at 17:30
  • Got it. So if I do something like this and I've seen something similar, but I need an additional detail, should I link to the similar post? – meh Jan 25 '17 at 21:44
1

This works on emacs 24.5.1 from the Ubuntu 16.04 repositories:

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

EDIT: However, this is not recommended as the TAB key is often used for core functionality in many packages. Credit: @Dan for answering this

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