show function parameters in vim

喜夏-厌秋 提交于 2019-12-02 23:16:10

Do check out the autocomplpop and TTrCodeAssistor plug-ins.

As was already suggested, install the autocomplpop plugin. Then, to trigger omincompletion as you type for C files, you could add the following to your .vimrc:

let g:AutoComplPop_Behavior = { 
\ 'c': [ {'command' : "\<C-x>\<C-o>",
\       'pattern' : ".",
\       'repeat' : 0}
\      ]  
\}

If you don't want to trigger omnicompletion for every character typed, change the pattern value to suit your needs. For information on how to further customize, look at the documentation in the comment header of autocomplpop.vim

Moreover, to get a popup window with function parameters also add the following to your .vimrc:

let g:AutoComplPop_CompleteoptPreview = 1

To make it work make sure you generated a tags file with ctags.

YouCompleteMe is a nice alternative that offers fuzzy autocompletion and uses clang to deal with the semantics.

Check cream - it seems to have some C support. You'll need ctags.

A modern configuration of the powerful and famous Vim, Cream is now available for Microsoft Windows, GNU/Linux, and FreeBSD

... (Programmer Features)

  • Pop up prototype and information menu ( Alt+( ). View the function's prototype under the cursor without having to open the file with the definition.

Or you can try vim-assistant script.

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