From d63b06e7f6959100f5b4ee48ff69970bdd550a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Wed, 10 Aug 2016 20:23:43 +0200 Subject: [PATCH] Minor simplification and improvement --- ftplugin/bib.vim | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ftplugin/bib.vim b/ftplugin/bib.vim index 2bca140..68596ff 100644 --- a/ftplugin/bib.vim +++ b/ftplugin/bib.vim @@ -4,7 +4,7 @@ " Email: karl.yngve@gmail.com " -if !get(g:, 'vimtex_enabled', 1) +if !get(g:, 'vimtex_enabled', 1) || !get(g:, 'vimtex_toc_enabled', 1) finish endif @@ -20,13 +20,11 @@ function! s:map(mode, lhs, rhs, ...) endif endfunction -if get(g:, 'vimtex_toc_enabled', 1) - command! -buffer VimtexTocOpen call vimtex#toc#open() - command! -buffer VimtexTocToggle call vimtex#toc#toggle() - nnoremap (vimtex-toc-open) :call vimtex#toc#open() - nnoremap (vimtex-toc-toggle) :call vimtex#toc#toggle() - call s:map('n', 'lt', '(vimtex-toc-open)') - call s:map('n', 'lT', '(vimtex-toc-toggle)') -endif +command! -buffer VimtexTocOpen call vimtex#toc#open() +command! -buffer VimtexTocToggle call vimtex#toc#toggle() +nnoremap (vimtex-toc-open) :call vimtex#toc#open() +nnoremap (vimtex-toc-toggle) :call vimtex#toc#toggle() +call s:map('n', 'lt', '(vimtex-toc-open)') +call s:map('n', 'lT', '(vimtex-toc-toggle)') " vim: fdm=marker sw=2