As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
If this question can be reworded to fit the rules in the help center, please edit the question.

19 Answers
19

When I read The Pragmatic Programmer and they suggested that one picks a text editor and learns to really use it, I chose Emacs and really I haven't looked back.

I don't use it for everything- if I'm developing .net I will tend to use Visual Studio because it's all set up for it, but for most web dev stuff I find it more helpful than an IDE and the extensibility makes it as powerful as your imagination.

I do think that to a lot of younger programmers it probably looks arcane ( an elegant weapon for a more civilised age ) and the need to learn keystrokes pretty much from the start is probably offputting to someone who doesn't really want to master it, although the benefits are remarkable.

It seems likely to me that tools like that are unlikely to appeal to younger programmers because they don't have the experience to appreciate the benefits of a truly powerful text editor. Coming to appreciate that is, perhaps, a sign of maturity in itself.

Also there are many more programmers now than there ever were. It may well be that there are more Emacs users than ever, but that they represent a smaller proportion of the programming population than they once did.

For the people who don't want to master a text editor like Emacs or Vim - find someone who has mastered it and watch them for a while. You will be amazed.
–
Dylan YagaJun 24 '11 at 13:57

12

As I grow more experienced, the more I lean away from GUIs and GUI tools. They add a layer of complexity that I find isn't really needed. So I use emacs 100% for my work.
–
Paul NathanJun 24 '11 at 16:56

1

Fair point @Chance about keybindings- the number of times I have caused myself a problem by using Ctrl-X Ctrl-S and cut the line I have selected before saving in a tool other than Emacs is significant. But there is the option to use Windows shortcuts if you want to.
–
glenatronJul 25 '11 at 9:00

