Use buffer specific autocmds
This commit is contained in:
parent
9c3d0fbcd4
commit
ec7d682280
@ -15,15 +15,6 @@ endfunction
|
|||||||
function! vimtex#motion#init_script() " {{{1
|
function! vimtex#motion#init_script() " {{{1
|
||||||
if !g:vimtex_motion_enabled | return | endif
|
if !g:vimtex_motion_enabled | return | endif
|
||||||
|
|
||||||
" Highlight matching delimiters ($, (), ...)
|
|
||||||
if g:vimtex_motion_matchparen
|
|
||||||
augroup vimtex_motion
|
|
||||||
autocmd!
|
|
||||||
autocmd! CursorMoved *.tex call s:highlight_matching_pair()
|
|
||||||
autocmd! CursorMovedI *.tex call s:highlight_matching_pair()
|
|
||||||
augroup END
|
|
||||||
endif
|
|
||||||
|
|
||||||
"
|
"
|
||||||
" Define patterns used by motion.vim
|
" Define patterns used by motion.vim
|
||||||
"
|
"
|
||||||
@ -56,6 +47,15 @@ endfunction
|
|||||||
function! vimtex#motion#init_buffer() " {{{1
|
function! vimtex#motion#init_buffer() " {{{1
|
||||||
if !g:vimtex_motion_enabled | return | endif
|
if !g:vimtex_motion_enabled | return | endif
|
||||||
|
|
||||||
|
" Highlight matching delimiters ($, (), ...)
|
||||||
|
if g:vimtex_motion_matchparen
|
||||||
|
augroup vimtex_motion
|
||||||
|
autocmd!
|
||||||
|
autocmd! CursorMoved <buffer> call s:highlight_matching_pair()
|
||||||
|
autocmd! CursorMovedI <buffer> call s:highlight_matching_pair()
|
||||||
|
augroup END
|
||||||
|
endif
|
||||||
|
|
||||||
" Utility map to avoid conflict with "normal" command
|
" Utility map to avoid conflict with "normal" command
|
||||||
nnoremap <buffer> <sid>(v) v
|
nnoremap <buffer> <sid>(v) v
|
||||||
nnoremap <buffer> <sid>(V) V
|
nnoremap <buffer> <sid>(V) V
|
||||||
|
Loading…
Reference in New Issue
Block a user