Stop Vim Completion Searching Included Files - WezM.net by Wesley Moore
WezM.net

Stop Vim Completion Searching Included Files

Published on

I use vim coupled with the SuperTab plugin for my text editing and auto-completion needs. In some vim setups (E.g. Mac OS X) it is configured by default to search included files when completing words. This sounds like a useful feature but it turns out not to be. It has a habit of searching the include files of system libraries and modules, the keywords of which you rarely want. Its also quite a slow operation as it trawls through all the files. The solution is to add the following in your .vimrc file.

set complete=.,w,b,u,t

This is the same set of flags as the default except with the ’i’ option removed. See the help for the ‘complete’ option for an explanation of what each flag means.

Comment icon Stay in touch!

Follow me on Twitter or Mastodon, subscribe to the feed, or send me an email.