I use vim from the base directory of my source code. I would like to have autocomplete consider every word of every file in this directory (and subdirectories) when editing a single file.
Completion is controlled by the 'complete'
option. With the k
flag, you can have Vim scan files. The **
wildcard stands for a recursive descent into subdirectories. Voila:
:set complete=k**/*
When you want to keep the other default locations (other buffers, included files, etc.), use :set complete+=
to add to it.
Alternatively, as this can be too slow for a default, you can use the 'dictionary' option and use Ctrl-X Ctrl-K completion:
:set dictionary=**/*
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