Wazery
Wazery

Reputation: 15863

How to press a key on function call to move to its body

Can you give me plugin or something like that for vim to move the cursor or open a source file that contains the function's body when pressing a key on its prototype or call

Upvotes: 2

Views: 208

Answers (2)

rownage
rownage

Reputation: 2404

If you want to just use a simple solution without plugins (despite being less intuitive and case-specific), you can use /searchstring to search for the keyword.

Example: /myFunction would search for and go to the first instance of that function (the prototype, if you are at the top of the file) and pressing n would send you to the next time it is used (which might be the begninning of the body, but it also might be some time when it is called in a different function).

It's not a plugin or anything, but it's useful nonetheless.

Upvotes: 1

Greg Hewgill
Greg Hewgill

Reputation: 992717

It sounds like you're looking for the tags feature.

Upvotes: 5

Related Questions