Why Vim

We survivalists, turned to consumers

Just to get by, just to get by

- Talib Kweli

Cosumer #

Consider how much we take for granted when using technology. All the processes that translate our intentions into pulses of electricity and then into results are mostly hidden from plain sight, mostly by design. This trend is mostly due to consumerization of tech, and one can only marvel at the progress made there. But with all those consumers in mind, how many of them can actually contribute and/or tinker with what they’re using?

When building stuff I constantly ask myself - how much of a consumer I want to be doing X? And in this case - writing code.

Abstraction #

By now I’ve used quite a few text editors to write code with, most of them in the IDE (Integrated Development Environment) class, and I can’t say I had a real gripe with any of them. Most of them look very nice, have lots of menus, toolbars and buttons, with power only a few clicks away. So why make a switch to something as foreign as Vim?

Blank #

Open a bash terminal on any unix based system and chances are you’ll find Vim waiting for you there.

$ vim newfile

Boom! And you’re off and running. That is until you start typing and realise nothing happens, at least nothing you expect (you just have to assume your modus operandi is the default…). I did, but I digress. To understand the reason why the experience is designed as it is, you have to take a step back and consider the specifics of writing code.

Blocks #

During any non-trivial development more time is spent editing/refactoring your code than on anything else. Since code has specific logic embedded into the syntax, wouldn’t be nice if you could change the structure in terms of that syntax? This is what Vim allows in the standard mode of operation, I.e. the other modes except for insert.

One quick example.

int add(int a, int b) {
    int result = a + b;

    return result;
}

Say you want to add extra functionality to this function and you need to move the body of this function to a new declaration. In Vim you’d just go

$ // moves cursor to the end of the line
v // begin code selection
% // moves to the end of this code block
d // copies the selection into a buffer and delete the block

Then locate your new declaration and…

p // pastes from the buffer

That’s it, you’ve just moved a complete code block (intact) without having to move your hand off the keyboard. This was way smarter than any mouse click + drag + Ctrl + C + Ctrl + V and with some practice it’s also way faster.

Why #

Whenever you get too comfortable you should ask yourself - am I still moving forward? Chances are - you’re not. That’s how I got myself to move from the cozy complacency of an IDE and into the alien world of Vim. It’s all about personal growth.

 
9
Kudos
 
9
Kudos

Now read this

Algebra and geometry

In software engineering the Model-view-controller design pattern is widely used and most people have some understanding of what the general principle is. Basically, you have your logic and data that you encapsulate within a model and... Continue →