After being an avid Vim user for 6 years, a couple of months ago I started to wonder about the strange people that embrace the cult of Emacs. “Why would you use anything other than Vim?” was what I thought. So Instead of paying too much attention to the rants and raves from both sides, I just decided to just give it a good honest run for a while, and use it for all my general tasks (it’s truly fascinating that “Vim vs Emacs” has been an ongoing holy war for over a decade…)
Let me state ahead of time that there was no dramatic moment of frustration with Vim that caused me to want to run away screaming - in fact I believe Vim is nothing short of amazing. My journey into Emacs stemmed purely from healthy curiosity and the wanting to learn something new whilst continuing to work on what I was working on (the same reason I initially learned Vim).
Aside from myself and maybe one other, there aren’t many developers at my office that use either Vim or Emacs - so I was at a loss in my ability to ask real people about their experience with it. We have a healthy ecosystem of Textpad, Notepad++ and UltraEdit users and, only when absolutely necessary, the use of the Vi implementation on the AIX boxes (when local edits aren’t possible). I can speak for Vi which is great, albeit without the syntax highlighting, but as for the others I haven’t used them extensively so can’t really speak for or against them.
So anyway - I started with the Emacs tutorials included within the distribution, and it took me quite some time to get used to the key bindings. I also did a few elisp tutorial snippets during some downtime, and I must say it’s amazing what one can get done with it. I was tempted so many times to simply switch to Viper mode asap, but I figured that would defeat the purpose of this whole exercise.
These are just a few things I’ve noticed so far:
Emacs - pros (vs Vim)
Window management
I really like how in Emacs, one process can be responsible for many different windows (in Emacs terminology, “Frames”). Furthermore, there are bindings to switch between frames, and when you’ve run M-x server-mode, whilst in the command line, a call to emacsclient -c <file> will open that file in a new window within your current Emacs session.
Process integration
This is a design philosophy that is fundamentally different between Vim and Emacs. The Vim philosophy is that it should purely remain a text editor and nothing else - with minimal interaction with external processes. Emacs seems to embrace asynchronous processes running within it and formatting output for ease of use.
As a Vim user, I will admit that process integration is occasionally useful - but on those occasions where it is useful, it’s REALLY DAMN USEFUL. Take for instance, the workflow with searching for a certain string within a directory, and then wanting to edit files that contain the target string.
With Vim, I’d navigate (in my shell) to the root folder of where I’d like to search, execute something like grep -r "blah" ., and use the results to find out what files I’d like to edit - which works perfectly fine, but in line with the Vim philosophy, it feels like I’m using multiple disjunct tools.
With Emacs, I’d navigate to the root folder, open that folder in Emacs using emacs ., then run M-x find-grep to search the files for the string I’m searching for. Since the results are displayed in the editor itself, I can move the cursor to the result corresponding to a file I’d like to look at, and hit Enter. The file will open, and the cursor will be at the precise point of match. It all feels seamless, yet it’s still using other tools in the background to make it all happen.
Customisation language
I haven’t had the pleasure of using ELisp to do anything totally wizard-like yet, but it seems to me, from my limited use, to be an extremely powerful language, and much moreso than Vimscript. But - this is just a gut feel. I’m sure someone else out there has done a more thorough comparison of Vimscript and ELisp.
The org-mode in Emacs is absolutely great
Org-mode is probably one of the major things that’s making me stick with Emacs as it ties in well with GTD. I take almost all my notes on everything in org-mode nowadays, it’s extremely easy to structure files and the syntax highlighting breaks it up in a manner that’s extremely easy on the eyes.
Feedback during command usage
The mini-buffer at the bottom always gives useful feedback and help whilst you’re doing things. I feel like with Vim, it’s a case of “as if you didn’t know that!” - which can be daunting to a new user, whereas with Emacs there is a great level of feedback, functions are extremely well documented and the help screens are very well organised.
Emacs - cons (vs Vim):
Startup time
This is why I still use Vim for editing of quick discrete sysadmin-editing. It works great within the terminal, it’s lightning fast, and it just works.
In fact, I don’t think I’ve ever used Emacs on a file in my /etc folder.
It’s all about your customisations, and customisations are coupled to a machine
Emacs’ customisability can probably be seen as a pro - but the downside is that a highly customised editor suddenly means you’re tightly coupled to a machine unless you lug your ~/.emacs file and ~/.emacs.d folder around.
Vim seems to be a bit more a case of “it’s basically the same everywhere once you’re used to it”, and is very effective from the get-go. Emacs relies on a bit more tailoring to suit each user, according to their needs and wants - and going without that tailoring even for a single session can be a bit annoying.
If you’re not practicing good ergonomics, it can get painful.
I wouldn’t be the first to admit that Emacs is less ergonomic that Vi/Vim. Back straight. Keyboard 20-degree angle from your eyes. Hang your hands down your sides, and your keyboard should be just around the elbow level. Keep your wrists straight, and have a preference for pressing the meta keys (ctrl/alt) with your non-pinkie fingers even if it means moving your arm.
I’ve had to learn all this up ahead of time, because I have severe tendonitis on my right arm/wrist that’s worsened over the years (prior to Emacs entering my life). But due to the strange key bindings and chords in Emacs, I could feel that if I wasn’t adhering to these rules and slowing down just a tad bit, the pain in my wrist would worsen and my left pinkie would feel overworked. With Vim this was never an issue.
Line numbering
Emacs seems to struggle with line numbering on extremely large files, whereas Vim handles it like a Boss. I’m not even remotely sure why this is the case, but I’ve definitely noticed it.
Where it’s at now
So here we are now, after using it for more than three months, my usage of editors has started to normalise. I’ve had the sudden realisation that I haven’t actually switched back to Vim for everything like I thought I would, and for vast majority of my tasks I find that I’m just using Emacs. I do drop into Vim when I’m doing sys-admin tasks and quick edits - it seems to start much faster on my machine. But, for the vast majority of development tasks I’ve found that I’ve been sticking to Emacs.
That said, it truly comes down to a case by case basis. There are things that I know I can do more quickly in Vim, and in Emacs. Since I can use both now quite effectively, I just pick and choose according to the scenario I’m in, without a strong preference for either.
-
transientyou83 likes this
-
blackman56k likes this
-
murphytii0 likes this
-
decoteau254 likes this
-
shonelikethesun likes this
-
nickthejam likes this
-
srazzaque posted this