Vim Tip #2: Tab Completion

2018-11-13(Tue)

tags: Vim

Vim Tips

Vim's default tab completion is horrible. Type :tabnew <Tab> in a folder with multiple filenames, and it will fill in the first available filename. Hit <Tab> again, and it will fill in the next filename. Rinse and repeat. This is NOT a viable method for a folder with hundreds of files. (You should try this so you know just how much of an improvement my suggested change is.)

Open your ~/.vimrc (or ~/.config/init.vim if you use Neovim) and add the following lines:

" get us bash-like tab completions:
set wildmode=longest,list

You should also type :help wildmode to read a bit about it.

All the gory details