Minor simplification and improvement

This commit is contained in:
Karl Yngve Lervåg 2016-08-10 20:23:43 +02:00
parent fe4e9a4eb4
commit d63b06e7f6

View File

@ -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 <buffer> <plug>(vimtex-toc-open) :call vimtex#toc#open()<cr>
nnoremap <buffer> <plug>(vimtex-toc-toggle) :call vimtex#toc#toggle()<cr>
call s:map('n', '<localleader>lt', '<plug>(vimtex-toc-open)')
call s:map('n', '<localleader>lT', '<plug>(vimtex-toc-toggle)')
endif
" vim: fdm=marker sw=2