Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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