VIM: More precise C/C++ code parsing solutions?

心已入冬 提交于 2019-11-29 21:00:35

Search and Call tree

You could try eclim, which is a way to use some Eclipse features in Vim.

For C/C++, it provides :

  • Context sensitive completion (although it is disabled on Windows because it is buggy)
  • Context sensitive search in Project files (through :CSearchContext)
  • Call tree for functions/methods (:CCallHierarchy)
  • Code Validation (:Validate)

It is not great, but it can help in some cases.

Code Completion

Regarding automatic code completion, I primarily use OmniCppComplete, which is using tags to provide Context aware code completion. It is not that bad.

As advised by Luc Hermitte, you can also use clang_complete which does not need ctags, but needs clang installed.

Unfortunatelly, it is a real problem. ctags or cscope can hardly compete with Visual Studio code browsing - it actually uses a C++ compiler front-end to parse the code for the editor.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!