Jump to function definition in vim, without using plugins or ctags

好久不见. 提交于 2019-12-24 06:36:12

问题


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

and if so, how?

a related question:
Jump to function definition in vim


回答1:


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.



来源:https://stackoverflow.com/questions/3913544/jump-to-function-definition-in-vim-without-using-plugins-or-ctags

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!