[Vim-latex-devel] How to call IMAP_JumpForward from a function?
Brought to you by:
srinathava,
tmaas
From: Jorge R. <sk...@gm...> - 2012-08-21 16:34:43
|
Hi, I have the imap imap <silent> <NL> <Plug>IMAP_JumpForward in after/ftplugin/tex.vim but when not using latex, I use that key for ultisnips plugin inoremap <silent> <NL> <c-r>=UltiSnips_ExpandSnippetOrJump()<CR> I would like to do the following have a mapping that in latex would do the following: when I hit <c-j> it would just be like calling imap <silent> <NL> <Plug>IMAP_JumpForward but if the cursor doesn't move then call the function for ultisnips. My initial problem is that I don't know how to call IMAP_JumpForward from a function. I have the following right now: function! SelectImapOrUlti() let save_cursor = getpos(".") execute "normal \<Plug>IMAP_JumpForward" return '' endfunction imap <c-l> <c-r>=SelectImapOrUlti()<cr> If I use the original mapping in text with the placeholders say <+tag+> then the word tag and the placeholders are selected visually and I can just delete them by hitting backspace. If I use the mapping the mapping associated with the function I defined the cursor just goes to the closing placeholder, but nothing is selected. Is there a way of achieving this? Thanks! |