Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Practical Vim, Drew Neil emphasised a tip: Chunk Your Undos in vim insert mode.

use Esc+o instead of press <CR> to force a back to normal mode, so that when you press next time, you will just undo the line you just opened.

That's really a practical advise! So I tried to map Shift+Enter to Esc+o in my .vimrc file with imap <C-return> <ESC>o, but it just not works. Any ideas?

share|improve this question
up vote 2 down vote accepted

Your :imap should work in GVIM, but in console Vim (both Windows and Linux), Ctrl + Enter cannot be mapped.

Some key combinations, like Ctrl + non-alphabetic cannot be mapped, and Ctrl + letter vs. Ctrl + Shift + letter cannot be distinguished. (Unless your terminal sends a distinct termcap code for it, which most don't.) In insert or command-line mode, try typing the key combination. If nothing happens / is inserted, you cannot use that key combination.

Use a different key combination, e.g. <C-g><Enter>.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .