How to refresh taglist in vim?

前端 未结 4 722
攒了一身酷
攒了一身酷 2021-02-14 13:27

When I make a change to a file, for example, add a function, how can I make the taglist automatically update the \"tag list\" in its windows after I save the change?

4条回答
  •  忘了有多久
    2021-02-14 13:56

    I adapted my setup from the C++ code completion vim tip.

    map  :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .
    

    When needed, I press Ctrl-F12 to regenerate tags.

    If you're using vim-taglist, you could add to your .vimrc an autocommand for the BufWritePost event to update the taglist window after every save:

    autocmd BufWritePost *.cpp :TlistUpdate
    

提交回复
热议问题