targets.vim
targets.vim copied to clipboard
FT-specific adjustments: Dollar $ for LaTeX inline equations as quote not separator
I want to change the mapping of $ for LaTeX files .tex:
I have added to my $VIMRC following:
let g:tex_flavor='latex'
augroup mytargets
autocmd!
autocmd User targets#mappings#user call targets#mappings#extend({
\ '$':{'quote': [{'d': '\$'}]},
\ })
augroup END
However, this applies to all files. What do I have to do that this change only applies to tex files?
You could simply prefix your autocmd command with another autocmd command.
Although, I think that wouldn't work correctly with the augroup upon reloading.
This should work:
autocmd Event * if &ft =~ 'tex' | <your-command> | endif