How to effectively use Vim: wildmenu

My favorite is

set wildmenu
set wildmode=longest:list,full

First tab will complete to longest string and show the the match list, then second tab will complete to first full match and open the wildmenu.


Probably the most comfortable option, at least for me is:

set wildmenu
set wildmode=longest:full,full

That means that on first <Tab> it will complete to the longest common string and will invoke wildmenu (a horizontal and unobtrusive little menu). On next <Tab> it will complete the first alternative and it will start to cycle through the rest. You can go back and forth with <Tab> and <S-Tab> respectively.

An awesome example on how wildmenu is very useful, is to complete buffers, use the config I posted and then try:

:b<Tab>


wildmenu and wildmode are used for command line completion. The simplest way to try it would be with :color <Tab>: the command line is "expanded" vertically with a list of all the colorschemes available on your machine displayed in columns and an horizontal strip that you can navigate with <Tab> (forward) and <S-Tab> (backward).

The behaviour of command line completion and wildmenu are dependant on wildmode.

See :help wildmode and :help wildmenu for more details.

Tags:

Vim