→ Category: vim

How did I live without vim's wildmenu all these years?

Written 2011-04-20 by Timo Dickscheid, tagged as programming, vim

Even after years of extensive usage, vim will surprise you eventually. Like today: I had a feeling that the way of switching buffers that I use (:b abc<Tab>, where 'abc' is a fragment of a file's name) may not be the most convenient one. I used the BufExplorer plugin for some months, but found it too bloated.

Then I stumbled upon vim's builtin wildmenu function, which really knocked me off of my feet! How was it possible that I didn't discover it earlier? Simply put the following line in your .vimrc:

set wildmenu

Then open a bunch of files, and try

:b <Tab>

to get a horizontal list of buffer names that you can navigate and select interactively. The improved Tab completion works for all commands, e.g.

:e <Tab>

will open a minimalistic file explorer for the current directory. Wowee!