The last post I wrote is dated 3rd May 2017. Since then, a very exciting thing has happened: I’ve become a Resident Apprentice at 8th Light!! I passed the challenge that I was supposed to face at the end of my first apprenticeship step (the Student Apprenticeship), and on the 21st August I officially started the Resident Apprenticeship, a further new step into my journey to become a developer (or, as developers tend to call themselves here at 8th Light, a Crafter).
In the next 9 months or so, among all I am going to learn two programming languages in addition to Ruby (a statically-typed language, Java, and a functional language, still-to-be-decided). But as a very first ‘challenge’, my mentors have asked me to learn how to use Vim, the infamous code editor.
Vim: my current biggest challenge
This is not the first time I approach Vim. I already played the Vim adventures, a very basic Vim tutorial, when I started my apprenticeship almost a year ago. Furthermore, I was then recommended to look at the vimtutor - which is run in the terminal, - another quick tutorial for Vim basics. My Vim learning was then temporarily suspended (as I was also working as an admin assistant while making the apprenticeship, I and my mentors eventually decided I should focus on learning Ruby rather then starting using a new editor.) Until now. Everybody at 8th Light uses Vim, therefore I am going to learn Vim too!
I am not sure why I feel so intimidated by Vim. So far, I have been using Atom as code editor. I guess what scares me the most is having to use an editor which seems so different from the one I have been used to (and so old! :)) It’s like having to learn how to write code from scratch again? Maybe I’m overreacting... Besides, Vim needs to be set up and all its plugins installed, whereas Atom comes fully-featured and with a lot of packages easy to find through its clean interface and also easy to install, all from inside it. At the contrary, Vim requires a little more work, but thankfully Rabea (one of my mentors) has helped me out with all the initial configuration. Actually, there is plenty of information in the internet on how to use/customise your Vim: for example, Vundle looks like a good plugin manager that helps you add new plugins to your editor. Someone also suggested VimAwesome to quickly search for plugins. Atom comes pre-installed with some great looking themes and again offering a simple interface for finding and installing more. But again you can use Vundle to install different themes in Vim, and VimColors to search for new ones.
So, after showing my current doubts about Vim in the above lines, let’s see some of the most apparent advantages of using Vim as your main code editor (of course, none of these have been experienced by me yet). From a quick research in the internet, the following are some of the advantages that I have found most frequently reported by Vim-users:
- Speed: Vim is a fast editor. Vim forces you to learn numerous different editing modes such as Normal, Insert and Visual; and you can’t use a mouse. As counter-intuitive as this can seem, this actually speeds up your workflow as you don’t need to move your hands off of your keyboard and either pick up a mouse or use the arrow keys, hugely slowing you down.
- Navigating files: Vim has a powerful tool for navigating between different files. Although Atom has a Find in Buffer tool, the Vim shortcut Ctrl + P works in a similar way giving you the possibility to open the finder and quickly find the file you’re looking for. Furthermore, with Ctrl + V you can open a buffer in a split, or with Ctrl + T open a buffer in a new tab. And with Ctrl + Y you can create a new file. So, again, with all its shortcuts Vim makes everything quicker (although maybe not very intuitive, at the beginning.)
- All in one editor: another powerful advantage of Vim is that it works both as an editor and as the terminal. This is crucial when you work a lot with TDD: you can run your tests directly from Vim. Having not to switch from the editor to the terminal to run your tests all the times radically speeds up your workflow.
- Cross platform: Vim runs on all possible platforms, and supports many different programming languages. Which makes it the most convenient code editor for someone who wants to learn different programming languages, I think.
Again, all the above advantages I have researched and found them in the internet. I am not sure whether all the above is correct as I still have to learn how to use Vim, and to find out all of its potentiality. If some of you know further cool features of Vim I should already be aware of, please let me know! As a start I have done the above-mentioned tutorials all over again, just to refresh my basic knowledge of Vim. From now on I will be definitively switching from Atom to Vim (argh!) and discover the magic world of Vim. According to other people, I’m going to hate Vim in the first month; but then, I’ll just love it!
For this post I have mostly consulted the following websites/pages: