back
116 comments
Once you have mastered Emacs, you are good at all other editors

I haven't found that to be true at all. I find that due to archaic idiosyncrasies and the customization possible with emacs, the more time I spend with it the more difficult it becomes to use different editors.

I haven't found that Emacs has made it harder to use other editors. It's just made me realize how horrible it's always been to use them, hammering away at the arrow keys, using the mouse way more often than should be necessary, spending time on fixing whitespace that should be spent writing code…

Then there's the fact that Emacs really isn't an editor. If anything, it's a shell that runs elisp programs, chief among which is a text editor. Programs like magit and ansi-term (and gnus and compile and dired and TRAMP and…) are good examples of this.

I spent 5 years learning and using vi (n perhaps a dozen different Unix-like OSes, so they were all different, meaning I could only use a core set of features.

I then spent a few years working on Windows where I had Vim, but other editors I used were, well, 'standard'.

Then ViEmu came along and I now move between Vi-like editing in VS and Vim, and 'normal' editing in other apps.

It's not too bad, to be honest. I'm editing in a non-vi-like-manner in this comment box. I could probably install something to make Chrome do vi-like editing here, but my brain is happy to switch modes, if you'll forgive the pun.

Yes, I had the same impression. All people I know who use either Emacs or Vim on a regular basis are bound to them.

On the other hand, they run everywhere and are open source, so it's probably no problem.

After seeing TextMate struggle around the jump from version 1 to 2 and yesterday reading Sublime Text to struggle going from version 2 to 3 (to 4) I became more afraid of the sustainability of newer editors. Maybe it's time to hold stronger to your emacs, (or vi).
I've been using Emacs as my day-to-day editor for coming up on 15 years now. There is a lot to be said for picking up a tool with that kind of longevity.
I'm a vi user, having learned it when I had to admin dozens of flavours of *NIX in the 90s.

I moved to Windows ten years ago for my day job, and had to use many editors which didn't support vi keybindings, so ended up learning to work with only the keys on the PC keyboard.

This has worked out quite well, as these days I have vi keybindings in some Windows apps (thanks ViEmu!), but when they're not available, I can fall back to 'no help' mode and still be comfortable enough with most editing tasks.

Still more<esc>bimuch <esc>ea productive with vi keys!

>I became more afraid of the sustainability of newer editors [such as Textmate].

I'm not afraid. After 22.5 years on Gnu Emacs, I'm considering a jump to Textmate 2.

(I probably would not be considering a jump, however, without the boost to sustainability caused by Textmate 2's having been open-sourced. ADDED: also, being able to edit files on remote hosts is not important to me.)

Reading guides like these makes me think about how I sound like when I implore novices to try out the command-line.

Why should I?

I'll peg myself as a half-competent developer, the kind who codes everyday and can lose a weekend to a spontaneous side project. I am completely in agreeance that tool mastery is vital for enjoying and being productive in programming, I just have no concept, not from this guide, and not from many others, why Emacs is better for me than Sublime Text, nevermind why I should consider taking a year (an eternity in technological time) to master it.

And I realize that's a question that requires an unfair amount of trivial knowledge (e.g. the way I work and design)...but that's kind of the core concept for me...I feel pretty productive in ST3, I can sense the shortcuts and power tools I haven't taken the time to master and where they would help me, and for the most part, I design my projects in a way that fit the ST3 navigational flow...which I imagine is a side-effect of ST3's overall excellent design. In general, though, the bottleneck for me in programming isn't the typing of code or navigating through files, it's the sitting and thinking...rarely do I ever feel that ST's navigational functions cause me to lose context or concentration.

So all things considered, what value does Emacs bring me? Is it better in general programming situations? Or for ones in which a highly customized environment is needed? In that case, then fashion the argument properly...I would never argue that Ruby is the best language for all purposes, but I could certainly argue that it's a great contender for specific domains, and as a "glue" code.

Maybe the OP lists some compelling use cases further down in this document, but I pretty much stopped reading at this line, which gives me low confidence that me and the OP share the same worldview of how things work:

> No job ad will list Emacs as a required skill. That’s actually a good thing. It ensures that only honest technical guys exist in Emacs community.

> nevermind why I should consider taking a year (an eternity in technological time) to master it.

I don't want to proselytise, but maybe that hints at one of the core appeals of emacs. A year is nothing in terms of the span of time emacs has been around, and so time invested in making emacs your editor is effort that won't be discarded in the next technological cycle.

The other aspect is what I mean by "making emacs your editor"; emacs has had a lasting appeal because it is so general, and so malleable. Emacs becomes a construction material for your personal editor, and everyone who uses it seriously ends up with something idiosyncratic and ad hoc, in the best senses of those words.

As with all things, if you don't like it, that's okay. If you're productive in ST3, great!

For me, it was the realization that emacs can be configured to do anything you want. If you don't like how it works (and you probably won't), you can change it. Do you wish that Alt-<left arrow> would delete all of the whitespace in front of your cursor and translate the rest of the line to piglatin? You can to that. Do you want to send a copy of your file to an ftp site in addition to your local disk when you hit 'save'? And also push to github? Go for it. I guess you could say that you get out of it what you put into it. I sometimes find the auto-complete in emacs a bit lacking and I'll try another editor/IDE, but once I find something I don't like and I can't change it, I'll go back.

That being said, I think you're probably right that it is better in general and other tools can be better in specific situations.

I was half expecting you to realize that you answered your own question before you asked it (why do you implore novices to try out the command-line?). But what the hey, I'll throw out some links that go better into why Emacs is still a very viable contender for your editor of choice.

Steve Yegge wrote a classic programming read "Tour De Babel"[1], which has a bit on Emacs under the Lisp section. He also wrote "Effective Emacs"[2], which just the intro tries to explain why you should use Emacs. Lastly, there's Vivek Halder's "Levels of Emacs Proficiency"[3] which will either amuse/awe you or scare you.

[1] - https://sites.google.com/site/steveyegge2/tour-de-babel

[2] - https://sites.google.com/site/steveyegge2/effective-emacs

[3] - http://blog.vivekhaldar.com/post/3996068979/the-levels-of-em...

> So all things considered, what value does Emacs bring me?

The value in emacs is all the language specific modes and utilities that will allow you to turn emacs into a customizable IDE where you can run your builds, tests and debuggers from inside the editor.

There are "proper" IDEs out there but all of them are more or less language specific. Emacs is a general purpose text editor and can be used with any language, and customized to the tools and conventions around that language.

I use so many tools and languages that having a single language IDE (or many of them) is not an option. And I don't want to go back to running a simple text editor and running my builds on the command line separately.

I've been a Vim user for quite a long time but I'm slowly making the transition to emacs and evil-mode (I recently started doing some symbolic math Scheme code in emacs). Vim is a great editor but tool integration is the weak spot. Especially debuggers don't really play nice with Vim.

> why Emacs is better for me than Sublime Text

Do you use a text editor only for programming? Or do you use your text editor to edit all kinds of text, including emails, letters, notes, to-do lists, etc.? I do the latter, and the last time I evaluated text editors, Emacs was the best choice for editing all the text that I work with daily.

For example, the last time I evaluated Sublime Text, it didn't have package nearly as powerful as Org mode for Emacs. Org mode is the best note-taking tool I've ever used.

In addition to note-taking, another example is email. format=flowed is one of my requirements, and when I search the web for "Sublime Text" "format=flowed", I get fewer than 744 results, and none of the top results are relevant. When I search the web for Emacs "format=flowed", I get 135,000 results, which includes many relevant results.

By not learning Emacs, you're missing out on the joys of RSI.
At last, a reason to check G+! I also need to learn about smex.

Interesting to see he uses evil-mode. I've just started using it, and so far the jury is out. I have yet to find an equivalent to move by sexp (move by sentence [()] doesn't do the same thing for me) for instance. I'm less interested in an exact replica of Vim than a more efficient editing experience. Perhaps this will ease with more experience.

A developer who is curious enough to try Lisp is possibly more intelligent than average

This is the kind of exaggeration that makes a lot of people to avoid even trying Lisp. Any programming language that uses a different programming paradigm than the one you are familiar with will make you a better programmer.

I don't really have any desire to try lisp, and every time I see that kind of lisp advocacy I have even less.
That quote is taken out of context and was written by someone who's first language is obviously not English. I took the paragraph to mean that Emacs users are possibly more technical because it attracts those who are curious enough to research less mainstream programming languages.
Currently I use Sublime Text 3 with the Vintageous plugin, I'm proficient with Vim but I find myself preferring Sublime Text due to the multitude of packages available to it as well as the UI being in my opinion better and more customizable. I'm most interested in moving to Atom once it matures a bit more and the Vim style plugin also matures. That being said, I've tried using Emacs tons of times now and it just doesn't click with me. More power to you if it's your preferred editors but I'll take Vi(m) over Emacs if I have to use a legacy editor or Sublime Text with Vintageous for everything else. Hopefully soon Atom can replace Sublime Text for me and I can stay on Open Source software.
I started with purcell's config as well. I did two separate attempts at getting started from scratch, and it was just too much. Using purcell's config made me somewhat productive in a week.

Now I'm starting to do my own changes to his config, but there's still a lot of stuff I'm afraid to touch. I'm thinking of declaring ".emacs bankruptcy" soon, or maybe start from something more minimal like the Starter Kit linked in the article (I wish I knew about it before starting with purcell's)

Biggest thing I miss when I moved from Vim was tmux. Window management in Emacs is a nightmare, and the shells suck as well.

I started with nothing. I believe that just like every Jedi must build their own light sabre, every Emacs user should build their own dot-emacs. Conversely, thus spake the great French philosopher: "hell is other people's .emacs"

Emacs is a stern taskmaster, but she repays the investment in multitudes.

Glory be to the thermonuclear text editor.

https://duckduckgo.com/?q=thermonuclear%20text%20editor

I use emacs with tmux, why do you have to leave tmux if you move away from vim? about the emacs shell, yeah I don't use it, use tmux or screen ;)
Can anyone share what they feel are their top 3 greatest workflow improvements in productivity going from a point and click IDE to a shortcut based IDE like emacs?
The improvement for me:

* speed of typing : I really appreciate not having to take my finger off of the main part of the keyboard to use arrows or the mouse, I also don't like the 2 stack (2 mode) switching for vi. Somehow I find it easier to remember the few keyboard cords the toggling of modes.

* works in a terminal : launch with emacs -nw and you can work across an ssh terminal with same syntax highlighting, same shortcuts

* available for most OSes : my co-workers use fancy new editors except they have to rsync code from the server back to their latest Ubuntu, OSX or Windows just to edit it.

* people like to customize it and there are modes for all kinds of esoteric languages and build systems : i don't fiddle much with my .emacs so it is not benefiting me personally but others swear by it

1. On-the-fly keyboard macro generation. I use M-[, record, M-]. f9 to execute. (C-x e, e... if function keys not available) Even very small, one-time, but repetitive tasks can be automated.

2. First-class functions that can be bound to anything. I always bind "goto-line" to a single key (like f7). That alone saves me lots of time. And custom functions work the same way. You can put a macro to insert that if __name__ == '__main__' in python scripts with a single keypress, or with a "M-x <function_name>".

In addition to language boilerplate, you can use these facilities to help enforce arbitrary coding standards. I have a function template for C that adds a comment "/* end <function_name> */" after the close bracket, for example.

These facilities apply to any file you might want to work with. This is in addition to whatever editing modes might already exist for the language.

3. Working in text-only terminal on a remote server is only slightly different from working on my desktop. Not having to manually sync files or mess with X configuration is a huge win for me.

Emacs is not an IDE- its a text editor. It would be nuts to use Emacs to edit Java compared to Intellij or even Eclipse. Having said that, it is no more productive than any other text editor at editing text (as compared to Vim or Sublime Text 3). Even if that weren't true, would you really invest years into learning a new editor to make editing text a few percent faster? Programming is limited by thought, not typing (common pain here is solved by plugins anyway). The benefits of using emacs are as follows:

1. terminal based 2. key chords 3. (e)lisp 4. open source 5. stable 6. extensible

What's a "point and click IDE"? Eclipse and Visual Studio are "shortcut based". I've never seen a "point and click IDE" except maybe SQL Windows/Gupta/Centura.
1. Doing funky things with symbol under cursor. In past lives ive had documentation for things like assembly instructions, opengl apis etc displayed inside emacs.

2. Emacs macros.

3. Lack of hopping between terminal and editor.

For me it's less about productivity and more about comfort. When I first started using Emacs I felt like it was a lot easier to move the cursor around and manipulate text with shortcuts consisting of keys that were already near where my hands were on the keyboard.

I use vim now though, and I find that the keybindings feel much more natural, being based on the positions of the keys rather than mnemonic-based ones in Emacs (e.g. ctrl-n for "next line").

EDIT: Sorry, I realize this doesn't really directly respond to "IDE replacement" - honestly I don't write much code any more so some of the below doesn't apply to that. When I wrote code, the main benefit of emacs was that it abstracted me a bit from the nuances of different IDEs for different languages / platforms and was good at generalizing interactions with the compiler / errors / objects. A really good IDE would be better at many certain things than emacs, but emacs was marginally better all around. I used it for C, perl, and a little C++.

1) "the kitchen sink" thing, which is commonly cited as a drawback, is (to me) emacs most compelling feature. If this isn't compelling to someone, then a lot of the rest of emacs probably won't be, either.

There's a learning curve to doing everything in emacs. I've written some guides on it before to ease the transition to starting to use it (basically introducing a few very important basic concepts that introduce major and minor modes, keybindings, and how to investigate those and customize them), but when you have that core understanding down, when you realize that you can apply those same concepts to everything you do - it's incredibly, incredibly powerful and you understand why people want to live in emacs.

eshell or shell-mode for your shell interactions is amazing. searching through a shell buffer with emacs' regexes or incremental search is fantastic. Running your whole shell in that buffer and being able to run simple but useful commands like "occur" (essentially letting you grep through multiple preceding lines of output) is something I use all the time. The commands to jump up / down through the buffer to prior prompts in the shell history - all of that stuff is great.

Similarly, using dired (directory editor) as my shell browser is great. If I need to do a batch file rename, I could jump through some hoops to do this with shell script one-liners or something, but putting dired into editable mode and then treating the file names simply like text and using search & replace operations the same way I would on regular content in a file is a natural, fast, and powerful operation.

And of course all of these are the same commands and same environment as I have for editing text.

I don't do everything in emacs but I do as much as I can in it. And I didn't mention org-mode but I use it for 100% of my note taking and publishing to HTML - it's incredibly awesome.

Eclipse has emacs-style key bindings. So you can have the best of both worlds.
Perhaps a naive question here, but I'm interested in emacs now, and I need to ask: does your left pinky finger get used to all the CTRL and ALT key combos, or do you change the key bindings, or are there special keyboards meant for emacs use, or what? Two minutes into the tutorial I was already thinking about whether there should be some sort of hack to use CAPSLOCK instead of CTRL...
I use xmodmap on Linux to remap caps lock to ctrl: http://www.emacswiki.org/emacs/MovingTheCtrlKey
You should absolutely rebind Caps Lock to Ctrl.

