17

I use IntelliJ IDEA as a code editor, so this isn't to replace that. I use vi or vim for simple text editing on our servers and standard unix commands to find files, get directory listings etc.

Colleagues swear by emacs but I wonder just whether it's worth my time learning it. Just how much more productive will i be?

EDIT: It's been pointed out that this question has been asked before

14 Answers 14

31

I've used emacs for more than twenty years. As much as possible, I try to use it for all my typing needs, including, as Fu86 mentioned, reading email, news, etc, as well as notes, to-do lists, writing code, running compiles, etc. Since emacs is much older than the extensible vim (as opposed to the relatively non-extensible vi), it has a much larger collection of extension modes covering almost any purpose you can imagine. That said, it's fair to say that serious use of emacs can be considered a lifestyle choice, in that it takes a considerable amount of effort and time to become fluent with the tool.

My real answer is that, as far as editors (and any other category of tool) go, you should find one that is powerful and flexible, and then take the time to become a skilled user of that tool. Your tool of choice can be either vim or emacs, or perhaps something else, but in any event, take the time to learn it well. Personally, I've chosen to master emacs, and I've never been disappointed when I've wanted it to handle some new situation for me.

Having never worked seriously in Java, I can't comment from direct experience on how well it replaces tools like eclipse and intellij. I'm old enough to be skeptical of these highly-integrated tools (even without experience with them), and there are emacs modes that provide some (although by no means all, I'm sure) of the features of these editors.

3
  • I realise this answer is almost a decade old now, but I'm curious - what do you mean by "highly-integrated" tools? I realise it's in the same, but I'm curious what exactly is meant by "integrated" and to what extent. Dec 3, 2016 at 6:33
  • 3
    @Hashim: As you point out, it's been a while since I wrote this answer, but very roughly, I think by "highly integrated" I meant that modern IDEs are often tightly coupled to a single language or a relatively small number of languages. This tight integration allows both very advanced but also prevents the use of that editor (IDE) as a generic text editing tool. Re-reading my original answer, although I still stand by the first two paragraphs, the final one exhibits a fair degree of hubris edging, I must admit, into arrogance. Jun 7, 2017 at 8:39
  • Thanks for the response after so long. Haha, the benefits of maturing with age. :-) Jun 7, 2017 at 20:23
15

1) Should you learn to use Emacs? Probably. 2) Should you try to switch all your development over to Emacs? No. I'll discuss each of these questions in sequence.

1) In this question, Emacs could be replaced with Vim or any other cross-platform editor. I wish to emphasize the fact that it is cross-platform. This, for me, is the primary benefit of being fluent with Emacs (or Vim). No matter what computer I'm on, it will either already have Emacs on it so that I jump right into some development or I'll be able to easily download it in a few minutes. In my university programming labs, rather than trying to use whatever IDEs the computer I was on happened to have, I just opened the terminal and used Emacs. Since I was already somewhat fluent with Emacs (although by no means an expert), I was able to get the work done just fine without having to fight with a different environment.

Further, there are some languages for which decent IDEs simply do not exist. For example, every time I try to find a decent IDE on OS X for Haskell, I always end up falling back on Emacs. If I wasn't fluent with Emacs, I really don't know how I'd write Haskell code.

Finally, using an IDE for very small projects (and especially just simple one file programs) feels clunky and counter-productive; it's nice to have a simple text editor for such tasks (although I'm sure some would argue as to how simple Emacs really is). But this isn't necessarily an argument for Emacs specifically; on OS X, for example, TextMate is an awesome editor for these tasks.

2) Emacs is powerful and wonderfully extensible, but in my experience it is not a substitute for an IDE. When starting a new project in my spare time, one of the first things I think about is whether there's a good IDE for my language and technologies of choice. On OS X, for example, I'll usually look first to see if there's a good way to use Xcode for my project. On Windows, I'll see if I can use Visual Studio. If that fails, I'll look at IDEs such as Eclipse and NetBeans. Only after that do I consider doing serious development using a text editor like Emacs.

I hope this helps!

5

I don't think you'd be more productive either. I myself do use Emacs for programming currently, but the main reason is that I have to ssh into the system where I'm developing. Otherwise I'd probably use an IDE like IntelliJ or Eclipse.

3

The choice of editor is something that every programmer has to make at least once, but often repeatedly over the course of their career. I was a vi+Eclipse user until about four years ago, which was when I made the transition from being a hobby coder to being a professional, and more or less simultaneously to using emacs.

What I've found is that emacs has rewarded every bit of time I've spent learning it with increased capability. I still cannot recommend it for writing Java -- Eclipse/NetBeans/IntelliJ are so much better than any mere text editor for that -- but for configuration file editing, C coding, scripting emacs provides everything you might want, and more. The latest versions (bleeding edge stuff, sadly, still unreleased) even support TrueType fonts in gnome.

It'll be painful. Changing tools always is. But yes, you should try to learn it. You won't regret it.

3

