跳转到vim中的函数定义,无需使用插件或ctags [英] Jump to function definition in vim, without using plugins or ctags
问题描述
是否有可能跳到vim中的函数定义而不使用插件或ctags?
is it possible to jump to function definitions in vim without using plugins or ctags?
如果是这样,怎么样?
相关问题:
跳转到函数定义in vim
推荐答案
如果有可能,为什么会有人编写插件或使用 ctags
?
Were it possible, why would anybody write a plug-in or use ctags
?
所以我们假设它不是。
您可以使用 # 和 * 分别向后和向前搜索光标下的单词当前缓冲区。
You can use # and * to search backwards and forwards (respectively) for the word under your cursor in the current buffer.
或者您可以使用 :vimgrep
和 CTRL - R CTRL - kbd> 在给定路径下搜索光标下的单词。
Or you can use :vimgrep
and CTRL-R CTRL-W to search for the word under the cursor in a given path.
当然这些匹配字,而不是函数定义,所以他们可以将调用与给定函数或具有相同名称的变量进行匹配。但那是你不得不为不使用 ctags
而付出的代价,我猜。
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.
这篇关于跳转到vim中的函数定义,无需使用插件或ctags的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!