Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've installed taglist and nerdtree plugins, and I wonder if there's way to quickly find the location where some function is defined, just as what Control and pressing function name in Eclipse does? Help would be appreciated!

share|improve this question
up vote 2 down vote accepted

vim comes with ctags support built in. If you have a tags file make sure it can be found by vim by adding it to the tags variable (check if the default works first though)

:set tags+=/path/to/tags

Then you can use :tselect SOME_FUNC to list the file locations. You might only need to type the first characters of the function name and could use TAB to complete.

share|improve this answer
Thanks for quick reply.I've make a new directory /usr/include/tags for tags and put set tags+=/usr/include/tags into .vimrc,and seem still need something? – SpawnST May 13 '10 at 3:26
@SpawnST does your '/usr/include/tags' directory hold any 'tags' files? – akira May 13 '10 at 4:54
You need to generate the tags file launching ctags *.c from the directory containing your source files. See man ctags and also this stackoverflow question for more tips on vim & ctags: – mrucci May 13 '10 at 5:07
@akira,nope,what's tags files,how can i generate them? – SpawnST May 13 '10 at 5:10
@mrucci,OIC,I'll check that,thank you. – SpawnST May 13 '10 at 5:11

You can also put the cursor somewhere in the function name and press Ctrl-]

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .