The Power of VIM [Linux series]

Genki Ganko
4 min readMar 8, 2024

--

What, why, where, who’s and how’s of VIM.

Working with Linux files can be extremely daunting. Most of the time, in the industry handling servers like web and proxy servers, authentication server, firewall server, database servers, and scripting automations, will be Unix-based. And there will be a time where you need to manually tweak these files, and when I say tweak, I mean configuring these files without a user interface like Windows, or sometimes, not even a mouse. So what do you do? Sure, you can use ‘nano’ or ‘emacs’. It is so easy to use. But what if you’re like me who’s so extra, you want to make things complicated? Then, you use, ‘vi’ instead! Or VIM, which means Vi IMproved.

Photo by Florian Olivo on Unsplash

What is VIM

According to the Wikipedia, Vim is a free and open-source, screen-based text editor program. It is an improved clone of Bill Joy’s vi. Vim’s author, Bram Moolenaar, derived Vim from a port of the Stevie editor for Amiga and released a version to the public in 1991.

In 2018, it was voted as the most popular Linux editor from Linux Journal magazine.

Yes, history. Pretty boring, right? I get that.

So let’s cut to the chase.

Why use VIM?

VIM is a powerful tool on Linux machines. Unlike nano or emacs, you can do customize your text editor on VIM and even install some plug-ins. Knowing how to use VIM can be really helpful because some distributions, you are only given ‘vi’ as text editor. Learning VIM can be a learning curve but it will definitely be worth it if you learn at least the basics and most important ones. Some Linux flavors like AmigaOS, ArchLinux, and OpenWRT has this VIM pre-installed on them.

One of the defining features of VIM is its modal editing system, which enables users to seamlessly switch between different modes — such as insert mode, command mode, and visual mode — depending on the task at hand. This unique approach to editing affords users a level of fluidity and control that is simply unparalleled, allowing them to navigate, edit, and manipulate text with unparalleled speed and precision.

If you want to see how I used VIM on OpenWRT, please check my previous article.

Who uses VIM

People who uses text editor for hours, writing a software, configuration of text files. It is popular among programmers, system administrators, writers, SOC analysts, ethical hacker, and anyone who works extensively with Linux text files. Vim’s powerful features, including its editing system, making it efficient for tasks ranging from simple text editing to complex software development. While Vim has a reputation for a steep learning curve, many find its productivity benefits well worth the initial investment in learning how to use it effectively.

Where to use VIM

Like I said, some of the Linux distributions out there come with pre-installed VIM. But you might need to update their packages and modules if they’re outdated.

To update your VIM, enter these commands below based on some of thedistribution that you use.

RedHat/CentOS

dnf

Ubuntu/Debian

apt

ArchLinux

pacman

Capture from Linode Rocky Linux Update

How to use Vim

Here comes to main course! I will only be mentioning what I think the most important commands that will help you survive your daily work. Note that these are the commands that I think are for survival, but you can do way beyond these commands below.

  1. Exiting VIM without saving it

ESC + :q

2. Exiting VIM and saving it

ESC + :wq

3. Navigate to a line, insert an input

Arrow keys + i

4. delete (cut) a line

dd

5. exit insert mode

Esc or Ctrl + c

6. delete word before the cursor during insert mode

Ctrl + w

7. insert at the beginning of the line

I

8. insert (append) after the cursor

a

9. insert (append) at the end of the line

A

I hope you are able to grasp some basic ideas of using VIM just by reading this article. This may not be a lot but it will get you started on editing more and more files on Linux based systems. Hope you enjoyed this article. Please follow for more!

--

--

Genki Ganko

IT Infrastructure | Cybersecurity | Former Chef | Jesus Christ follower