Vim is a tool that is both simple and very powerful. Most new users will be intimidated by it because it doesn’t ‘work’ like regular graphical text editors. The ‘unusual’ keyboard shortcuts make people wonder about how to save and exit Vim. But once you master Vim, there is nothing like it.
There are numerous Vim resources available online. We have covered some Vim tricks on It’s FOSS as well. Apart from online resources, plenty of books have been dedicated to this editor. Today, we will look at one such book that is designed to make Vim easy for most users to understand. The book we will be discussing is A Byte of Vim by Swaroop C H.
Swaroop has worked in computing for over a decade, including roles at Yahoo and Adobe. Right out of college, he made money selling Linux CDs, and started a number of businesses including co-founding the team that created “ion”, an iPod charger. He is currently an engineering manager for the AI team at Helpshift.
A Byte of Vim
Like all good books, A Byte of Vim starts by talking about what Vim is: “a computer program used for writing any kind of text”. He goes on to say, “What makes Vim special is that it is one of those few software which is both simple and powerful.”
Before diving into how to use Vim, Swaroop tells the reader how to install Vim for Windows, Mac, Linux, and BSD. Once the installation is complete, he runs you through how to launch Vim and how to create your first file.
Next, Swaroop discusses the different modes of Vim and how to navigate around your document using Vim’s keyboard shortcuts. This is followed by the basics of editing a document with Vim, including the Vim version of cut/copy/paste and undo/redo.
Once the editing basics are covered, Swaroop talks about using Vim to edit multiple parts of a single document. You can also open multiple tabs and windows to edit multiple documents at the same time.
The book also covers extending the functionality of Vim through scripting and installing plugins. There are two ways to using scripts in Vim, use Vim’s built-in scripting language or using a programming language like Python or Perl to access Vim’s internals. There are five types of Vim plugins that can be written or downloaded: vimrc, global plugin, filetype plugin, syntax highlighting plugin, and compiler plugin.
In a separate section, Swaroop covers the features of Vim that make it good for programming. These features include syntax highlighting, smart indentation, support for shell commands, omnicompletion, and the ability to be used as an IDE.
Getting ‘A Byte of Vim’ and contributing to it
A Byte of Vim is licensed under Creative Commons 4.0. You can read an online version of the book for free on the author’s website. You can also download a PDF, Epub, or Mobi for free. If you prefer reading a hard copy, you have that option as well.
Please note that the original version of A Byte of Vim was written in 2008 and converted to PDF. Unfortunately, Swaroop lost the original source files and he is working to convert the book to Markdown. If you would like to help, please visit the book’s GitHub page.
[lasso box=”1983325740″ link_id=”14625″ ref=”mastering-vim-quickly-from-wtf-to-omg-in-no-time” id=”101773″]
When I first stared into the angry maw that is Vim, I did not have a clue what to do. I wish that I had known about A Byte of Vim then. This book is a good resource for anyone learning about Linux, especially if you are getting into the command line.
Have you read A Byte of Vim by Swaroop C H? If yes, how do you find it? If not, what is your favorite book on an open source topic? Let us know in the comments below.
If you found this article interesting, please take a minute to share it on social media, Hacker News or Reddit.