Right now I have the following in my .vimrc
:
au BufWritePost *.c,*.cpp,*.h !ctags -R
There are a few problems with this:
- It's slow -- regenerates tags for files that haven't changed since the last tag generation.
- I have to push the enter button again after writing the file because of an inevitable "press Enter or type command to continue".
When you combine these two issues I end up pushing the additional enter too soon (before ctags -R
has finished), then see the annoying error message, and have to push enter again.
I know it doesn't sound like a big deal, but with the amount of file writes I do on a given day it tends to get really annoying. There's gotta be a better way to do it!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…