I guess it's time once again to mention the Kinesis Advantage keyboard on HN. You can rebind every key. You can rebind control and meta to keys that are under your thumbs, and put one copy under each thumb so you don't have to use the same thumb all the time. And everyone who walks by your desk will have an excuse to start a conversation about your incredibly strange keyboard.

I always rebind capslock to control. That's essential. The other thing is adjusting the bindings to your taste; for example, I change a number of standard bindings to better suite a dvorak layout.
I tend to lean on the control key with the corner of my palm rather than pressing it with a finger tip. (Though I don't use a normal home-row style of touch typing, either, so YMMV.)
honestly i have no idea why people complains about the ctrl and i actually love how accessible ctrl is. i use ctrl all the time, ctrl-c, ctrl-v, ctrl-a, ctrl-e etc ... ie; ctrl-xs ctrl-xc just rolls off my finger like nothing. i think capslock thing was just a thing of the past when capslock was where ctrl was/is now.
I'm a competent Lisp developer (and fanatic), yet I use Vim. I've also met Vim-bashing Emacs fanatics who didn't know the second thing about Lisp (the first thing, of course, being all those parentheses).
A great reference with some pragmatic advice.

I've heard that one of the main benefits to emacs is that it can be used to tool itself to one's needs; curious to know if that's what others have found?

Yes, emacs is wonderfully customizable, but there's a deeper idea underneath. By investing time and effort into learning it and buying into its conceptual view of the world as text buffers that can be manipulated, you gain a level of mastery over your environment that's simply not possible with an IDE or specialist tool. And we are all deeply motivated by mastery. Some authors like Dan Pink say that mastering something is the biggest motivation of all, even above recognition and money.

Many IDEs are pretty veneers on sequences of complex commands that must be learned by rote. Emacs gives you text buffer interfaces to whatever you want to do, a mostly consistent model for dealing with them and the programmability to change whatever you like.

A friend of mine asked me this recently: are there many young programmers investing in emacs? I only know a few... it's kind of depressing.
-> "I believed Microsoft Windows was only platform worth to develop software."

This sounds like the first line of a Kafka-esque horror story.

Out of curiosity, and this is a real question not a troll :

What can emacs and vi do that a regular IDE can't ?

Any one know how Sublime Text's Command Palette alternative in emacs?
Are there any decent books out there on emacs?
I may be raging, but if you need one year to master an IDE/Text editor there is something wrong.
FTFY Get Emacs pinky in one year