Absolutely:
au FileType tex,latex,context,plaintex nm <CH> <Plug>IMAP_JumpForward
Some thoughts:
- Use local buffer mapping instead of global mapping
- Using short names has only cons and zero pros. Not necessary.
- This autocmd must be in a group
- Autocmd needs to be cleaned (within the group), so re-searching is not a problem
- Maybe use after ftplugin script. e.g.
~/.vim/after/ftplugin/tex.vim instead of :autocmd , since they are easier to manage - check out romainl idiomatic vimrc for more vimrc do's / do not
Purified Version:
augroup tex_mappings autocmd! autocmd FileType tex,latex,context,plaintex nmap <buffer> <ch> <Plug>IMAP_JumpForward augroup END
Alternatively, add the following to ~/.vim/after/ftplugin/txt.vim :
nmap <buffer> <ch> <Plug>IMAP_JumpForward
Note: using the ftplugin approach, you will need to add this line for each FileType (or use :source )
For more help see:
:h :au :h :aug :h :map-local :h after-directory
source share