如何在 VIM 中的大型项目中导航 [英] How to navigate in large project in VIM
问题描述
如何仅使用 VIM 管理大型项目(数百个文件)?
How do you manage big projects (hundreds of files) using only VIM?
我个人开始在任何比小项目都大的项目中遇到问题.
I personally start having problems in any larger than small project.
- 有什么方法可以快速转到文件",最好是名称补全?
- 转到类定义"也一样,当它在另一个文件中时
我有点了解 VIM 的所有基础知识,所以我用它来编写脚本或快速编辑一些源代码没有问题.但是当我必须在文件之间导航时,它对我来说真的很混乱.
I kinda know all the VIM basics, so I don't have problem using it for writing scripts or quick editing some source code. But it gets really messy for me when I have to navigate between files.
推荐答案
VIM 对标签有很好的支持.为项目创建标签文件后,您可以跳转到方法、类等的定义或声明,包括跨文件跳转,所有这些都在同一个编辑会话中.
VIM has excellent support for tags. Once you have created a tags file for your project, you can jump to a definition or declaration of a method, class, etc., including jumping across files, all inside the same editing session.
试试
:help tags
要为 C/C++ 生成标签文件,请转到您的 shell 提示符(我假设您的系统是 *nix/Cygwin)并键入
To generate a tags file for C/C++, go to your shell prompt (I'm assuming your system is *nix/Cygwin) and type
info ctags
或
ctags --help
这篇关于如何在 VIM 中的大型项目中导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!