From 918fa4b106bdcce036c21ec0c2e242628ad611e4 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Sat, 23 Mar 2019 12:13:35 -0500 Subject: [PATCH] .vimrc: Add vim-gutentags plugin --- .vimrc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 51ff73c..4355e85 100644 --- a/.vimrc +++ b/.vimrc @@ -47,6 +47,7 @@ Plug 'vim-airline/vim-airline' " lean & mean status/tabline Plug 'vim-airline/vim-airline-themes' " themes for vim-airline " Integrations +Plug 'ludovicchabant/vim-gutentags' " automatic ctags Plug 'mileszs/ack.vim' " Ack wrapper Plug 'tpope/vim-fugitive' " Git wrappers @@ -142,11 +143,29 @@ endfunction autocmd! User GoyoEnter nested call goyo_enter() autocmd! User GoyoLeave nested call goyo_leave() -" vim-pandoc +" pandoc let g:pandoc#syntax#conceal#use = 0 " disable conceal pretty display let g:pandoc#folding#fdc = 0 " disable foldcolumn let g:pandoc#folding#level = 6 " open all folds by default +" gutentags +let g:gutentags_enabled_user_func = 'GutentagsCheckEnabled' +function! GutentagsCheckEnabled(file) + let file_path = fnamemodify(a:file, ':p:h') + + " enable gutentags if ctags file already exists + " tip: `touch tags` in project root to enable gutentags auto-updating + try + let gutentags_root = gutentags#get_project_root(file_path) + if filereadable(gutentags_root . '/tags') + return 1 + endif + catch + endtry + + return 0 +endfunction + " --------------------------------------------------------------------------- " Terminal Settings " --------------------------------------------------------------------------- -- 2.47.1