As I have gotten further into Ruby, I had heard more and more about the different text editors that many Rubyists use. It seemed that there were 3 different main options in these days; Sublime and Vim, with Emacs pulling up the rear. It should be noted that Vim and Emacs are much older editors.
Text editors are not the same as an IDE. They are more light-weight and simplified. In languages that you don’t need all the tooling and a compiler, it seems that they are a great way to write code. Additionally, as code is just text, it makes sense to me that we would use a tool that is optimized for writing text.
I had started using sublime and I actually still have it installed on my machine. However, the conversations of many programmers that I look up to were often centered around this topic of editors. Due to this and against the great post by Avdi on why not to learn a text editor as a beginner, I jumped in see which worked for me.
I installed both emacs and vim at the same time, finding a way to toggle them on my machine. Between installing these tools and my original installation of Ruby, I was getting much more comfortable using the command line to get things done.
When I tried vim, I did understand how it was working. However, there was a problem. Not to long ago, I had switched my keyboard to an alternate layout. I was typing a lot more and saw that a QWERTY layout is not the most comfortable setup for constant typing, so I switched to Colemak and really liked it. It keeps the “popular” command keys in place, as opposed to the Dvorak layout, therefore I did not have to relearn using Command-C, Command-V, ect. That said, this actually hurt working with vim, because many of their optimizations are setup for ease of use and Colemak put many commands in awkward places on the keyboard. I did learn later that you can remap keys, which is something that I may do in the future to have basic usage of it. It the beginning though it added to the learning curve. Additionally, the main reason that I had a hard time with Vim was the “mode switching” that Vim uses. It did not really make too much sense in the way that I usually choose to work.
Emacs, on the other hand utilizes modifier keys; meta and control. Using the combination of these modifier keys initiates the functions of the editor. This modifier concept made much more sense to me that the “mode editing” of Vim. Additionally, Emacs is programmed in Emacs Lisp, or E-lisp. Due to this, Emacs knows about itself and the functions of each key command. This was also very interesting to me that all the key commands are calling Lisp functions. I liked that there was this much modification that can be used, even if it took a little setup time to get started.
I am still learning much about emacs and regularly I will look at my .emacs file to make it work more well suited for my needs. I am sure that I will have more posts on emacs in the future.