tags:

views:

66

answers:

1

is it possible to jump to function definitions in vim without using plugins or ctags?

and if so, how?

a related question:
http://stackoverflow.com/questions/635770/jump-to-function-definition-in-vim

+1  A: 

Were it possible, why would anybody write a plug-in or use ctags?

So let us assume that it is not.

You can use # and * to search backwards and forwards (respectively) for the word under your cursor in the current buffer.

Or you can use :vimgrep and CTRL-R CTRL-W to search for the word under the cursor in a given path.

Of course these match words, not function definitions, so they may match calls to a given function or variables with the same name. But that's th price you'd have to pay for not using ctags, I guess.

Johnsyweb
There's also the command gd
François
gd doesn't do anything when i try using it.
Hermann Ingjaldsson
http://vimdoc.sourceforge.net/htmldoc/pattern.html#gd - When the cursor is on a local **variable**, this command will jump to its declaration.
Johnsyweb
seems like it only works for local declarations. my declarations are located remotely.
Hermann Ingjaldsson