Guides Give Yourself a Menu in Vim

Give Yourself a Menu in Vim

This week, I have a quick couple of tips for Vim users that should make life just a little bit easier when using Vim in command mode and completing filenames.

By default, when you use Vim you can type the first letter or first few letters of a command, and you’ll be able to cycle through the commands using Tab. For example, type :e, and you can cycle through all the commands that begin with e:


That’s just a short list. But what if you’d like to see a quick menu of the available commands instead? For this, you have a little-known Vim option, wildmenu. As a reminder for folks not particularly well-versed with Vim, the : tells Vim to enter command mode from its normal mode.

While in Vim, just run :set wildmenu, and you’ll toggle the option to enable the enhanced command-line completion. Note that you enable this any time by adding it to your ~/.vimrc.

So what does this little toggle get you? Now when you hit Tab, you’ll get a one-line menu at the bottom so you can see all the options that begin with the letters you’ve typed. So :e will give you the same list as before, but in a one-line menu at the bottom. Hit Tab again, and it will move to the next command, and so forth. You can also use Ctrl-p and Ctrl-n to move backward and forward (respectively) through the list.

This doesn’t work just with commands, though–it also works with filenames. If you’re looking to open a file, for example, using :r (read) and you type the first character or characters, hitting Tab will display all the filenames that match in a one-line menu at the bottom.

Setting wildmenu is a minor thing, but it’s another way to boost productivity and make Vim a bit more usable. I recommend giving this a shot. See if you don’t find that it makes life a bit easier!

Joe ‘Zonker’ Brockmeier is a freelance writer and editor with more than 10 years covering IT. Formerly the openSUSE Community Manager for Novell, Brockmeier has written for Linux Magazine, Sys Admin, Linux Pro Magazine, IBM developerWorks,,, Linux Weekly News, ZDNet, and many other publications. You can reach Zonker at and follow him on Twitter.

Follow ServerWatch on Twitter

Latest Posts

Get-MsolUser PowerShell Attributes & Properties

This article has been updated for 2020. Please note that WAAD was retired in 2018, but the cmdlets listed in this article are still...

Microsoft Azure PowerShell Scripts and Commands

Using PowerShell scripts and commands for quickly executing tasks in Windows operating systems offers a number of benefits over traditional scripting languages, such as...

Best Cloud Based Services & Companies

Any company that’s delayed introducing cloud-based software into their infrastructure needs to consider leveraging these new technologies to reap all the benefits cloud computing...

Best Load Balancers for 2020

The best load balancers are able to provide either hardware or software-based load balancing to ensure maximum service availability by offering network traffic distribution...

Best Enterprise Database Software & Systems for 2020

If you're looking for a system to store your company’s data on-premises or in the cloud, chances are you'll be considering at least one...

Related Stories