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.

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

3 Answers 3

Try

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

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 at 14:31

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

share|improve this answer

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.