0

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{}<++>?

1 Answer 1

1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .