Vim is a versatile editor that is highly customizable. For this reason, it has won the hearts of those who prefer high levels of customization and control in their text editors. With Vim, you can use key mappings
to execute sophisticated commands. Vim also offers a Recording
feature that makes it possible to automate keystroke sequences to run functions. Like many text editors, Vim gives you the advantage of adding plugins that extend the functionality by adding additional features.
Vim was originally created for Unix-based systems, but as time passed, this text editor found its way to the windows and Mac platforms. So, in this article, you will learn how to install the vim editor on the Windows Operating System.
Let us get started.
Downloading the Vim Editor.
To install the Vim editor, you need the executable file found on the official Vim website. https://www.vim.org/ .
Head over to the site and click on the Download button on the left side of the screen as shown below.
This should take you to the download section where you will find the different Operating systems.
We are interested on the Windows version.
Click on the standard self-installing executable to download the .exe
file.
Installing the Vim Editor.
Once the file is saved on your computer, open it to start the installation wizard.
-
Choose the language you wish for the installer and click Okay.
-
On the next page, you will notice that the executable will install Vim version 9. The version should vary depending on the time of download. Click Next to proceed.
- The next step is to accept the terms of License Agreement. Mark the check box and click next to proceed.
-
The next screen prompts you for the features you wish to install. This is step depends on your needs.
- Typical is the default type of install. You can add extra features by clicking on the features you need and this changes the type of install to custom.
- Minimal type of install removes all the extra features while the Full type will install all the additional features.
-
The next screen prompts for the enhancement settings and keyboard/mouse remapping.
-
Leave the Compatibility and enhancement section to default which enables all the vim enhancements.
This screen also enables you to add
key mappings
for the keyboard and the mouse as you wish. -
To remap the keys, Change the mapping section from
Do not remap keys (Default)
toRemap a few keys
-
- Choose the destination folder to install the vim editor and click on the install button.
Once the installation is done, Click finish to exit the installation wizard.
Adding Vim Installation path to the system Variables.
Open the vim installation folder and copy the path. In my case, it is installed on this path.
C:\Program Files (x86)\Vim\vim90
Open the start menu and type System Variables
Click on Environment Variables. This should take you to the next window where you can edit the environment variables
Under system variables, choose Path and click on edit to add the vim installation path you copied.
On the next window, click on new and paste the path then click Okay.
Once you are done with this step, you should be able to use Vim like you do with Vi on Unix systems.
How to Use the Vim editor in Windows.
Now that you have Vim installed on your computer, the next step is to use it.
Open Vim by opening the command prompt or powershell and using the vim
command.
Vim
If the installation was successful, you should see a similar window as the one below.
Creating files with Vim
Open the cmd and navigate to where you want to create the text file using the cd
command.
The syntax to creating a file using Vim is as follows:
vim filname.txt
Example:
vim geekbits.txt
This is how it should look on the commandline.
The command above should open the vim editor where you can write you text and save it.
Saving files with Vim
To save the file, you should press the ESC
key to switch to the command mode.
Type :wq
then press Enter
to save the file and quit Vim.
Learn more about how to use the Vim Editor in this Article: How to use the Vim Editor.
Conclusion
Due to the versatility of the Vim editor, editing text files has become very easy and efficient. The vim editor is very powerful because it has an extensive plugin system and intergrates with many tools and not forgetting the built-in commands.
This article has shown you how to install the Vim editor on the Windows operating system. If you found the article helpful, Share it and subscribe to geekbits to get notified via email everytime we publish interesting articles.
Thanks for reading :)
Related Topics
Edit text file in CMD with Vim
Edit text file in Command Prompt with notepad
cd command in Linux
How to Track Your Screen Time on Linux With ActivityWatch
How to Enable Passwordless SSH Login on Linux