Alex Rivera | Logout

Vim auto-generate ctags

Asked 2008-09-30T22:47:30.393
58

Right now I have the following in my .vimrc:

au BufWritePost *.c,*.cpp,*.h !ctags -R

There are a few problems with this:

  1. It's slow -- regenerates tags for files that haven't changed since the last tag generation.
  2. 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!

Edit
Report

1 Answer

1

In my opninion, plugin Indexer is better.

http://www.vim.org/scripts/script.php?script_id=3221

It can be:

1) an add-on for project.tar.gz

2) an independent plugin

  • background tags generation (you have not wait while ctags works)
  • multiple projects supported
answered 2011-03-26T09:45:47.123

Your Answer