Fault mapping <Cj> in Vim with latex package

I wanted to display <Cj> to go to the next window below the current

 map <Cj> <Cw>j 

However, it goes into Insert mode, and does not move the window below. Why?

Decision:

I have latex-suite installed. So I tried to request that <Cj> maps to

 :map <Cj> 

And I get the following output:

 v <NL> <Plug>IMAP_JumpForward n <NL> <Plug>IMAP_JumpForward o <NL> <CW>j 

This means that I have to change the display of <Plug>IMAP_JumpForward . I read a little, and I found out that this is due to the <++> substitutions that you can use when using <Cj> during Insert mode. Therefore, based on my reading, I found out that I can change the display using the following line in .vimrc :

 imap <C-space> <Plug>IMAP_JumpForward 

But no, it does not work like <Cj> . I will try to illustrate. I type the following ( _ represents the cursor):

 \documentclass{}_ 

Then i get

 \documentclass{_}<++> 

Then I try to enter text

 \documentclass{article_}<++> 

So now I press <C-space> . Here's what happens: it exits Insert mode, and I will be in the following situation:

 \documentclass{articl_e}<++> 

Summary of the problem:

  • After map <Cj> <Cw>j , <Cj> goes into insert mode.
  • After imap <C-space> <Plug>IMAP_JumpForward , <C-space> does not move on to the next <++> placeholder. It exits Insert mode, and the cursor supports one character.

What happened? What did I miss?

+8
vim mapping latex
source share
3 answers

I suggest two things:

  • first, target the mappings:

     nnoremap <Cj> <Cw>j 
  • secondly, find out which mappings interfere (and where they come from) by doing

     verbose nmap <Cj> verbose nmap <Cw> verbose nmap j 

see also :map :noremap :vmap :noremap , etc.

+4
source share

I found a solution here: How to debug vim mapping mapping?

You have to use

 nnoremap <SID>I_won't_ever_type_this <Plug>IMAP_JumpForward 

So imaps.vim vim-latex is not reassigned. You still have functionality matching something better.

+2
source share

I had the same problem; it was strange for me, since <Cj> from vim-latex is displayed for normal visual and plug-in modes. It seemed to me that after this answer and checking the imaps.vim file in the '\ bundle \ vim-latex \ plugin' directory. I put the following code in my vimrc and it seems to work.

 imap <C-space> <Plug>IMAP_JumpForward nmap <C-space> <Plug>IMAP_JumpForward vmap <C-space> <Plug>IMAP_JumpForward 
+2
source share

All Articles