I'm 22 (I'm guessing this meets your definition of new generation) and I use Vim (admittedly not Emacs) when I'm working with languages that don't have a first class IDE (examples of languages that do would be C#, Java, and Scala IMHO). I tend to find that the shortcuts available are more powerful and increase my productivity compared to an editor like gEdit or Notepad++. There's definitely a learning curve involved but I see it as an investment.

So to answer your question, some young programmers do use Emacs but I'd imagine most don't.

I’m 23. I’ve used Vim (yes, not Emacs, but still breaking a lance here for both) for 6 months now — 3 of them 8 hours a day at my job (JS/HTML/CSS).

Everyone holds their breath in awe when I change 20 lines of code in three seconds. Or when I scroll through files one page per half a second and still keep the context. Or when I get NerdTree and a 3x2 window setup open and navigate through the project in no time. Or when I do a complicated regular replace across 150 open buffers, saving them all at once afterwards (not even mighty TextMate can save all open files at once!). Or when I auto-complete across all open windows (including shells and file trees). Or when I indent the body of a function in two keystrokes. Or when I remap half of my keyboard to insert often-needed things with one keystroke. Or when...

Productivity is key, especially when you have tight schedules and need time to think about the solution. You just can’t waste your time by spending most of it editing the code.

You’re being paid for thinking. So use a tool that lets you think more and lets you flesh out your ideas quicker.

Vim lets you do this, while keeping you close to the code. (And it just looks friggin’ impressive on a 30" monitor. :P)

By the way, it took me three tries to take the learning curve (a.k.a. walking up the wall). But these helped a lot. Just try it. Yes, it is different, and feels strange, but trust me: it’s the same from the other side of the mirror. Using a mouse just feels stupid nowadays. It’s a bit like riding a bike. Once you learn it, you don’t want to walk anymore because it’s so slow and less fun.

Emacs and Vi(m) will never die as long as there are text based sessions via ssh and headless servers to be managed remotely. Systems administration is more about automation and automation is easier and quicker with command line interfaces. Command line interfaces demand powerful text editing software in a Terminal session.

Web interfaces are great, but what about when you don't have access to anything but ssh because of network restrictions or the poorly written server web interface requires IE 5.5 and your grandmothers machine only has IE 9.

Emacs is a different beast from Vi(m) and both have their places on all the machines that I have to deal with remotely.

Emacs is better for working on long editing sessions with multiple files at one time and for files that are supported with the very powerful mode plugins for Emacs.

Vi(m) is better for changing a single line or two in a file and being done with it. I don't find that having to switch modes to be efficient, but for say git commit edits, Vi(m) is my preferred choice.

Windows only users probably don't have much use for either one of these text editors, they have the power of Notepad at their disposal, but for Unix/Linux and OSX users to a lesser extent, they are in-valuable.

That said, I would never consider editing code in great quantities of related files with either of these editors unless I absolutely had to.

Yes there are great Erlang, Ruby, Python, Javascript and Java modes for Emacs, but I prefer Intellij IDEA or even Eclipse for manipulating dozens and dozens of files for the code sense, refactoring, reformating and file management if nothing else.

And for editing one off local text files on my OSX machines I prefer SubEthaEdit over Emacs or Vi(m) when I don't want to load an entire IDE and just need to change a line or two.

Learning Emacs is like learning Latin, once you understand it, it gives you a perspective on all the other text editors that you come across that you would never have had before. This is greatly in part to Lisp. This is even more so once you learn Lisp, you gain a different paradigm to use to compare to the rest of the world of programming languages.

I don't use it myself - I prefer GUI editors and vi. But I know lots of programmers in their twenties who use emacs and love it.

I think it's mostly a matter of personal preference, but if you're doing Unix/Linux/Mac OS X work at all, it's certainly handy to know either vi or emacs, since they're both likely to be present and usable if you can't get to a GUI for some reason. In fact, I'll often be working in a terminal window in Mac OS X or Ubuntu, and drop into vi to edit some text file.

In fact, it was pretty funny at my last job - one of the young emacs-heads started lecturing me about why I should quit using GUI editors in favor of emacs. I stroked my white beard a moment, and then cut him off and explained that I was quite aware of his arguments, having been proficient in vi when he was wearing diapers.

I've been developing on Windows for 20 years, and on various linux/unices for about as long.

On unix/linux I usually use emacs, because it is big, fat, and all-singing. (And the younger generation carry on at me and use vim.)

On Windows for embedded work I use emacs, and for windows GUI development I use the IDE for the development environment.

I find younger people tend to frown on emacs... but they have also not pushed the boundaries to the same extent I do. Opening many files, have multiple panes on the same or different files, running grep and compilation inside the editor and being able to shove windows all over the place - easy in emacs. In most other environments, you can do about 3/4 of those tasks to greater or lesser extent. Its the things I can't do in the other environments that annoys the heck out of me... and keeps me in the land of emacs. (Which has its idiosyncracies too.)

Someday we may jack our brains directly into computers, but in the meantime all we've got are finger powered editors. Picking the right editor makes a difference; if you are going to be editing with an editor for more than a few hundred hours in the next year, take the time to learn one of the editors used by the best programmers. Really master a high-powered editor and you will program faster and better.

I've been programming for 45 years, and during that time I've written programs and used editors in every imaginable environment. I've also observed hundreds of programmers at work, at school, world-famous research centers, huge corporations, and start-ups. In general, I've noticed that a great majority of the very best programmers use either either vi or emacs.

Emacs and vi are free, open-source, and easily available on any unix-like system (e.g. Linux, FreeBSD, MacOSX) and with a little work can be installed on Windows. The are both powerful, extensible, and fast. Because of their longevity and ubiquity, learning
one or the other is a good investment for any professional programmer. There are
a number of alternative forks or implementations for each of these editors. The
most active and best supported version of vi is currently vim (which comes installed on
every version of Linux and Mac OSX). Standard Emacs (now at version 24) is
the most widely used emacs, but there are forks like (mg--a small micro version that
runs in a terminal window or aquamacs--standard emacs with a few MacOSX related modifications).

The other posters have raised excellent points, here is my take on some of them.

Aren't these editors hard to learn?
Yes, they are, but the effort is worth it.
Like learning to snowboard, the first week with either of these editors can be painful, but after that you will find yourself very productive. Going further and obtaining a vi or emacs black-belt isn't easy, but once you've used either one for a year or so, you will be amazed at what is possible. No one is going to be comfortable driving a Formula One racing vehicle when all they've driven before is their roommate's old clunker, but once mastered there will be nothing faster or more powerful. If you are a professional or want to program like one, invest the time to learn the tools used by the best. If you think it's worth training for 6 months to be able to run a marathon or taking a year of Judo lessons or even sitting down to read the entire Harry Potter series, take the time to learn emacs or vi.

Why can't I use a mouse while editing?
You can and modern versions of these editors support using a mouse, but they are designed so it isn't necessary because using one is slower and takes you away from the keyboard breaking your concentration.

Why do these two editors use such awful keybindings?
Emacs and vi predate the conventions that most current programs use and both were created before computer keyboards were standardized and their keyboard choices now seem odd. (I map the control-key to the caps-lock key to make using emacs more comfortable for my little finger.) Both editors have a large number of built-in functions, over 2000 in the case of emacs. Because navigating nested menus with a mouse takes so long, vi and emacs users use keybindings that may involve shift, control, alt, or prefix bindings to provide fast access to the most important of their numerous operations. You can get by once you know a dozen commands, but it's nice to be able to navigate though code with the precision and speed provided by the score of navigation commands offered by these editors (rather than cursoring around one character at a time with the arrow keys located somewhere far from your fingers). While the keys may seem odd, the emacs basic navigation and editing commands can be used in most software that runs on MacOSX wherever there is a text field to fill in (for example, the URL field on Safari). Any software that uses the GNU readline library also supports the basic navigation and editing keystrokes of emacs or vi (for example, the bash shell or the python interpreter).

What about IDEs?
Programmers familiar with vim or emacs may not need or want to use an IDE in many cases. Vim and emacs provide powerful searching, auto-completion of identifiers, syntax highlighting, and auto-indenting. They also support tight integration with all source code control systems, and they provide easy manipulation of files and directories within the file system. Debuggers and embedded shells and interpreters have been supported by these editors since before Java was even invented. There are even full-blown IDE environments for various languages that are implemented as extensions within these editors, and some people prefer to use these as IDEs. I, personally, sometimes find the need to use IDEs. Xcode on the Mac or VisualStudio on the .NET platform or some form of IDE when programming in Java are all quite useful. Whenever possible, I configure these IDEs so that I can edit in emacs (or vi) and when this isn't possible, I try to pick IDEs that support emacs-style keybindings. Most IDEs do this, some better than others. Wing IDE (for python) has very good emacs emulation PyCharm (for python) has great vi (and good emacs) emulation.

Aren't there any newer alternatives for a professional programmer?
TextMate on the Mac is a nice programmer's editor and it seems to be a favorite amongst Ruby programmers that use Macs. Notepad++, which runs under Windows, is also frequently mentioned as a good all around programmers editor for Windows. Good programmers use these editors, but they are less powerful editors than vi and emacs and run only in one environment.

What do I recommend?
Standard Emacs or Vim, it doesn't matter. Pick one and stick with it for at least a year.
Talk to other users and pick up their tips. Explore the editor's capabilities and learn to use its most useful extensions. Although basic versions of vim and emacs may be installed on the Mac, download the latest stable versions from their web sites.

Alternatives that wouldn't be my first choice as a primary editor, but are interesting nevertheless:

1) TextMate. I like this editor (by default it supports many of emacs keybindings)
on the Mac. I install it on my development machines, but I don't use it much.

2) Vico. A very pretty reimplementation of Vi available on the Apple App Store. It's definitely vi, and although currently quite limited compared to vim it looks much more modern.

