A question about vim i_CTRL-N complement (its detial implentation)?

14 views
Skip to first unread message

tao yang

unread,
Jul 14, 2023, 2:49:24 AM7/14/23
to vim_use
A question about vim i_CTRL-N complement?
How does vim determine whether or not it is possible to do a complement when complementing? Is it based on the first few letters of the current cursor? Sorry, I did a rough search for this in vim's source code and didn't find a specific implementation in the vimscript or c language files.
On a side note, almost all blogs that present a primer on vim completion now claim in general that vim presses i_CTRL_N which I think is very bad, at least for vim promotion.

The motivation for the above question comes from the fact that I'm a staunch no-pluginist, as my work environment doesn't allow me to connect directly to the internet, and therefore almost all vim features that I like to implement with minimal functionality and redundancy use vim scripts that I write myself. When I was implementing my own auto-completion plugin, i.e. vim automatically pops up input suggestions (auto_CTRL-N), I found that the existing methods all work in a crappy way, by first determining whether the character or word under the cursor can be completed or not, and then calling (i_CTRL-N). This is lame, because i_CTRL-N itself determines if the character or word under the cursor can be filled in or not, and I'd like to figure out a way to directly utilize the information generated by pressing i_CTRL-N.

Translated with www.DeepL.com/Translator (free version)
Reply all
Reply to author
Forward
0 new messages