# Vim LatexSuite: how to define IMAP that also moves the cursor?

I am using latexsuite in vim and I'm trying to make MBF in insert mode expand to \mathbf{}<++> and place the cursor inside the brackets.

The following:

:call IMAP('MBF', "\\mathbf{}<++>\<Left>\<Left>\<Left>\<Left>\<Left>",'tex')


produces this:

\mathbf{}<80>kl<80>kl<80>kl<80>kl<80>kl.


Whereas the following

    :call IMAP('MBF', "\\mathbf{}<++><Left><Left><Left><Left><Left>",'tex')


produces this:

\mathbf{}<Left><Left><Left><Left>


What am I doing wrong here? How can I write an IMAP function that puts the cursor inside the brackets after expanding MBF to \mathbf{}<++>?

You should insert a placeholder <++> where you want the cursor to be placed. In your particular example, you should use:

:call IMAP('MBF', "\\mathbf{<++>}<++>",'tex')


This produces

\mathbf{}<++>


with the cursor inside the braces.