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

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?

share|improve this question

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

share|improve this answer
    
The accepted answer of the linked question gives a solution which worked for me: imap <C-J>. – Ferdinand Prantl Jan 12 '14 at 14:31

Try

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

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

share|improve this answer

You must log in to answer this question.

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