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:
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 |
Choosing your components |
Choosing your .vimrc settings |
Specifying your install location |
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 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:
Listing installed features
It's also possible to list which features are installed in your setup by running from the terminal:
Conclusion
One this post we reviewed three different ways to install Vim, with WSL being our recommendation. We hope it helps!