开发者

How to create an autocomplete list in ViM?

开发者 https://www.devze.com 2022-12-12 23:19 出处:网络
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 completi

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

精彩评论

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