What is Vim, How to install Vim in your Termux terminal.

Vim is an open-source text-editor software released in 1991 and developed by Bram Moolenaar. It is an improved version of the Vi text editor, which is another text editor developed by Bill Joy.


Vim has many features, allowing you to edit any text file without leaving your terminal. As a developer, it must be installed in your system.

In this article, I will show you How to install Vim in your Termux application and how to use Vim. We will also create a file via Vim and run and save it. So let's get into it.

Installation
Run this command shown below one by one.
First, update and upgrade the system

apt-get update & apt-get upgrade -y


Then run this command; it will install Vim in your system globally.

pkg install vim


Run Vim
After successfully installing Vim in your terminal, type vim and hit enter.

vim


A code editor will open up.


You may be wondering how to get out of here. Don't worry; not only you but most of the people who install vim for the first time are stacked here.

How to use Vim
Vim can create file imidieatly

vim index.html

This command will create an index.html file temporarily in the editor. If there is any index.html file available in the working directory already, then the file will open with the vim editor instead.

To write any text in the file, we must enable insert mode by pressing the "I" key. 

After writing, hit the "ESC" key. It will exit insert mode and go to the Command mode.

To save that file in your system, go to the Command mode and type ":w". 

Type :q to exit the editor. You can type :wq to save time; it will save and leave the editor immediately.

Conclusion
That's it for today. I hope you learned something new. Vim is not only just that. We will learn more about Vim in the future.
Istiak Ahmmed Soyeb

I'm Soyeb, Now I'm a web designer. I chose my career as a web developer. I'm also a Blogger (Not Professional). And I love technology very much.

Post a Comment

Previous Post Next Post