Vim 和 ctags:标记文件名
是否也可以让 ctags 为文件名生成标签?我希望能够跳转到给定文件名的文件。 :find 与标签相比似乎非常慢......
Is it possible to have ctags generate tags for filenames as well? I would like to be able to jump to a file given a filename. :find seems to be awfully slow compare to tags...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
尝试运行
ctags -R --extra=f 。
--extra=f
选项告诉 ctags:当你打开vim时,你可以使用
:tag
跳转到文件的第一行。Try running
ctags -R --extra=f .
The
--extra=f
option tells ctags to:When you open vim, you can the use
:tag <filename>
to jump to the first line of the file.您可以使用 gf 打开光标下的文件名
http://vim.wikia.com/wiki/Open_file_under_cursor
You can open the filename under the cursor with gf
http://vim.wikia.com/wiki/Open_file_under_cursor
您还可以使用
cscope
:或者,如果您按照
:help cscope
中的建议在 vim 中设置了 cscope,请将光标放在文件名上,然后按f
。You can also use
cscope
:or, if you've setup cscope in vim as recommended in
:help cscope
, put the cursor on top of a filename, and press<C-_>f
.您是否尝试过设置路径然后使用 vim 的“gf”命令?
Have you tried setting your path and then using vim's 'gf' command?