3) mg. Microemacs is available free on all platforms and provides the basic editing commands of emacs but lacks emacs's powerful extensions and many built-in commands. I find this is useful for editing over SSH or editing a remark made during a code check-in. A version of this is purportedly what Linus programs in.

I tried it once and hated it. Emacs and Vim seem to follow the general linux philosophy of extremely powerful but you're on your own to figure it out. Being powerful is useless if it's extremely difficult to use or provides little help. Even the man page isn't helpful since it tries to show everything emacs or vim can do at once. They assume that everyone referencing a man page is already an intermediate user vs a beginner.

When I want to do very basic Linux command line editing (usually when I'm SSHing into a box), I use nano, simply because of its simplicity and helpful docs. Vim at least brings you to a blank screen with everything hidden behind control sequences. nano on the other hand right up front tells me what I can do. However, rarely do I go into nano

For any editing of substance (I'm talking about more than a very small config file), I use Notepad++ and SFTP. The existence of SFTP means that all the arguments of "Well what about when you SSH into a box?" are worthless. With Notepad++ I get a real interface with real buttons and real usability. I don't have to consult archaic man pages to figure out how to save a file, I know that since I'm on windows I go to File > Save just like every other Windows program.

Emacs and Vim do the one thing that makes me go elsewhere: They get in the way of me working. When every a program gets in the way of me accomplishing work, I go somewhere else. Even nano with its on screen help gets in the way since I lack a powerful editor.

For what it's worth, both Emacs and Vim have built-in tutorials.
–
Larry ColemanJun 24 '11 at 20:33

2

'I tried it once and hated it.' I stopped reading once I seen the word once..
–
Matt FreemanJun 26 '11 at 4:50

1

@TheLQ - Are you serious? I just googled "how to save in emacs" and the first result pretty much told me everything I'd need to edit in emacs. 10 seconds, tops.
–
BlackJackJul 4 '11 at 21:32

1

@TheLQ It's 2013, and you're using tools that cause you problems Emacs solved before you were born. Your loss, and of course, when I was 20 years old, I knew I knew everything, too.
–
Aaron MillerAug 2 '13 at 18:57

One of basic rules of usability is consistency. This includes consistency with other software. Modern software shares same or at least similar keyboard bindings, similar look & feel etc. Emacs does not. It's completely different, thus for any one used only to modern software, it's usability nightmare.

Programs that are used intensively by people can have different look&feel without problems. Programmers use text editors intensively. I wouldn't recommend vim for casual use, or to somebody who doesn't need a text editor for heavy use on a daily basis.
–
David ThornleyJun 24 '11 at 14:48

1

@Larry: Actually, I consider vi more esoteric, due to having two modes (edit and insert). With emacs, you move around using control- commands and type text whenever you like, and this is similar to other word processors and editors in principle.
–
David ThornleyJun 24 '11 at 15:10

you had a poor teacher or didn't put any effort into the man pages, CUA mode ( CTRL-X,C,V ) is available in emacs with a single command to turn it on. Learning CTRL-w, META-w and CTRL-y isn't that big of a leap over the CUA mode.
–
Jarrod RobersonJun 24 '11 at 15:38

3

I have the opposite problem. After 20+ years of using X where one just highlights & middle clicks, I get really annoyed when I have to actually type ctrl-c/ctrl-v or the equivalent.
–
geoffjentryJun 24 '11 at 17:12

I'm a crabby middle-aged programmer and I still have emacs up on my workstation all day long. Mostly, I just use it for org-mode and the occasional intelligent mass edit via macro or sophisticated regexp.

For real code, I use the IDE of choice: Visual Studio for .NET, Eclipse for Java. Emacs just hasn't kept up there. If I get back into Haskell or Python or something, it'll be emacs again, because, frankly, the more-recent editors just don't cut it when it comes to envelope-pushing time. They're fine for copy-and-paste programmers, though. :)

I just took a class from some young hotshot who was a heavy vim/autohotkey user. Did my heart good to see a young whippersnapper who didn't have to constantly go to the mouse.

A lot of the young developers I work with are addicted to cut-and-paste, which isn't seamless on vim (don't know about emacs). They also seem to prefer using the mouse to the keyboard for moving around in a file. The ones who have seen me use vim are either really impressed (if I do something like a global substitution using a regex and backreferences) or totally disinterested (if I just change or add a few lines). I think it's just too much of a paradigm shift for most of them, and since they don't know what they're missing, there's no real incentive for them to invest the time learning.

