Using vim for editing latex; how can I bind C-Enter? I tried the following, which does not work:

imap <C-Enter> \\<CR>

and

imap <C-Return> \\<CR>

However, something like:

imap <C-i> \\<CR>

Does work.

Any ideas are suggestions for vim latex-addons?

link|improve this question
feedback

3 Answers

I'm guessing you're using Vim inside a terminal, since I was able to map <C-Enter> successfully in the GUI versions of both MacVim on OS X and gVim on Windows:

:imap <C-Enter> I just pressed Control+Enter<CR>

If you're using the terminal version of Vim, then Vim is at the mercy of whatever keycodes the terminal provides. In some terminals, pressing Control+Enter looks exactly the same to Vim as pressing Enter alone, so Vim never really sees the keystroke you're trying to send it.

See this older Stack Overflow question for additional discussion:

http://stackoverflow.com/questions/598113/can-terminals-detect-shift-enter-or-control-enter

link|improve this answer
feedback

Try

imap <C-CR> \\<CR>
link|improve this answer
I'm afraid this does not work either. – mtkoan Apr 29 '10 at 16:16
feedback

To get it to accept a control character, such as Enter, try typing Ctrl + V followed by Enter.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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