What is Vim?

Ali Aref
7 min readSep 20, 2021

Why should I use it ? What are the pros and cons ?

Screenshot of my Vim

What is Vim ?

Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as “vi” with most UNIX systems and with Apple OS-X.

Vim is a free and open-source, screen-based text editor program for Unix.
It is an improved clone of Bill Joy’s vi. Vim is designed for use both from a command-line interface and as a standalone application in a graphical user interface.

Interface

Vim’s interface is not based on menus or icons but on commands given in a text user interface, its GUI mode, gVim, adds menus and toolbars for commonly used commands but the full functionality is still expressed through its command line mode.

Vim has built-in tutorial for beginners called vimtutor. It’s usually installed along with Vim, but it exists as a separate executable and can be run with a shell command vimtutor .
Vim also has a built-in help facility (using the :help command -inside the editor) that allows users to navigate through commands and features.

Modes

Vim has 12 different editing modes, 6 of which are variants of the 6 basic modes.

  • Normal mode — used for editor commands. This is also the default mode, unless the insertmode option is specified.
  • Visual mode — similar to normal mode, but used to highlight areas of text. Normal commands can be run on the highlighted area, for instance to move or edit a selection.
  • Insert mode — similar to editing in most modern editors. In this mode, buffers can be modified with the text inserted.
  • Command-line or Cmdline mode — supports a single line input at the bottom of the Vim window. Normal commands (beginning with :), and some other keys for specific actions (including pattern search and the filter command) activate this mode. On completion of the command, Vim returns to the previous mode.

The Vim Learning Curve is a Myth

People speaks about vim and teaching it everyday, and I’ve noticed a surprising pattern: people are literally afraid of learning the editor(VIM).
But, But, But .. You can learn it just in a hour!

Go to your shell and type vimtutor. The tutorial that’s presented is excellent and you’ll be through it in no time. Once you’re done, you’ll have the rudiments needed to get your work done. You won’t be fast yet, no; but you’ll be competent. And even after those 30 minutes, you’re going to start grasping the ideas that make vim so amazing: the brilliant design decision that is modal editing, the composability of commands, the clever mnemonic naming of commands. These will be enough to make you want to learn more.

Why Should I use Vim?

  • It’s free and open source
    It’s a free and open source software, and it’s released under a license that includes some charityware clauses. The Vim developer, therefore, urges users who like the software to consider donating to underprivileged children in Uganda. The license is compatible with the GNU General Public License.
    If you love free and open source soft wares(as I do), then this would be one of the first reasons you would consider to start using Vim.
  • It has portable configurations
    Vim’s configurations are portable, this enables you to use the same configs on all your Linux systems. You can also share configs with friends or try their configuration by JUST copying a few directories and files,
    and that’s all.
  • It requires less system resources
    Vim’s strengths are its smallness and simplicity, therefore it doesn’t consume a considerable amount of system resources as opposed to other text editors especially graphical text editors.
  • It has many powerful commands
    The list of commands that you can use is pretty long. You do not have to learn each one, you simply need to learn a few in the beginning and then try to learn new ones as you go. You may learn something new and important that is in Vim even many years after your first lesson.
  • Supports all file formats and all programming languages
    Vim supports almost programming languages and file formats. It can detect the type of file that is being edited, this is done by checking the file name and sometimes by inspecting the contents of the file for specific text.
  • It’s very popular in the Linux World
    Other reason you would want start using Vim for is that, it is very popular in the Unix/Linux world, especially for system administrators. Two in three experienced Linux system administrators out there will recommend learning Vim. Also in programming world vim is the most popular text editor among Linux users, as we enjoy CLI.
  • It’s highly customizable
    There are configurations that you can use and change based on your own preference. There are hundreds of colors schemes that you can download. Moreover, you can use a large number of plugins that enhance your editor and make it as powerful as modern IDEs.
  • It’s text-centered
    Modern IDEs have a lot of built in features. They usually come with a lot of buttons and a rich user interface to make it easier for you to use all the functionalities that are in it. Vim on the other hand is generally text centered. This makes it easier for you to focus only on the code and get rid of other distractive icons and options that are not code related.
  • It’s always available
    Vim is available on most, if not all Linux distributions out there, you can install it as easy as piece of cake!
apt install vim [On Debian/Ubuntu]
dnf install vim [Fedora 22+]
yum install vim [On RHEL/CentOS]
  • You won’t need your mouse!
    You have tons of shortcuts to navigate through the code and files changing and editing things easily, which actually helps you get rid of the need to use your mouse at all. You do not need to get your fingers off the keyboard, which speeds up your coding.
  • It’s FUN!
    No one ever says “I’d love to learn Street fighter, but there are just so many combos!” People don’t say this because learning a game is enjoyable. You start off with just the basic kicks and punches, and those get you by. Later, you learn more advanced moves, maybe even by accident.
    Learning vim is like this. At first, you do everything as simply as possible. Then you start to wonder if there are faster ways to get things done, and there are! If you chain those commands together they just work! You bump into things accidentally, or maybe you spend some time in the extensive help files. Over time, you burn a few advanced tricks into your muscle memory.
    Soon, you realize there are many ways to accomplish your edits, and you strive to do them in as few keystrokes as possible. This can be incredibly satisfying, particularly to us technical-types that seem to have a higher-than-average appreciation for efficiency. It may be hard to believe that trimming one keystroke off a command will one day trigger a dopamine response, but I swear it’s true. Just ask these guys or these ones.

Pros

1- Lightweight and superfast
2- Powerful plugin model
3- Free and open-source
4- Configuration portability
5- High adaptability
6- Keyboard-based, mouse-free interface
7- Great productivity tool, once learned is hard to forget
8- It’s available everywhere and It’s Cross platform
9- Uses Less Amount of System Resources
10- Vim Has A Vibrant Community
11- Vim Is Well Documented

Cons

1- Difficult learning curve (not that much diffecult)
2- High effort to customize — actually it’s not a con but, configuring Vim is a never-ending effort. There’s always something that can be tweaked or improved.
3- You would get into the habit of pressing Escape, “:wq” prssing “ESC” everywhere etc. a lot which can make you look like fool in front of others 🤣.

To summarize the Pros and Cons of the vim

Pros: you become god-like in maneuvering files. You will be substantially quicker than most of your peers in navigating file structures and editing files. Also vim let’s you record macros which is incredibly useful for repetitive tasks.
Cons: for the first month you are handicapped vim takes a bit to get good just like any other editor.

Is it worth to learn Vim in 2021?

As a short answer YES, because it isn’t going anywhere, it’s still being updated, and new features are still being added and there are vim based modes every where like Intellij IDEs, SublimeText, VsCode, Atom, Komodo and other popular IDEs and Text Editors.

As long as text editing will be necessary in 2021 — vim will be worth learning, as Learning vim is fun, It helps you get into “flow” more easily than its competitors.

The major reason why people switch from conventional editors to VIM is productivity. VIM language and it’s combinations makes is really easy to do text editing without touching the mouse. It was really worth investing the time to learn VIM as it increased the editing productivity when compared to the conventional editors, and it would always be like this no matter it’s 2021 or 2974 or later on.

Conclusion

Like every other tool, Vim has its strong and weak points. As I mentioned earlier, I still use other tools when I feel they are more appropriate to the task in hands. But my default is Vim and will continue to be for the time being.

It’s all a matter of considering the good points vs the bad ones, and I hope this article can guide you on your own decision.

--

--