msmechanized
msmechanized

Reputation: 436

VIM: Customizing the omnicomplete popup menu

Is there a way of adding more information in my popup menu? For example:

enter image description here

What I would like is something like

< return type > < Function Prototype > <Function or Member indicator > < Filename >

This information can be provided by ctags. Currently I use vim without any plugins and the omnicompletion just does word completion using ctags without any information regarding its context

Upvotes: 1

Views: 736

Answers (1)

Ingo Karkat
Ingo Karkat

Reputation: 172758

Behind omnicompletion (which you write you're using) is a custom completion function; to get more data displayed in the popup menu, that function would need to be extended. You can also write your own completion functions, but as the data processing has to be done in Vimscript, it might be slower than the built-in ones.

However, the built-in tags completion (which you hint at by mentioning ctags) :help i_CTRL-X-CTRL-] has this feature:

      The 'showfulltag' option can be used to add context
      from around the tag definition.

When completing a word in insert mode (see |ins-completion|) from the tags file, show both the tag name and a tidied-up form of the search pattern (if there is one) as possible matches. Thus, if you have matched a C function, you can see a template for what arguments are required (coding style permitting).

Upvotes: 2

Related Questions