From Vim to Emacs - Year Later Bit Of Retrospective On What I Came Through
It’s been about a year since I’ve switched from my highly customized vim to Emacs as a default editor. I have to admit it I had sometimes pretty tough times with Emacs especially at the beginnings. Anyway at the same time I’ve found it really beneficial and have significant impact on my current workflow. This article isn’t meant in any sense to be tutorial to neither Emacs nor Vim but is rather a reasoning about my experience and recapitulation of what I’ve learned during past year. Can it really help someone? I don’t know. But I still feel it’s worth putting those ideas down.
Why Would Anyone Possibly Want To Do This?
This sounds like a simple question, doesn’t it? And indeed I believe It’s simple question. However I struggle to find a simple answer. Let me at least try to explain what drove me to all of this in bit more complicated way.
Generally I think there are some people who focus on creating things. I’m not really one of them - sorry. Maybe I had been driven by passion for creating things in past and maybe it was reason I’ve started doing things I do. Unfortunately I feel like I enjoy learning how things work rather then simply applying that knowledge. I also think it’s absolutely fine feel differently about this.
Some might point out that tools are just disruption1 from real problems and in some sense I get it. On the other hand there are folks saying that it’s almost required to learn how to use one of truly extensible editors (Vim/Emacs) to become real hacker2. I don’t want to do any of these points.
If you’re really focused on things you’re creating and don’t see any point in changing your tools it’s just fine. Just forget about this article right now and go do stuff you’re really interested in.
As you can imagine I spent quite a some time learning and putting together my original Vim configuration. Why I did start over and switch to Emacs then? I think this is actually more philosophical than practical question. Both Vim and Emacs has own way of thinking about world. To some degree Vim is more *NIXy kind of tool. It does one thing and it does it well - text manipulation. Yes learning curve isn’t the smoothest one but once you get to used to it it’s fairly simple. It’s also extensible even though you’re forced to use VimL3 which is a bit strange language. However it’s still pretty straight forward tool. It’s also limited by design and its simplicity to some degree. Vim itself is synchronous (even blocking UI) and it doesn’t really supports much that goes beyond basic text editing. Even though there are projects like Neo Vim I think it’ still fair to say that vim is design as ultimate tool for text manipulating and that’s it. Is it extensible? Sure but only to the point you’re not trying to bend it way too much. Than it starts to feel.. strange.
Emacs on the other hand is Lips interpreter with interface for text editing. It’s extensibility is insane. As old joke you probably heard says: “Emacs is a great operating system lacking only decent text editor.” Think about it this way. Emacs is framework given to you so you can build your own editor or anything you want in it. It’s much more complicated than Vim is. For good and bad there are more concepts you need to learn to actually understand even small fraction of what Emacs can do. Anyway for text editing addicts this is an ultimate tool. If you like text as I do you have all reasons to consider using Emacs.
I have to admit I’m not one of these super smart people. Anyway I think I have good resistance to a pain. I’m usually able to force myself through the hard path and somehow handle it without going crazy too much. Or maybe I have no problem with going crazy a bit. Anyway I have to admit that this was hard. I was playing with Emacs for some time before I actually started using it as main editor. I’ve tried Spacemacs distribution and wasn’t really happy with it. Then I’ve rewrote my configuration from scratch at least three times. I’ve also used Emacs for about two weeks and then switched back to Vim for next few weeks simply because it drove me mad.
One of the worst moments is when you really need to focus on solving some problem or delivering some shit and your editor keeps telling you that you don’t really know how edit files. That sux pretty much.
I’ve managed to break it the hard way. I can tell you that I don’t want to ever go through this process again. The truth is I don’t know if it was worth it. I know I’m happy now but I’m pretty sure I’m not objective at this point. Anyway I have some advise especially for people who are coming to Emacs from Vim. Few lessons I’ve learned anyone should know up front.
You don’t have to switch from day to day. Generally it’s good idea to play with Emacs a bit first. And I mean pure Emacs.
E-Lisp is Your Friend
If you’re starting I think it’s better to play with emacs-lisp rather than use it for working on your projects. Using Emacs to do some work without knowing it will be only frustrating experience. Using it to learn emacs-lisp helps you to stay focus and enjoy that experience. Also elisp has amazing support up front. Let it be the measure for how you want to build your workflow for other languages.
Don’t be Too Much Evil
Evil mode is great. Anyway looking back I think it is really not a good idea to rely on it much especially at the beginning. Evil is really Vim for Emacs but Emacs + Evil is much more than Vim inside Emacs. Don’t ignore it. You will have to learn some of the Emacs way sooner and later. Sooner is better.
Try To Use Emacs In YOURS Workflow
There are many cool plugins you want to try out I know. Anyway You can’t possibly change your whole workflow in one day. If you’re using tmux try to use Emacs within tmux4. If you’re coming from GUI editor - use GUI and forget about terminal version.
Don’t Stick With It For Too Long Though…
Once you feel comfortable with Emacs try to evolve your workflow.
GUI Version Is Better
Really it is. Are you running Emacs with in terminal? What about running terminal within Emacs?
Magit is Awesome
I heard you like command line tools. That’s great. I like them too. Give Magit a try anyway. It’s advanced and you can switch to terminal any time you want.
Org Mode is Super Cool… But NOT Necessary
Org mode is great. You want to learn it. However if you’re programmer I think it’s not the most important thing. You should focus on work first. Org mode is really simple and you can learn it in no time later.
After One Year
So I’m kind of celebrating my first year with Emacs. I really wanted to make some recap of what I’ve learned. So I’ve rewrote my configuration to org-mode as literate program. I’ve also switched from
use-package to Cask and Pallet. Once again I’ve spend some of my free time just for setting things up. This is what we OCD’s do, right?
I also made few other changes / decisions based on my personal preferences:
No More evil-leader
For some reason I don’t feel like I’ll need to use evil-leader anymore. I don’t think it fits well to Emacs. It was really helpful for making Emacs feel more like Vim at first but now I feel like I want to use Emacs way of bindings rather then using leader.
You might know NERDTree plugin for Vim. It’s largely popular among Vimmers. However I was never really happy with Neotree (Emacs alternative) for many reasons I don’t want to discuss here. To prevent this frustration I simply forced myself not to use it by removing it. I’ll rather use basics like
C-x C-f instead going forward.
Are Emacs Users Better Programmers?
Hard to say. But you bet I believe they are as every other Emacs user do:D Probably it’s better to avoid any discussion like this right from start. In any case I think that there are certain skill which comes from experience of setting up Emacs. In the end your configuration is probably the biggest project of your life time. It will live and evolve with you. It’s worth understanding and spending some time on its maintainance. But in the end it’s all up to you.
You can find many articles about tools as procrastination and similar.
- MPJ’s video about why he uses basic text editor without extra config: https://www.youtube.com/watch?v=dIjKJjzRX_E
- J. Pabblo Fernández - Emacs is hurting clojure https://pupeno.com/2016/09/26/emacs-is-hurting-clojure/
Again there are dozens of examples about this topic.
- Perry Metzger - The Editor of The Lifetime talk https://www.youtube.com/watch?v=VADudzQGvU8
Actually Vim also supports plugins written in Python and other languages but these simply don’t feel like first class citizens.↩