Using Vim after Sublime Text and other text editors

30 January 2016

When I began coding, I first used Notepad++ only available on Windows. Then, as a lot of new coders, I switched to Sublime Text which has nice syntaxic coloration and also an easy-to-install package manager who gives access to lots of plugins. However, I was using it without having bought the license so one day I decided to check other text editors and if I don't find something better, I buy the license for Sublime Text.

Of course it is bad to use something without buying it. As a lot people do with WinRar, a lot of developers just click every time 'OK' on Sublime Text's popup saying that they can buy the license and just continue to use it without spending one cent. It was my case during about three years, so one day I said to myself that as Sublime Text's developer has done a great work, he should be rewarded for it. However, I heard a lot about other text editors which are open source and their users love them. So why not give it a try? I mean, it's not because I'm still a student that I'm trying find ways to save money. But, buying the license engages me with the text editor. So, I preferred looking elsewhere before doing it. In some way it is like taking some time before getting married with someone, got it?

Sublime Textlogo
Sublime Text Logo

In my research for a great text editor, I wanted it open source. It's one of the biggest cons of Sublime Text in my opinion. Yes, there are plugins for customizing the interface and add features, but if the developer just stops to maintain the project, bugs get accumulated and developers will have to choose another text editor. Even though Sublime Text is quite stable, the third version, for example, has still some issues which can be really annoying, like not having the files getting refreshed automatically every time in the navigation tree. In case of open source, it is technically possible for the community to fork the project and continue to maintain it. This kind of scenario happens quite often and is not just an utopic idea. I will come back to it later.

BracketsLogo
Brackets Logo

So my first try was with Brackets developed by Adobe in NodeJS. I liked some features like the possibility to just select an HTML element and open just below it the corresponding CSS properties. It avoids switching between tabs and to scroll around. Another nice feature is to auto- refresh the browser when saving files. However, when I tried it, it was only working with Chrome and not Firefox. As my favorite browser wasn't supported (I think it is Firefox's fault because the API didn't allow it), I couldn't really use it in everyday use. In fact the real issue I had was that being coded in NodeJS, Brackets can be sometimes really slow. And that's enough for me for not using it.

AtomLogo

Atom Logo

Afterwards, I tried Atom by Github, also in NodeJS. I'll make it short. It's very similar to Sublime Text, nice aesthetics and plugin manager. However, I once got a bug with copy-pasting (it continued to paste an 'e' character whatever I was copying and I had to try several times to debug it with the Keyboard Debugger). To this you can add that as for Brackets, being in NodeJS makes it quite slow. So this wasn't the editor I chose too.

LighttableLogo

Light Table Logo

Then, I got to know Light Table which was crowdfunded and focussed on live-coding. It means you can just dump your variables in the code itself and see the values being updated while the application runs. This is quite a nice concept and I liked it. Nevertheless, to work correctly, Light Table has to launch the app itself and I like to code using virtual machines so I have all the control of the environment of the project, but I didn't find a way to use Light Table in a way it could start the app in a VM. I found some annoying bugs too, but perhaps I haven't installed it correctly. So Light Table wasn't my new text editor.

Vim Logo

Vim Logo

Finally, I gave a try to Vim created in 1991, with a huge community, enough time to fix bugs and even better: it is installed on most GNU/Linux distributions and on OS X. As I have heard a lot of it as well as Emacs, with a lot of big fans around it, I just had to try. I took time to learn the basic commands and moves and I'm now using it since 6 months. It is lightweight and allows you not to use the mouse (or touchpad). That is quite comfortable when you don't have space for a mouse on the desk and just want to rest your arms. Most Vim users want to convince you to make the switch because of productivity and how fast you can write code. Sincerely, until a short time ago I wouldn't be able to say if it really improved that well my productivity, but I noticed something: now when I'm editing text outside of Vim, I try unconsciously to use Vim shortcuts and I get frustrated when it doesn't work. In fact, you gain in speed and comfort when using Vim. So yes, Vim is now my daily text editor.

My Vim Configuration

By the way, Vim isn't perfect and I have to tell you the problems I encountered. The first issue is copy-pasting from Vim to outside or other way round. As Vim is in a terminal, the clipboard isn't as easy to use as on modern editors and you have to do the "+y shortcut to copy (when on Linux). Sometimes the copied text is badly formatted and things like this. Another issue is performance. Yes Vim is lightweight, but when you use plugins, they can block you from editing a file while they are processing because Vim isn't asynchronous. It means it can be slow sometimes. One thing; never open a JSON file in Vim! It will slow down so much that I had one time to restart my computer. I will finish with a last annoying point: Vim configuration. At start Vim is quite useless, I mean in comparison to Sublime Text (which is more like an IDE than a text editor) so you have to enhance it by customizing your vimrc and add plugins. I spend quite a lot of time doing it and I'm still doing it, searching to have the "perfect" editor. Yet, you can often conflicts between plugins and your configuration and even between plugins themselves. Worse: some configuration is limited (like Tab and Ctrl+I keys which can't be mapped separately).

Vim is nice when you take your time! That is the reason why I'm not recommending Vim to anybody. You can see the vimrc I built until now and I'm using here onGithub. To get solutions for the problems I described above, I'm now trying Neovim which is a modern fork of Vim and will for example offer asynchronous plugins. As said before, Open Source allowed Vim (Vi Improved) to be created from Vi source code and now Neovim does the same with Vim. In some way, the old text editor of 1976 is still getting modernized. Stay tuned!