How to navigate in large project in VIM

后端 未结 12 2451
温柔的废话
温柔的废话 2020-12-12 10:19

How do you manage big projects (hundreds of files) using only VIM?

I personally start having problems in any larger than small project.

  • is there any wa
12条回答
  •  温柔的废话
    2020-12-12 10:39

    Starting in Vim 7.3, the :find command has tab-completion of filenames.

    So if you set your 'path' option to contain your entire project (probably using the ** wildcard to allow recursively searching subdirectories), then you can use the :find, :sfind, :tabfind, etc. commands with completion to get to any file in your project. This also allows jumping to files directly with gf and friends if the file name is in your text, for example in an include directive.

    With this method, no external tools or plugins are needed for navigating to specific files. Although, it may admittedly not be as fast or easy to use, and doesn't address the need for jumping to definitions. For definitions, I use ctags as other answers suggest.

提交回复
热议问题