A tryst with vim
It is not often that we get into a love/hate relationship with an editing tool.
The purpose of a desktop computer is to help us edit text. But Vim has got a reputation for being the only reason newbies hate Linux.
Long ago in 1990s Vim was not available. In those days the only option to edit on Linux systems was the vi editor.
Vi editor was developed in USA. Vim in the Netherlands.
Today Vim is viewed as a superset of Vi with plenty of features that enhance its effectiveness and user friendliness.
The first time I played with vi, it felt like a nightmare. Struggling to get out of vim somehow and get back to terminal, and somehow knowing whether we are in command mode or entry mode was annoying.
The lack of indicator for telling you about the mode and how the CAPS lock changed all the commands were even more frustrating.
Learning the basic j, k,l, h keys to move around the file in 4 directions was a simple thing to learn.
But editing multiple files and updating files from disk after modification are things that needed learning and experience.
What are the tools?
Vi was the only game in town back then. It was developed by the team that created Sun Microsystems an early dot com company in Silicon Valley.
Vim was written after very many years to remove the fear around Vi, its cult of fear and bad repute.
But Vim ended up being lot more powerful and user friendly with a lot of language bindings, features for ancillary tasks and with bells and whistles it ended up being much larger and expansive compared to the stripped down vi experience.
Vi had only one job and it had to do that job well in traditional UNIX sense.
Vim took on a much larger challenge and with much credit to the author and his philanthropic open source charity minded approach, he actually changed the newbie Linux experience once and for all.
Why should you learn them?
ex is another editor that does single line editing. Definitely not user friendly but it serves as a historic reminder on how things were at one time.
Vim is still the most favored editor in Linux world for a variety of reasons. It support multi level undo, ability to open multiple tabs at one time and to operate on all buffers or tabs at a time.
Vim has a very unique support for syntax highlighting of all source, configuration and other files, even muttrc and such.
The syntax highlighting can be useful for spell check as well since it serves as a good reminder in case we are typing an email in mutt using vim editor and you end up with a typo.
Vim can also respond to mouse events and talk to copy buffers using the gvim package. Vim also supports various plugins and language bindings.
Vi was written without the mouse input device and to keep the finger movements to a minimum. Vim has been modifying the goals of the vi editor and its power to augment with features meant to do different things.
It is not certain whether the author of Vi editor is going to be happy with the direction vim is taking.
However Vi and Vim are both available on OpenBSD systems.Vi in base and Vim as a package. Some Linux systems however have gotten rid of vi completely.
How can you profit?
It is not just a simple text editing that these tools accomplish.
They form part of a cult and it is very important to be a master of these editing tools to be effective at Linux.
Most of the time spent on Linux is going to be with editing source code if you are a programmer like me or doing some configuration file editing for performing some task.
Mplayer has its configuration file /etc/mplayer.conf or ~/.mplayer.conf and several tools like mutt the email client has its configuration files that support comments and come with a specific syntax.
Vim understands syntax of most programming languages and by highlighting mistakes we can avoid oversights and this definitely helps us get our jobs done quickly and effectively.
If you wish to learn Vim you are more than welcome to buy my Gumroad creation, the Vim cookbook.
My twitter thread on vim themes is here for syntax highlighting.
My article on vim featured in dev.to is here
.
Question of the week
Who wrote Vim? Who write Vi?
Answer for last week’s question
Question was.
What is the name of the ISO creation tool in Linux?
Answer: mkisofs . Also mkhybrid
Once you create the ISO you can burn it using various tools like dd.
Conclusion/Feedback
In case you are keen to learn a particular topic please send me a reply and I shall be glad to cover a new topic in the coming issue next wee.