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!

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Vim-latex-devel mailing list
Vim-latex-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vim-latex-devel

Reply via email to