在
vim中,如何在某个目录下的文件中查找所有出现的变量?
我知道vimgrep有时可以工作,但是它只查找文本,如果其他类具有相同名称的变量并且我只想要特定类下的变量,则它不起作用.
我该怎么办?或者我应该改为使用IDE?
为什么要在已有的IDE中使用另一个IDE? Vim是一个可配置的IDE,可用于不同的语言.
您可以使用代码的cscope
到build a database.这个数据库
- Allows searching code for:
- all references to a symbol
- global deFinitions
- functions called by a function
- functions calling a function
- text string
- regular expression pattern
- a file
- files including a file
- Curses based (text screen)
- An @R_575_4045@ion database is generated for faster searches and later reference
- The fuzzy parser supports C,but is flexible enough to be useful for C++ and Java,and for use as a generalized ‘grep database’ (use it to browse large text documents!)
- Has a command line mode for inclusion in scripts or as a backend to a GUI/frontend
- Runs on all flavors of Unix,plus most monopoly-controlled operating systems.
编辑(略加OT):
在代码上使用Vim时非常方便的另一个很酷的东西是使用Ctags的taglist插件:
The “Tag List” plugin is a source code browser plugin for Vim and provides an overview of the structure of source code files and allows you to efficiently browse through source code files for different programming languages.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。