From ec7d6822806cc2e2b14330e4a07d6deb47641518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Sun, 7 Feb 2016 21:26:03 +0100 Subject: [PATCH] Use buffer specific autocmds --- autoload/vimtex/motion.vim | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/autoload/vimtex/motion.vim b/autoload/vimtex/motion.vim index 526219f..807ec07 100644 --- a/autoload/vimtex/motion.vim +++ b/autoload/vimtex/motion.vim @@ -15,15 +15,6 @@ endfunction function! vimtex#motion#init_script() " {{{1 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 " @@ -56,6 +47,15 @@ endfunction function! vimtex#motion#init_buffer() " {{{1 if !g:vimtex_motion_enabled | return | endif + " Highlight matching delimiters ($, (), ...) + if g:vimtex_motion_matchparen + augroup vimtex_motion + autocmd! + autocmd! CursorMoved call s:highlight_matching_pair() + autocmd! CursorMovedI call s:highlight_matching_pair() + augroup END + endif + " Utility map to avoid conflict with "normal" command nnoremap (v) v nnoremap (V) V