Xavier Olive research teaching python blog til cli

I ❤ Vim

6 March 2013

I am always surprised when people are not able to define what a text editor should be. When they need to edit text, most people would just open Word. Few would open Notepad++ (and only if it’s for programming purposes, so that means they should be programming).

If you already know me, or read me [here], you must know how and why I think Word (the generic word for all kind of word processors in any office tools, – including OpenOffice / LibreOffice) is bad software. I am not judging the quality of the code behind the software; word processors are bad by design.

Word processors are good at one thing: what they have been originally designed for. Few decades ago, you would use a word processors if you needed to throw some ideas on paper, add some basic font features (font selection, bold, italic)1. Little by little, the ambient laziness pushed software editors to add more features so that people would just stop composing documents.

The original sin lies in the negation of the following paradigm. Document composition consists of two consecutive phases:

  • the redaction process: focus on the content you want to appear on your document;
  • the typesetting process: focus on how and where you want information to appear.

It is that simple.

As a consequence, you need two pieces of software for composing documents:

  • a text editor;
  • a typesetter.

I saw few relevant Integrated Development Environment (IDE) able to skilfully handle both tasks. Word processors are bad as they merge those two distinct processes.  As you merge them, you attention keeps swapping between both processes, and you are most likely to end up with poor content poorly rendered.

Actually I do believe there is hope: some companies finally started to realise that they don’t need Word. Recently, the trend is to fill web forms instead of Word documents. Web forms are the most clever way (though it may not be on purpose) to separate contents from form. Newspaper function this way (the journalist does not submit a Word document!), clever administrations function this way. In these times of excess of information, people finally start to be willing to work on information hierarchy and leave typesetting or rendering to an extra software. People understand they want freedom to change their rendering, their branding, etc. without losing years of history because of a document format they are not able to work with any more.

I would blame programming IDE for the same reason. Programming consists as well of redaction and, in place of typesetting, compilation/execution or interpretation. Most IDE may excel at hiding the compilation complexity (though I am not sure this is a good thing), but when you need text edition sugar, then you realise they planned nothing for you.

I like vim editor for its editing capabilities. Emacs is also a good alternative: I actually started to learn text edition on Emacs, added few plug-ins to help me work efficiently and the software became all clogged and slow on start-up. I read recently that this is a weak point of Emacs.2 In my new company, people were using vim for programming, shared a nice programming environment, and I sold my soul.

vim is lightweight.

vim is configurable. Scripting and plug-in creation facilities are in my opinion what makes the difference between simple software written for few people, and promising software aiming a larger audience.

vim is free, open-source (GPL-compatible, charityware) available on all operating systems, by default on most.

vim automatically detects the type of file you are trying to edit and adapts to the particular needs of this file. It offers syntax highlighting when you want to program.

vim handles multiple file formats and character encodings.

On a daily basis, I use vim for everything from programming (I kept Eclipse for Java though, but that’s a different topic) to text editing, letter typesetting, presentation preparations. I used vim for writing this blog entry and for writing design instructions of this website.

On my smartphone, I would use the Notes application to jot down some ideas and then export them into vim for organising my ideas, moving parts, correcting and getting ready for typesetting if I select this piece of text to be more than just ideas.

People tend to easily blame on vim and emacs editors saying “I prefer to use modern environments” (should “modern” mean “it sucks”), “It is just complicated, I am too old for that”, or the ubiquitous “I don’t have time”.  Actually, when those same people get to see someone who got over his first fears, they would most probably say “Oh what’s that? Wow, … (fill in with the name of a text editor) is really cool when you know how to use it”.

  1. Underline is the proof word processors have not been designed for creating documents but for imitating human behaviour on paper. 

  2. If you choose to work on Emacs, you will also participate to editor war and find your own arguments against vim.