Right up front: I do not want to start a religious war.
I've used vi for as long as I can remember, and the few times I've tried to pick up Emacs I've been so lost that I've quickly given up. Lots of people find Emacs very powerful, however. Its programmability is somewhat legendary. I'm primarily doing Solaris+Java development, and I'd like to ask a simple question: will my productivity increase if I invest time in getting my head around Emacs? Is the functionality that it offers over Vim going to be paid back in productivity increases in a reasonable timeframe?
Repeat: I don't want a "my editor is better than yours" answer. I just want a yes or no answer as to whether it's worth investing the time or not. Will my productivity really increase?
vi is a kitchen knife.
vim is a really nice, sharp, balanced chef's knife.
Emacs is a light saber.
Most of the time, my job requires me to chop vegetables. Occasionally, I have to take on an entire army of robots.
I've been using Emacs for 20 years. I'm typing in Emacs right now with a widget called "It's All Text" that lets me suck text in and out of text boxes in Firefox. I can go really fast in Emacs. I am significantly less productive without it.
This is highly debateable, but I also think that learning Emacs can teach you a surprising amount about programming.
I like Emacs, you can extend it by your needs- in my eyes, any system which you can extend by yourself is award-worthy.
In an earlier answer, Aristotle Pagaltzis wrote: "Vim excels in the small ... You can easily do things in Vim in the normal course of editing that would require you to drop down to scripting in Emacs."
I switched to Emacs after over a decade of exclusively using vi, and initially I would have agreed with the claim, "You can easily do things in Vim in the normal course of editing that would require you to drop down to scripting in Emacs." But then I discovered that by using Emacs' macro capability and a large repeat count, I could easily make Emacs do pretty much everything that vi had made easy, and a great deal more.
Emacs' macro functionality involves three commands:
For example, in vi if I wanted to find all
<a>
tags in an HTML file and add atarget
attribute, I might do something like the following:This example is not perfect, since it assumes that all
<a>
tags are on a line by themselves. But it's good enough for illustrating how one accomplishes the equivalent task in two different editors.To achieve the same effect easily in emacs, here's what I do:
Here's a description of what each keystroke above does:
It looks complicated, but it's actually very easy to type. And you can use this approach to do lots of things that vi can't do, without ever dropping down to Lisp code.
I was very happy with my Vim, but once I heard of org-mode, I started learning Emacs. org-mode could be one strong reason to learn Emacs.
I don't want a holy war, but please answer a highly subjective question with a yes/no answer.
Yes, you may see a productivity increase because of the powerful functionality.
No, you will not see a productivity increase because the patterns and metaphors used in emacs may not align with you brain.
Twice I've tried to learn Emacs. It just doesn't fit how my brain works, and so I don't use it.
Emacs (or vim) is not significantly better than vim (or Emacs). Both have many options to add to them that allow them to do amazing things. I have no doubt that anything you can get done in Emacs you can also get done in Vim, just not standard.
Try Emacs. See if it fits better. It's a no-lose situation.