I don’t want to start the usual flame war between vi and emacs. The choice for me to start learning vi (or more precisely gvim) was simply made because a few of my colleagues are using it, and there is a really good cheat sheet available for it. So why do I want to master Vim Fu? Well, due to my job at CCP I started to code a lot of Python and there really isn’t any decent environment available for it. Sure, there is Eclipse with Pydev – which is a neat combination – but eclipse always comes with all this bloat and is really, really slow. Instead I used Notepad++ so far which is a quite neat notepad replacement on windows, however it suffers from a constant loss of its “langs.xml” which is required for syntax highlighting.
The main issue with all IDEs and editors that bugged me, though, was the inability of properly using them on a laptop. I don’t know why laptop manufacturers think that it would be neat to arrange the ins/del/end/pos/pgup/pgdn keys differently on every laptop, but it really freaks me out and makes me break my fingers when I try to program there. Vi instead does not require me to use these “navigation keys”, and allows even more powerful things than just navigating through the file itself. If I want to delete a line I just type “dd” nowadays, instead of “pos1, shift+end, del”. And if I want to repeat that I just have to press “.” (yes, just a simple period). That is neat.
What first appears to be a downside is that one has to get used to some concepts that are slightly different from other editors. It starts with vim’s idea of spending as few time as possible in the so called “insert mode” in which vim acts like – excuse me for saying it so harshly – any other stupid text editor. Most of the time you want to spend in its normal mode (which you can enter by simply hitting “ESC”) . Then it continues to the concept of “buffers” which actually turned out to be nothing else but different documents – with the added bonus of, f.e., using the same buffer in several windows and several buffers in the same window. So ultimately those things are not disadvantages, just slightly different approaches to the way editors usually handle these things.
Lastly, vim comes with huge repositories for tips and scripts. My personal favourites, so far, are the pydiction plugin and EasyGrep. But then again I just started using vim, and I am sure there are plenty more additions that I will start welcoming over time.
