Showing posts with label WSL. Show all posts
Showing posts with label WSL. Show all posts

Monday, November 2, 2020

Installing Vim on Windows

Installing Vim on Windows is very simple! Learn how to install Vim on Windows including on WSL and Cygwin.
Photo by Alex Knight on Unsplash

These days, Vim becomes more and more popular on Windows. Today, let's learn how to install Vim on Windows, including:

  1. gVim
  2. WSL (our preferred option)
  3. Cygwin

Installing gVim on Windows

gVim is a Vim GUI for Windows. For sometime, this and the Cygwin alternative (discussed below) were the main ways to run Vim on Windows.

Installing gVim is simple and follows the standard way to install applications on Windows. So go ahead and download your installer from Vim's official download page, run the installation and follow the instructions.

Initial Setup
Choose the components you want to install:
Choosing your components
Choose your vimrc settings:
Choosing your .vimrc settings
Specify the install location:
Specifying your install location
And that's it! Vim is now installed on your system. Start it from the Start Menu.

Installing Vim on WSL

Despite installing Vim using the installer above feel more natural to Windows users, we'd like to suggest a different approach: installing Vim on WSL. Since it's really simple, follows the same setup described by us in our Linux tutorial and is the way you will probably do when using Linux. 

For this setup we assume you have a Ubuntu WSL instance and WSL installed in your system. Installing Vim on Ubuntu under WSL is done by opening a WSL terminal and typing these commands:

sudo apt-get update
sudo apt-get install vim

Once you install it, open a new WSL terminal and run vim with the vim command from the command line:

Vim running on a Ubuntu WSL instance using the new Windows Terminal

Installing Vim using Cygwin

Installing Vim with Cygwin (a POSIX-compatible runtime for Windows) may be the least recommended way to do so these days. However, if you have Cygwin installed already and is comfortable with it, installing Vim on it simply requires running Cygwin's setup.exe again and selecting Vim.

If you don't have Cygwin installed, install it and select Vim from your install screen.

Testing the Install

With Vim installed, next step is to test if it's running with the command below:


Exiting Vim

In case it's your first time with Vim, to exit press:

<Esc> :q! 

Listing installed features

It's also possible to list which features are installed in your setup by running from the terminal:

vim --version
The enabled features will be marked with (+) while the disabled should have the (-) symbol aside.


One this post we reviewed three different ways to install Vim, with WSL being our recommendation. We hope it helps!

See Also

Any comment about this page? Please contact us on Twitter

Featured Article

Vim - Ex Mode

When learning Vim, it's important to understand its modes, including the  Ex Mode  where you can continually type your commands u...

Popular Posts