开发者

Vim and ctags: tag filenames

开发者 https://www.devze.com 2023-03-13 10:26 出处:网络
Is it possible to have ctags generate tags for filenam开发者_如何学Goes 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...Try runnin

Is it possible to have ctags generate tags for filenam开发者_如何学Goes 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...


Try running ctags -R --extra=f .

The --extra=f option tells ctags to:

"Include an entry for the base file name of every source file (e.g. "example.c"), which addresses the first line of the file."

When you open vim, you can the use :tag <filename> to jump to the first line of the file.


You can open the filename under the cursor with gf

http://vim.wikia.com/wiki/Open_file_under_cursor


You can also use cscope:

:cs find f <filename>

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.


Have you tried setting your path and then using vim's 'gf' command?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号