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

前端 未结 2 1266
栀梦
栀梦 2020-12-23 17:30

Pre: I\'ve been working in VIM for like a year already. Lots of great things: combinations, scripts. Whenever I\'m editing something in a different editor,

相关标签:
2条回答
  • 2020-12-23 17:55

    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.

    0 讨论(0)
  • 2020-12-23 17:58

    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.

    0 讨论(0)
提交回复
热议问题