I tried so many text editors in my coding experience that I now feel the need to talk about the one that I now feel really comfortable and productive: Emacs.
But before talking about it, a little context.
Other than many text editors I also used quite a lot of programming languages. This inevitably forced me to use IDE like Eclipse, CodeBlocks, VistualStudio, XCode and probably other that I don't even remember now.
An IDE is great for a beginner as it spoon feed you with many handy things like code completion, suggestions, and many more features. And these really helps when you have no idea of what you are doing and you want to finally make the thing you are working on to compile.
The downside of the IDEs comes when you start to switch around trying different languages or tools that does not integrate with your current IDE.
So, instead of having 10 huge full featured IDEs installed on your machine with every one of them a different configuration and setup, I advise to try to use a "simpler" generic text editor that can adapt to any programming language (or also text documents!).
The Text Editors
The majore reasons to switch to a text editor is the lightness of it when compared to any IDE and the flexibility of it to easily fit any of your need.
In fact, any good text editor has a great choice of addons, plugins, or scripting API to force it do whatever you want in any way you want it.
Another advantage of a text editor is that you can switch much more easily between projects or simple text document you have around your computer.
Vim is a text editor for your terminal. I'll not describe it in details because it's a huge world and many other people already did that in a better way than what I could do myself.
What I'll give importance to is to it's bindings. Normally in any text editor you press a character, and that will be inserted into the file. In Vim is a bit more complicated than that.
Vim has "Modes", and depending in which mode you are Vim will do different things on the key press. Again, I'll not go too much into details here, but I'll highlight the concept of that: Vim is complex but, once you overcome the steep learning curve, it can do much much more than a normal text editor.
These are, in my opinion, the best things of using Vim (Or a program with Vim-bindings in general):
- The speed in which you edit and write code. There are so much shortcut and handy commands that will boost your productivity to the roof.
- The ergonomics of not having to use a mouse. Vim is focused only on the keyboard. The mouse is not needed (some version of vim will not even accept mouse inputs!). This will let your hands stay in place, without the need to keep shifting back and forth between mouse and keyboard.
- The portability. Vim comes preinstalled on anything based on Unix. In any remote server if you connect through SSH, Vim will be there for you. Even porting your config is a matter or simply moving your .vimrc file into the machine you want to use it and everything will be just like your original machine.
And here comes the other giant. Vim and Emacs, black and white, yin and yang.
Emacs in my opinion is not a text editor. Emacs is a platform, on which you can build up anything you want.
In fact, the best option between Vim and Emacs is Emacs WITH Vim.
Emacs has an enormous repository of packages which can extend and modify it's functionality. One of those packages is "Evil-mode" which will port everything good of Vim into Emacs!
With Evil Emacs, you have then a base on which you can build complex tools that will automate so much of your workflows that you will ask yourself why you didn't learn it before.
Other than that Emacs has also beautiful packages like "Org Mode", "magit", "whichkey", "moody", and all the languages specific packages.