C++ 类似 cscope 的功能(使用vim)
是否有任何实用程序或插件可以为 C++ 提供类似 cscope 的功能。我正在寻找对
- 函数的所有引用
- 符号全局定义
- 调用的
- 的函数
- 调用函数文件(包括文件)
Is there any utility or plugin which provides cscope like functionality for C++. I am looking for
- all references to a symbol
- global definitions
- functions called by a function
- functions calling a function
- files including a file
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
线程中列出了一些工具, https://www.reddit.com /r/emacs/comments/1qktcb/cscope_like_functionality_that_ Correctly_handles/:
clang-tag find-def
) / 转到用法 (clang-tag grep
)。 vim-clang-tags 可用于列出所有用法 (:ClangTagsGrep< /代码>命令);还有 emacs 插件
./bin/rdm
守护进程) - 具有“follow-symbol”和“find-references” ”。与 emacs 交互 -"rtags.el"
; Vim 有两个项目: https://github.com/lyuts/vim-rtags (对 rtags 的丰富支持)和 https://github.com/shaneharper/vim-rtags (仅2 个命令)均具有“查找引用”和“查找定义”功能其他一些链接
还有一些快速(索引)grep,例如 Russ Cox 的代码搜索工具(它也适用于正则表达式 - https://github.com/google/codesearch;示例为 https: //codesearch.debian.net/about) 或任何其他索引 grep...
并且还有交叉引用工具(GUI 和 Web 服务器),例如 LXR 和其他...https://github.com/oracle/opengrok/wiki/Comparison-with-Similar-Tools
There are some tools listed in the thread, https://www.reddit.com/r/emacs/comments/1qktcb/cscope_like_functionality_that_correctly_handles/:
clang-tag find-def
) / go to usage (clang-tag grep
). vim-clang-tags can be used to list all usages (:ClangTagsGrep
command); there is emacs plugin too./bin/rdm
daemon) - has "follow-symbol" and "find-references". Intergates with emacs -"rtags.el"
; there are two projects for Vim: https://github.com/lyuts/vim-rtags (rich support of rtags) and https://github.com/shaneharper/vim-rtags (only 2 commands) both with "Find references" and "find definition" functionsSome other links
And there are some fast (indexed) greps like Russ Cox’ codesearch tools (It works with regex too - https://github.com/google/codesearch; example is https://codesearch.debian.net/about) or any other indexed grep...
And there are cross ref tools (GUI and web-servers) like LXR and other... https://github.com/oracle/opengrok/wiki/Comparison-with-Similar-Tools
Vim 可以开箱即用地直接与 cscope 连接。键入
:h cscope
。这需要在编译 Vim 时启用 cscope 功能并将 cscope 安装到您的计算机上。cscope 网页上有一个 Vim + cscope 教程。
Vim can interface directly with cscope out of the box. Type
:h cscope
. This requires cscope functionality to be enabled when Vim is compiled and for cscope to be installed on your computer.There is a Vim + cscope tutorial on the cscope web page.
尝试 YouCompleteMe。
它不仅可以为 C 和 C 语言提供代码补全、转到定义和重构功能。 C++,但适用于 Rust、Go、Java、C# 等。
确保按照所述安装它并支持 clangd 这里。
Try YouCompleteMe.
It's got code completion, go-to-definition and refactoring not just for C & C++, but for Rust, Go, Java, C# and more.
Make sure to install it with support for clangd as described here.