Vim plugin which uses the compiler Include to jump to function, and show prototype and auto-compilation

StackOverflow https://stackoverflow.com/questions/21844787

  •  13-10-2022
  •  | 
  •  

In vim on Linux mainly, if I've a c or c++ source file which includes many other header files.

Is there any plugin available which can use the compiler Include (-I) and shows the syntax of the function on which the cursor or something like jump to definition.

I know about ctag, but is there anything more advance something like Visual Studio on windows.

有帮助吗?

解决方案

There is YouCompleteMe and ClangComplete. These both use libclang to handle the completion.

其他提示

What you ask for is the whole purpose of ctags. If you haven't done that yet, you should read :help tags and :help ctags. The :tselect command may be what you are looking for.

Cscope is another slightly more advanced solution (it does "jump to usage" too). See :help cscope for more information.

That said, Vim has built-in "include-search": :help include-search has this nice little mapping example:

:map <F4> [I:let nr = input("Which one: ")<Bar>exe "normal " . nr ."[\t"<CR>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top