vim auto close $$ and \[\] in the insert mode?

287 Views Asked by At

I am using vim-latex to edit tex files and often type inline math formula by $xxxx$ and displaymath environment by \[xxxx\]. In the visual mode, Vim-latex provide shortcuts for them, i.e. `$ ,depending on characterwise or linewise selection.

How to implement auto close for them in the insert mode and let the cursor left between them? (I have used delimitMate for auto-closing, but it doesn't provide this type auto-closing.)

1

There are 1 best solutions below

0
On BEST ANSWER

I would use Snipmate or Ultisnips for that but you can do:

inoremap $$ $$<Left>
inoremap \[ \[\]<Left><Left>