Honestly I don't think you'll be more productive at all. Emacs was fine as an editor a decade ago but a modern IDE--particularly IntelliJ of which I'm a big fan--comes with so much more than an editor, including a debugger, the ability to refactor your code, seamlessly move classes and packages, etc etc etc. A huge part of the productivity benefit of an IDE comes from those features rather than the editor.

If you're not using vi/vim as a primary text editor (meaning using it for significant development effort or just significant time) then whatever you use is ancillary to your IDE.

11
  • 4
    "people who swear by Emacs probably also swear by their Betamax video recorders." You are welcome to think (right or wrong) that emacs isn't a good choice, but this is poor grace, and has no place in this sort of conversation. Feb 15, 2009 at 18:22
  • 1
    "If you're not running a graphical environment... actually I can't imagine that's possible." - You've obviously never had to work with a headless server then. Feb 15, 2009 at 21:42
  • 5
    Emacs is an IDE, and it has modes ("plugins") for almost any task you might imagine, including debuggers, code reformatting, etc. etc. etc.; and if anything is missing, you can extend it yourself. It even works without X/Windows, but it can also use mouse support.
    – Svante
    Feb 16, 2009 at 12:08
  • 2
    I disagree (to the trolling accusation). Some just can't take a differing opinion so choose to use offensive as a super down-vote. Or, worse yet, they really do see differing opinions as offensive. If so, I pity them.
    – cletus
    Feb 19, 2009 at 0:52
  • 2
    Wow, offensive votes? He's allowed to have an opinion, he can decide if it's right or wrong and it is definitely not offensive. Cletus has answered the question "How much more productive will I be?".... you can't flag a post for having a different opinion, or for being offensive if you consider a different opinion offensive..
    – mk12
    Sep 2, 2009 at 20:00
2

'emacs' is great but if you are comfortable with 'vi' and wont be heavily using it then you are better off not putting serious time into learning emacs. emacs is fun and gets quite intuitive over time. So, I would say spend 10 to 15 mins everyday and see how it works for you.

2
  • My problem is that by the second day, I've forgotten all the commands! 10-15 minutes is just not enough time to learn I think Feb 15, 2009 at 18:14
  • 1
    @Chris: See my answer at stackoverflow.com/questions/311221 -- learning the "commands" is not the important thing. You might need to spend an hour reading the tutorial, then just start using Emacs for all your simple text-editing. Eventually, you'll get to using it for everything. ;-) Feb 15, 2009 at 18:45
2

I've always preferred vim for simple text editing, but I prefer elisp for extending the editor. These days I use emacs for my serious editing and vim for quick things when I'm ssh'd into a server.

2

The difference between emacs and vim is that emacs includes many many features and combines mail, news, filemanager, and of course a text editor. Vim does only text editing and that very well (without plugins). Its up to you if you like emacs or not. I personally like vim more, but give emacs a try and find the best suitable text editor for you.

1

Learning Emacs isn't a bad idea: many IDEs (e.g. Eclipse, and NetBeans -- when last I used it) have support for the same (or similar) key-bindings. Though these bindings can be confusing at first, they can, in my opinion, greatly increase your speed on the keyboard, as your hand never really leaves the "home" position. In a more mature IDE, this is invaluable.

Of course, having become so accustomed to Emacs key-bindings, I now struggle whenever they're not available.

1

Personally, I like emacs. It's widely available and has a lot of features. Unlike VI/m, it doesn't have the concept of insert mode, so it feels like a standard text editor.

Also, Lisp.

1

There is one other benefit of learning emacs. Emacs has been integrated into unix operating systems in a surprising number of ways. For example, you can use basic emacs commands in xterm. Heck in OS X, you can use basic emacs stuff just about everywhere. Plus, you can also set a lot of IDEs (like Visual Studio or Eclipse) to use emacs-like commands. So I'd say that it's a good thing to be familiar with the basics of emacs even if you don't use it that much.

One other thing to point out: emacs is a godsend on laptops. Especially Apple laptops. You don't need to worry what god-awful location the home key is in because you just need C-a.

0

If, after reading this analysis of editor vs IDE, you would consider yourself a language maven, then you should learn Emacs. Otherwise, you should not.

0

If use now use and like an IDE, and you are already familiar with vi/vim, then don't give Emacs a second thought. Emacs will never replace your IDE, and if it could then vim would do you just fine. Nevermind the Emacs vs. vi holy wars... you already know vim, and vi/vim will be already installed on any UNIX flavor you come across.

0

It's a pretty good idea to learn using either Emacs or vi well. You will then be able to decide for yourself what works best for you. Perhaps you will end up using both; IDEA for one thing; the "editor" in other situations.

Which editor (emacs or vi) is pretty much a matter of taste. It's very helpful to have local experts who can answer "Hey, how do I do X using editor Y". If your colleagues swear by emacs, then I'd say give it go.

Not the answer you're looking for? Browse other questions tagged or ask your own question.