The mostly technical DevOps blog

I write about things. Mostly music, and DevOps related topics

View My GitHub Profile

Fuel my coffee addiction https://cafecito.app/skyok

3 October 2020

A journey towards the 'ideal editor'

by ~sky


You know me, I go by “vimfluencer”, I preach about vim, modal editing, and not using the mouse.

But it wasn’t always like this. When did it start? What caused this preference? Is it really the “perfect” setup, or was it just circumstance that lead me towards vim?

My first job

So picture poor little me, at 18 years old just starting my systems engineering career, looking for my first job on the field. At that moment my experience could be summed up to “I know some C++, and I can use a computer without having it blow up”, so my choices were limited.

Regardless, I managed to land a job just 1 month before turning 19, yay!

So there I am, fresh on the field, being shown my way around the office, eventually pointed towards my workstation. Picture my surprise when I boot into an unfamiliar interface

Don’t get me wrong, I wasn’t all too disconnected from the IT world, and I knew what Linux was. But my experience with it up to that moment was “I tried to make games run on Debian, broke something, and now it boots to a black screen”; that is, I assumed it was broken beyond repair.

Back to my workstation, I’m durdling around, figuring out my way around most common tasks (opening a browser, the office suite, you name it), until I’m rung up by my boss

“Come to the dev sector in 10 minutes. Juan is going to tell you about vim”

How to use what? the brand cleaner? I thought this was IT, not janitor work!

My first foray with “alternative” editors

Remember when I said part of my experience was knowing C++? Well, thanks to college classes, for me C++ meant “the code::blocks IDE”, and my knowledge of programming was encapsulated into “you need to use an IDE for it”.

So again, you can probably imagine my shock when this editor that didn’t even run in its own window was shown to me, and how it was being used to edit the humongous Python ERP the company managed.

“But how can you do that Juan? Dont you need an IDE to program? Didn’t you just tell me this is a text editor?”

And thus, the concept of plugins was shown to me.

That first vim session was rather short in hindsight, since I needed to learn more important things to get started with work ASAP. The second session, however, was the one that molded my preference for modal editing, and the one that built my workflow as it is today

The next day, I’m rung up by my boss again, same message:

“Dev area in 15, Santi is going to you how to use vim this time”

This guy has lightning for fingers!

Let me tell you a bit about Santi first. This guy types fast, or at least that’s how my inexperienced eyes saw it. As a sort of demonstration, I was shown how you can reindent an entire file with vim. And it all happened so fast it just blew my mind to say the least

Granted, I now know it was a simple gg=G, but the fact that something like that could be done in 4 key strokes, without as much as looking at the mouse was simply wizardry for me.

The basics were being run down to me at incredible speed: modes, simple commands, the concept of word, and all the other vim movement shenanigans. I assume concepts like marks and registers were skipped for the sake of my mental health at that moment.

And at the end of it all, I was given a printed sheet with the famous Vim infograph, which I can’t seem to find in high resolution at the moment.

Of course, from that moment onward I was expected to do my editing in vim, since part of the company’s ethics revolved around the usage of FOSS to build their tools. Granted, my editing at the moment ended at my own notes, since I was the customer support intern.

Vim but… bigger?

Eventually, due to company’s needs, I was moved into IT support, where the lessons continued: networking, Linux maintenance, basic shell and python scripting… you name it. And so, my editor usage increased

But for some reason, vim felt “small” for me. Without knowing much about the editor at the moment, I was faced with the standard hurdles: How to navigate files? How to make my development experience more comfortable? Autocomplete? saner bindings?

So I did what every junior IT employee would do: I rung up Santi with these concerns, and was promptly told about spacemacs

This is amazing! I can have a big window outside of a terminal, with vim keys, and I can configure things just by adding a word to a config file! yay! here I go editing superpowers!

You always go back to the first love

… or so the song says.

Eventually I was once again moved into the development sector, to work on the company’s product. yay! Turns out, the product is so large that my hapazardly configured spacemacs just froze in spot while trying to work with it. And to top it off, Santi no longer worked with us, so I was left on my own with this

So I did what every junior+ developer would do: I rung up Juan about this issue, and the solution was of course “use vim instead, I’ll give you my config”

So there I was, back on plain vim, with a foreign config. Except this time, I was using tmux!, so part of my fundamental issue with vim was gone. But most of the workflow still felt… clunky at the time. It was around this time that I had started working on my own projects out of work time, and also the time I started looking for new opportunities elsewhere

My second job… hello again, GUI editor

Some more time down the road, I found a new job as a (mostly) Django backend developer. Due to the unfamiliarity of this new environment, I decided to go with something that dealt with configs for me, so I picked out the new trendy editor: VSCode

But something felt… off. The arrow keys + mouse workflow felt hacky for some reason. Movement this way felt sluggish, forced, as if it wasn’t intended to be this way

Some furious googling ensures, and some minutes later I’m back to my oh so familiar vim modes

New faces, new interests

Alright so, back on vim during a job, but with the difference that almost nobody seems to be familiar with it. The fact that I never moved my hands out of the keyboard (or the fact that whenever I tried to help someone, a short jjjjj spam ensued before I realized) eventually raised some questions. And of course, I was more than happy to talk about it! Until the most difficult question came:

“Why do you prefer vim?”

And let me tell you… I still can’t answer that

Ergonomy? speed? efficiency? all a load of bull

These common arguments can be quickly deconstructed:

So then, why is it that I stick with vim? Why would I recommend it? or talk praise about it?

Our past experiences shape us

I’ll be completely honest for once: I don’t think I’d ever bother with vim if it weren’t for my first job.

I simply happned to trip and fall into a fairly interesting editor, early enough down my career that it shaped the way I work completely. But it wouldn’t have gone this way if it weren’t for those first experiences.

Summing everything up, this is my take on the oh so famous “editor wars”: It’s not fair to compare these tools, since their main draws end up being part of how early we experienced them

So don’t feel bad if you cant grok that one trendy editor everyone’s using everywhere. It probably isn’t the correct tool for your workflow.

tags: