Updated augroup names

This commit is contained in:
Karl Yngve Lervåg 2015-06-20 23:09:56 +02:00
parent b1b15c6877
commit d36be66c93
3 changed files with 22 additions and 22 deletions

View File

@ -35,19 +35,6 @@ function! vimtex#fold#init_script() " {{{1
" Define some script variables " Define some script variables
let s:parts = '\v^\s*(\\|\% Fake)(' . join(g:vimtex_fold_parts, '|') . ')>' let s:parts = '\v^\s*(\\|\% Fake)(' . join(g:vimtex_fold_parts, '|') . ')>'
let s:secs = '\v^\s*(\\|\% Fake)(' . join(g:vimtex_fold_sections, '|') . ')>' let s:secs = '\v^\s*(\\|\% Fake)(' . join(g:vimtex_fold_sections, '|') . ')>'
" For automatic folding with foldmethod=expr:
" The foldexpr function returns "=" for most lines, which means it can
" become slow for large files. The following is a hack that is based on
" this reply to a discussion on the Vim Developer list:
" http://permalink.gmane.org/gmane.editors.vim.devel/14100
if g:vimtex_fold_automatic
augroup latex_fold
autocmd!
autocmd InsertEnter *.tex call FdmSave()
autocmd InsertLeave *.tex call FdmRestore()
augroup END
endif
endfunction endfunction
" }}}1 " }}}1
@ -66,14 +53,27 @@ function! vimtex#fold#init_buffer() " {{{1
" Define commands " Define commands
command! -buffer VimtexRefreshFolds call vimtex#fold#refresh('zx') command! -buffer VimtexRefreshFolds call vimtex#fold#refresh('zx')
" Set options for automatic/manual mode " Set options for automatic/manual folding mode
if g:vimtex_fold_automatic if g:vimtex_fold_automatic
nnoremap <silent><buffer> u :call FdmSave()<cr>u:call FdmRestore()<cr> nnoremap <silent><buffer> u :call FdmSave()<cr>u:call FdmRestore()<cr>
" For automatic folding with foldmethod=expr:
" The foldexpr function returns "=" for most lines, which means it can
" become slow for large files. The following is a hack that is based on
" this reply to a discussion on the Vim Developer list:
" http://permalink.gmane.org/gmane.editors.vim.devel/14100
if g:vimtex_fold_automatic
augroup vimtex_fold_automatic
autocmd!
autocmd InsertEnter <buffer> call FdmSave()
autocmd InsertLeave <buffer> call FdmRestore()
augroup END
endif
else else
augroup latex_fold augroup vimtex_fold_manual
autocmd! autocmd!
autocmd CursorMoved *.tex call vimtex#fold#refresh('zx') autocmd CursorMoved <buffer> call vimtex#fold#refresh('zx')
autocmd CursorMoved *.tex autocmd! latex_fold autocmd CursorMoved <buffer> autocmd! vimtex_fold_manual
augroup END augroup END
endif endif
endfunction endfunction

View File

@ -28,7 +28,7 @@ function! vimtex#latexmk#init_script() " {{{1
" Ensure that all latexmk processes are stopped when vim exits " Ensure that all latexmk processes are stopped when vim exits
if g:vimtex_latexmk_continuous if g:vimtex_latexmk_continuous
augroup latex_latexmk augroup vimtex_latexmk
autocmd! autocmd!
autocmd VimLeave * call vimtex#latexmk#stop_all() autocmd VimLeave * call vimtex#latexmk#stop_all()
augroup END augroup END
@ -73,7 +73,7 @@ function! vimtex#latexmk#init_buffer() " {{{1
" Kill running latexmk process if all buffers for a latex project are closed " Kill running latexmk process if all buffers for a latex project are closed
if g:vimtex_latexmk_continuous if g:vimtex_latexmk_continuous
augroup latex_latexmk augroup vimtex_latexmk
autocmd BufLeave <buffer> call s:buffer_left() autocmd BufLeave <buffer> call s:buffer_left()
autocmd BufDelete <buffer> call s:buffer_deleted() autocmd BufDelete <buffer> call s:buffer_deleted()
augroup END augroup END
@ -269,7 +269,7 @@ function! vimtex#latexmk#output() " {{{1
silent exe 'split ' . tmp silent exe 'split ' . tmp
" Better automatic update " Better automatic update
augroup tmp_update augroup vimtex_tmp_update
autocmd! autocmd!
autocmd BufEnter * silent! checktime autocmd BufEnter * silent! checktime
autocmd CursorHold * silent! checktime autocmd CursorHold * silent! checktime
@ -277,7 +277,7 @@ function! vimtex#latexmk#output() " {{{1
autocmd CursorMoved * silent! checktime autocmd CursorMoved * silent! checktime
autocmd CursorMovedI * silent! checktime autocmd CursorMovedI * silent! checktime
augroup END augroup END
silent exe 'autocmd! BufDelete ' . tmp . ' augroup! tmp_update' silent exe 'autocmd! BufDelete ' . tmp . ' augroup! vimtex_tmp_update'
" Set some mappings " Set some mappings
nnoremap <buffer> <silent> q :bwipeout<cr> nnoremap <buffer> <silent> q :bwipeout<cr>

View File

@ -17,7 +17,7 @@ function! vimtex#motion#init_script() " {{{1
" Highlight matching parens ($, (), ...) " Highlight matching parens ($, (), ...)
if g:vimtex_motion_matchparen if g:vimtex_motion_matchparen
augroup latex_motion augroup vimtex_motion
autocmd! autocmd!
" Disable matchparen autocommands " Disable matchparen autocommands
autocmd BufEnter *.tex autocmd BufEnter *.tex