SHARE
Facebook X Pinterest WhatsApp

Give Yourself a Menu in Vim

Written By
thumbnail Joe Brockmeier
Joe Brockmeier
Sep 26, 2011
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



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:

earlier
echo
echoerr
echohl

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.com, CIO.com, Linux Weekly News, ZDNet, and many other publications. You can reach Zonker at jzb@zonker.net and follow him on Twitter.

Follow ServerWatch on Twitter

thumbnail Joe Brockmeier

Joe Brockmeier is the editorial director of the Red Hat Blog. He joined Red Hat in 2013 as part of the Open Source and Standards (OSAS) group, now the Open Source Program Office (OSPO). Prior to Red Hat, Brockmeier worked for Citrix on the Apache OpenStack project, and was the first OpenSUSE community manager for Novell between 2008-2010. Brockmeier also has an extensive history in the tech press and publishing, having been editor-in-chief of Linux Magazine, editorial director of Linux.com, and a contributor to LWN.net, ZDNet, UnixReview.com, and many others.

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
6 Best Linux Virtualization Software for 2024
What Is a Network Policy Server (NPS)? | Essential Guide
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.