开发者

How to create an autocomplete list in ViM?

As I am typing code, I would like to get the symbol before and after a specific character (e.g. '.' in C#) and pass that to my own program which would then in return give a list of possible completions.

For example if开发者_如何转开发 user is typing:

m_Filename.M

I would want to call out into my own DLL/EXE passing "m_Filename" and "M" and my program return a list such as

Match
Matches

And have that popup in a list in ViM for autocompletion suggestions.

Note that this is not asking how to write the DLL/EXE which provides the suggestions, just the functionality in ViM for autocomplete .


In vim, see :help 'omnifunc' and :help complete-functions. You can write your own vim function to do completions, and that function can, in turn, invoke an external executable.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