I installed vim-LaTeX suite and now some of my mappings don't work anymore.

Those are my mappings, the last 2 don't work when LaTeX suite is installed:

autocmd FileType tex inoremap è \`e
autocmd FileType tex inoremap é \e`
autocmd FileType tex inoremap ù \`u
autocmd FileType tex inoremap ò \`o
autocmd FileType tex inoremap ì \`i
autocmd FileType tex inoremap à \`a

autocmd FileType tex inoremap ` '
autocmd FileType tex inoremap ' `

Those last 2 don't work

  • Hello, welcome to the site! The markdown in your post is broken, so the last letter of most of your lines (as well as the entire last line) is not rendered as code. You can use four spaces instead of backticks to show it as code, that way you will not need to escape the backticks. Could you edit your post to have correct markdown? I would do it myself, but I'm afraid that I'll change some of your mappings without knowing it.
    – DJMcMayhem
    Sep 29 '17 at 16:27

In this case, read vim-latex FAQ. The problem is old, and there is a solution, that enables to map <m-i> (which vim confounds with é) to any thing else.

PS: your mappings should be <buffer> local. You don't want them triggered in commit messages for instance.

BTW, I've been using accentuated characters in my French LaTeX documents for quite some time now. We don't really need to obfuscate our documents any more.

  • I am afraid I don't understand, the problem is with remapping ' to ` and vice versa, the accentuated characters work just fine.However, if there is a better way to remap those I'm happy to learn that
    – Gamaranto
    Sep 29 '17 at 17:18
  • 1
    Sorry I completely missed your problem. Global mappings have a lesser priority than buffer local mappings, and vim-latex defines its mappings correctly, i.e. locally. You'd need to define buffer-local mappings in a tex ftplugin defined in the ~/.vim/after/ to be sure they'll override vim-latex settings Sep 29 '17 at 17:32

I figured it out, I added a tex.vim file in the ~/../vim-latex/ftplugin directory, the text of the file is:

call IMAP("'",'`','tex')
call IMAP('`',"'",'tex')

Where the quotes around ' are necessary since it's a special character

Edit: now every 3 ' I get ``' someone knwos why?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.