diff options
author | Jordan <me@jordan.im> | 2023-01-29 09:39:44 -0700 |
---|---|---|
committer | Jordan <me@jordan.im> | 2023-01-29 09:39:44 -0700 |
commit | bd39597a7c882103e41141107d5e6f4a7ab2d662 (patch) | |
tree | 13cbd6bba67235cf300d905d1b8455428f28dcb3 /.vim/pack/plugins/start/vim-autotag/plugin/autotag.vim | |
parent | f3b8f4423ab8bd38220adaaa2683a2709a1fe1d8 (diff) | |
download | dotfiles-bd39597a7c882103e41141107d5e6f4a7ab2d662.tar.gz dotfiles-bd39597a7c882103e41141107d5e6f4a7ab2d662.zip |
Diffstat (limited to '.vim/pack/plugins/start/vim-autotag/plugin/autotag.vim')
-rwxr-xr-x | .vim/pack/plugins/start/vim-autotag/plugin/autotag.vim | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/.vim/pack/plugins/start/vim-autotag/plugin/autotag.vim b/.vim/pack/plugins/start/vim-autotag/plugin/autotag.vim new file mode 100755 index 0000000..d09fff7 --- /dev/null +++ b/.vim/pack/plugins/start/vim-autotag/plugin/autotag.vim @@ -0,0 +1,39 @@ +" +" (c) Craig Emery 2017-2022 +" +" Increment the number below for a dynamic #include guard +let s:autotag_vim_version=1 + +if exists("g:autotag_vim_version_sourced") + if s:autotag_vim_version == g:autotag_vim_version_sourced + finish + endif +endif + +let g:autotag_vim_version_sourced=s:autotag_vim_version + +" This file supplies automatic tag regeneration when saving files +" There's a problem with ctags when run with -a (append) +" ctags doesn't remove entries for the supplied source file that no longer exist +" so this script (implemented in Python) finds a tags file for the file vim has +" just saved, removes all entries for that source file and *then* runs ctags -a + +if !has("python3") + finish +endif " !has("python3") + +function! AutoTagDebug() + new + file autotag_debug + setlocal buftype=nowrite + setlocal bufhidden=delete + setlocal noswapfile + normal +endfunction + +augroup autotag + au! + autocmd BufWritePost,FileWritePost * call autotag#Run () +augroup END + +" vim:shiftwidth=3:ts=3 |