Cut-and-paste coding is a confirming sign of coder immaturity, so it's not surprising such people use the mouse over the keyboard. Worst of all is the lack of curiosity re. a different (and better) way to do things.
–
limistJun 24 '11 at 17:44

3

@limist, how so (the immaturity thing)? Before I had autocomplete I would copy names of long variables or function calls, comment headers, etc... I do like my fingers never having to leave the keyboard on vi and I will use it to do quick edits of files -my first year of programming was with vi, but I use IDEs for long coding sessions.
–
ChanceJun 24 '11 at 19:38

IMHO VI is the second worst editor ever made. Everything is obscure control sequences. No menus, no help, no function keys, no explanations. Press Ctrl+ something and you can do great; press Ctrl+ something else and you've just blown a day's work.

But VI is not as bad as emacs. Emacs is VI with macros. Which means that not only are you dealing with mysterious obscure Ctrl sequences, but the guy who runs that particular computer may have redefined them to something else entirely. VI is bad but in theory predictable; emacs isn't even in theory predictable.

Of coure, all this is based on Unix twenty years ago. As long as there is ANY other text editor available, I will not touch either of them.

Dunno how "obscure" the commands are: ^U scrolls up, ^D scrolls down, ^F goes forward a page, ^B goes back a page, 42G goes to line 42. And I find it a lot quicker to (say) change an if condition by typing f( ct)!done<ESC> (find the first left-paren, move to the first character after it, change everything up to the next right-paren to "!done") than moving my hand to the mouse, highlighting part of a line, going back to the keyboard and then typing in the replacement text. Maybe that's just me...
–
TMNJun 24 '11 at 14:00

1

