For example, when I type 'inclu', is there a method which can complete it to 'include'? Thank you.
Most of vim
's (complex) auto-completion is done via the ^X
key mapping. ^X^]
will autocomplete based on tags generated by ctags(1)
. ^X^P
looks for previous keywords in the file that can be used for completion. ^X^K
looks into a configurable dictionary
for completion words. ^X^I
looks into included files and pops up a menu for completing keywords from within those files. ^X^D
completes from #define
.
Perhaps the simplest way to get what you're after is to fully type #include <...>
once in your file. The second file to be included could then be handled via #incl^X^P
and then keep going.
If you want to put slightly more effort into it, create a ~/.vim/dict
file with the keywords you want to autocomplete, add the file to the dictionary
variable (:help dictionary
), and use ^X^K
to insert it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With