Here’s everything you should (but might not) know about Vim

You might know that Vim (a contracted form of Vi IMproved) is the most popular Linux text editor. Vim is a highly configurable and complex tool built to enable efficient text editing. This text editor was first released to the public on November 2, 1991 and it is now distributed free as charityware, so as to encourage users who enjoy the software to consider donating to children in Uganda.

Vim is an improved version of Vi, its predecessor, created by Bill Joy in 1970 for UNIX operating systems. The two share a number of similarities, but Vim has been of course adjusted so as to operate on modern Linux systems.

Most people know basic commands in Vim, such as how to editing a file with :i and then save it with :w or :wq (write to file and exit). These are very common and useful commands, but in this article we aim to tell you about a few others which you may have never heard of but that are just as useful as the popular ones.

:earlier 20m

This command, for instance, comes in handy whenever you wish to revert the document back to a specific point in time. Obviously, this command can take different variables for time, so instead of 20m like in the above example, you could enter 5m, 30m or 1h.

 :%TOhtml

This command will transform the current document into HTML.

 :.!date

The syntax :.! + command will execute the command and then paste the output into the current window. In this case, it will paste the current date into your current document.

 :%!xxd

Through this command, you will get Vim to act like a hex editor.

 vim http://www.example.com

Vim can also open up URLs provided they lead directly to static HTML files.

 

These are just a handful of examples to show how useful Vim can become once you begin to grasp its inner workings. This text editor offers a wide range of options that can accommodate some of your most complex needs, which explains why it is such a popular choice among Linux users.


Sources:

https://arstechnica.com/information-technology/2011/11/two-decades-of-productivity-vims-20th-anniversary/

Leave a Reply