Ah, Andy Canfield has clearly not used many of the editors I have. Coming from where I was in the late 80s, emacs and vi (no vim yet) were revelations.
–
David ThornleyJun 24 '11 at 14:50

5

git checkout <filename> reverts the "days work" that gets lost, you are using version control aren't you?
–
Jarrod RobersonJun 24 '11 at 15:56

2

@TMN: Using letter mnemonics for navigation is horribly obscure when you have a modern keyboard available with arrow keys, Home, End, Page Up and Page Down available.
–
Mason WheelerJun 24 '11 at 20:34

I'm 31, not the new new generation, but still pretty new. Back in 2002 when I was an undergrad, only an elite few used vim or emacs in the computer labs. Most just opened up source files in notepad or some other editor (the college network mapped the unix home directories to a windows drive), made changes, and compiled. Even among the very few who used vi/emacs most tended to just know how to save/insert. Even at work when I see people use vi, most seem to use it to make a few quick changes and then escape/:w or something. At school I don't believe I ever saw a vi wizard, but I did see a few emacs wizards who really knew what they were doing.

I recently interviewed for a job and while there I had lunch with some potential co-workers and an intern. They were all emacs users except for the intern who swore by vim. He was going on and on about it and so excited. He really loved the keyboard shortcuts and claimed that there were some shortcuts in Vim that emacs did not have. Of course the other guys claimed that with emacs they could make whatever they want using LISP and started and mini-war... But overall this kid who was probably 20 or 21 was super enthralled with vim. I would say he is one of those who will carry VIM along through time....

In the masters program that I just finished people were allowed to make their programs wherever they wanted. Many were just using their own windows computers and Java/Visual Studio with their choice of windows editors. The majority of my peers were in their mid 20's I'd say. With a few older people like me in their late 20's and beyond. I did not meet anyone who was a vim/emacs expert. Most seemed to use pico/nano or one of the x editors for editing on the server. But again unix directories are mapped as windows drives. And for those using their own windows laptops, the terminal does not even enter into the issue.... (I have also seen more TextMate and Macs....)

Ultimately I tried both vi and emacs and I just don't like either. Emacs hurts my fingers (although on a normal keyboard it looks like the trick for control is to roll your wrist...on a laptop that doesn't work because of the keyboard), and vim/vi just are too different. The modal editing thing is clever, but escape is pretty far away from the other keys and often I am thinking about the code and forget to switch modes. Nevertheless vi is much easier on my fingers. Emacs seemed more natural but still many of the key sequences are non-intuitive. Pico/Nano/Joe/Jed are a bit closer to the editing style that DOS/Windows have accustomed me to. Moving the cursor with arrow keys and WYSIWYG editing.

Don't Think So

It's all a matter of personal preference per developer.
I use a bit of Emacs and Notepad++ depending on what I'm working on,
but with all the new mobile development I guess IDEs would be used in favour.

Does anyone know or work for software companies that solely use Emacs or tend to point people in that direction?

I'm 26 years old, a .NET career programmer, and I use the right tool for the job. With .NET, that means Visual Studio. With a lot of other code or text, that means emacs. (Not to disparage on VIM, everyone has their favorite power text editor, and emacs is mine.)

There's just nothing to top it for so many cases. If I'm learning a new language that doesn't have mature tools yet: emacs. If I need to edit XML or edit a data file or regex search a big log file: emacs. When I need to organize my thoughts, my notes, and my tasks: emacs.

It took me a while to learn the basics and get used to mentally switching between "emacs mode" and "other editors mode" but now that I can, I'm happy I learned to use it. It's especially gratifying in those moments when I don't like how emacs works, so I go remap keys, or write some lisp code to change how things work or add new functionality. And now I have a tool for life, a powerful editor that I know will be there, will be useful to me, and will be on any platform I move to. I just bought a Macbook (my first Apple computer) and emacs was the very first thing I installed on it, and I was right at home.

a programmers text editor with a strong focus on keyboard control. Vico uses vi key bindings to let you keep your fingers on the home row and work effectively with your text.

Vico comes with support for the most common languages, such as html, php, ruby and javascript. And since Vico can use existing TextMate bundles, it's easy to add more.

Vico also features integrated SFTP for working with remote files, split views to let you edit files side-by-side and a file explorer for fast project navigation.

Quickly navigate between files using fuzzy find, or open files directly from the ex command line with tab completion. Jumping to symbols is easy with the symbol list, or use ctags to find the definition under the cursor. Ctags even works remotely over SFTP.