Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Every time you are looking for a text editor, no matter what language you are using, vi and Emacs are hall-of-famers.

However they are ancient, and we have better alternatives (at least I hope we do).

Why are developers stuck on these two editors? Shouldn't we drop them and try to invent or look for something new?

(I have full respect for Emacs and vi fans).

share|improve this question

marked as duplicate by gnat, Jimmy Hoffa, Giorgio, Martijn Pieters, MichaelT Apr 18 '13 at 2:10

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

14  
Actually I prefer Vi, I can't stand Emacs :) –  Chiron Mar 25 '11 at 1:14
22  
Obligatory XKCD reference: xkcd.com/378 –  Michael McGowan Mar 25 '11 at 1:37
23  
The list of alternatives is tellingly absent. :) –  dietbuddha Mar 25 '11 at 4:46
19  
just another "new is better by definition" example... so wrong, as always. –  jwenting Mar 25 '11 at 5:55
19  
and we have better alternatives (at least I hope we do). If we do, I am not aware of them. –  Nemanja Trifunovic Mar 25 '11 at 12:47

20 Answers 20

Right now, I'm finding myself working half the time in, of all things, nano, simply because it's the tool that fits the job - editing small scripts on the commandline over ssh. Using Eclipse for that would be like a waiter using a turbo-powered infomercial-style slice-dice-chop-and-blend food processor to grind pepper over my salad.

share|improve this answer

I'd rather eat my own hands than use either one of them. I loved Visual Studio when I was doing C++. Eclipse is meh. IntelliJ IDEA is excellent. I used to love JBuilder too, but I haven't used it for years.

share|improve this answer
1  
hmmmm, finger food :) –  dietbuddha Apr 10 '11 at 23:24

Many (most?) of the best programmers I know despise IDEs and rely solely on Emacs. I am not quite so diehard, and use both Eclipse and Emacs, but there are a couple of reasons I prefer using Emacs:

  • Consistent experience with ANY language - Support in Eclipse for some of the newer languages (Scala, Clojure, etc.) is inconsistent at best, and subpar at worst. The plugin authors are hard at work improving the experience, but I often run into little things that feel janky. Sure you can always switch to another IDE which has better support for that particular language, but now you are juggling IDEs. I've never felt this way while working in Emacs.

  • I dislike IDE "magic" - IDEs tend to do a lot of stuff automatically in the name of convenience. This is great...until something breaks. Then it can be a frustrating or even infuriating process getting things back on track.

I've been toying with the idea of switching to Redcar editor. It's extensible like Emacs, but instead of Emacs Lisp you use JRuby. It's lightweight, and definitely not a full blown IDE. If you are into TextMate, it's compatible with TextMate bundles, but it has the benefits of being free and open source. Definitely a tool worth checking out, especially for Ruby developers.

share|improve this answer

Others editors with a similarly rich heritage (and controversy) have been invented, and maybe it's just a matter of time before we switch from tools first written in the 1970s (vi/Emacs) to one from the 1980s (Sam) or even one from the 1990s (Acme).

"Sam is the preferred text editor of many eminent computer scientists; it replaced ed as Ken Thompson's favorite text editor, and he still uses it to this day. Sam is the text editor used by Bjarne Stroustrup and Brian Kernighan. Others, like Dennis Ritchie, have moved on to use Acme instead." Here's the Sam article from Wikipedia.

But what do I know, I'm still using Vim.

share|improve this answer

The main reasons why I prefer a terminal-based editor over a full-fledged IDE:

  • Remote access. I can ssh to whatever computer I need to be on, fire up Vim and start working away. In a day-to-day basis, using screen session and Vim allows for easy access from any location.
  • Keystrokes. There are so many keystrokes saved once you can utilise Emacs or Vim to a decent extent. Moving my hand between the keyboard and mouse annoys me...

IDEs are nice to throw classes around within your project, but for me, my productivity is orders of magnitudes higher using Vim.

share|improve this answer
5  
+1 forgot about remote access, and I use that every day. –  Jeff Mar 25 '11 at 1:19
4  
I know of a number of GUI editors that can remote-access files via ssh (scp, sftp), with the UI running locally. –  geekosaur Mar 25 '11 at 1:20
5  
I wonder if the amount of time saved by learning the keyboard layout make up for the massive amount of time it takes to get used to such a weird scheme? That is the #1 thing that turned me off to VI. Tools are supposed to make me more productive, not force me to learn some strange keyboard layout so that I can be slightly more efficient 6 months to a year down the road. –  Ed S. Mar 25 '11 at 1:48
2  
That said, I have seen some VI wizards do some amazing things, I just don't have the time or need to become proficient at it. –  Ed S. Mar 25 '11 at 3:01
34  
@Ed S., how long do you plan to be a programmer? I learned VI 30 years ago. Believe me it's paid off (though of course these days I use VIM). –  Charles E. Grant Mar 25 '11 at 3:16

Am I the only person who still uses ed occasionally?

(And for those folks who think code bloat is relevant ...

$ size /bin/ed 
   text    data     bss     dec     hex filename
  42160    2300       0   44460    adac /bin/ed
$ size /bin/vi
   text    data     bss     dec     hex filename
 692378   27796   13884  734058   b336a /bin/vi
$ size /usr/bin/emacs
   text    data     bss     dec     hex filename
2033257 4692020       0 6725277  669e9d /usr/bin/emacs

)


Another advantage of ed is that you can run it on a teletype ... or the dumbest of dumb terminals.

share|improve this answer
6  
Only person? Probably not. Only person doing so voluntarily, probably so. –  user1249 Apr 10 '11 at 21:18
2  
When I use an editor, I don't want eight extra KILOBYTES of worthless help screens and cursor positioning code! I just want an EDitor!! Not a “viitor”. Not a “emacsitor”. Those aren't even WORDS!!!! ED! ED! ED IS THE STANDARD!!! - gnu.org/fun/jokes/ed.msg.html –  user1249 Apr 10 '11 at 21:19

My IDE of choice is Linux. Heck, it can run other IDEs, serve websites, execute programs in a variety of languages, and by combining stuff (the pipe) it can run programs together that were written in different languages as though they were one. That thing is awesome. Oh, and it can connect to the internet and do all sorts of interesting things with it too, including spawning other versions of itself. Coolio!

Don't settle for an IDE when you already have linux.

share|improve this answer
1  
vi is fine. it's a text editor. –  Christopher Mahan Apr 11 '11 at 15:49

shouldn't we drop them and trying to invent or looking for something new?

The full answer:

A UNIX wizard hears cries of torment from his apprentice's computer room where the apprentice is studying, and goes to investigate.

He finds the apprentice in obvious distress, nearly on the verge of tears. "What's the problem?" he asks. "Why did you cry out?"

"It's terrible using this system. I must use four editors each day to get my studies done, because not one of them does everything."

The wizard nods sagely, and asks, "And what would you propose that will solve this obvious dilemma?"

The student thinks carefully for several minutes, and his face then lights up in delight. Excitedly, he says, "Well, it's obvious. I will write the best editor ever. It will do everything that the existing four editors do, but do their jobs better, and faster. And because of my new editor, the world will be a better place."

The wizard quickly raises his hand and smacks the apprentice on the side of his head. The wizard is old and frail, and the apprentice isn't physically hurt, but is shocked by what has happened. He turns his head to face the wizard. "What have I done wrong?" he asks.

"Fool!" says the wizard. "Do you think I want to learn yet another editor?"

Immediately, the apprentice is enlightened. http://neugierig.org/content/unix/

tl;dr version: Many people don't want to learn a new editor

share|improve this answer
1  
I don't think it is nice to copy and paste just like that from other people's website... So I add a tl;dr version instead. –  Hery Mar 25 '11 at 7:28
1  
It would appear that the apprentice went on to write emacs. vi instead made it more convenient to interact with the other tools. –  intuited Apr 10 '11 at 21:28
1  
That anecdote is same as the propagation idea behind the "Standards" comic strip in XKCD, but switch standards with text editors. –  Spoike Nov 9 '12 at 14:02

I supposed I am an odd duck, but I actually use different editors, depending on the situation.

Vim:

When I am connected (ssh'd) onto a distant server (for example looking at the logs) and I want to quickly edit a file and make some tweak. Much faster than navigating to the same folder (SAN hosted) from my local desktop.

Notepad++:

About the same situation: for a quick edit, but this time when I just don't want to wait for Eclipse (corporate IDE) to load.

Eclipse:

It's the corporate IDE where I work. We have some in-house plugins to be able to launch the build from Eclipse on a remote machine directly... and most importantly a plugin to locate the libraries produced by other teams and that we're working with (and replicate the headers in local for fast indexing). Since I am talking a good thousands of libraries... it's really useful ;)

OpenGrok / Doxygen:

More code browsing than edition proper, but still very useful! My browser is configured to navigate, so it's put to good use here.

As a conclusion: I just tend to use whatever editor allows me to accomplish the task with relative ease and decent speed.

share|improve this answer
1  
+1 For different editors depending on the situation. I'm pretty much the same. –  Spoike Nov 9 '12 at 14:05

Are there better alternatives? Just the other day I had a list of schema names that I had to shorten (thanks, Oracle!). At least half of them ended in the word "Test". I decided to drop the "Test" from the end and prefix the name with "T". In vi, this was a simple regex search-and-replace, are there any recent editors that can do this?

share|improve this answer
1  
Emacs has a search-and-replace with regex, you know. –  Miles Rout Apr 30 at 11:07

In the course of some 40 years in computing, as student and professional, I have used at least fifteen (15) different editors and IDEs. Of all of them, emacs was by far the best, then and now.

First, I spend too much time bouncing around among multiple files and multiple places inside individual files to have a good experience with any editor that refuses to let me see more than one file at time, or more than two at one time. Emacs is the only editor or IDE I have seen that lets me see everything I need at once. (Some years back, while exploring a legacy system, I routinely had eight (8) panes open in an emacs window. Even today, I routinely have three or four panes open, and sometimes I will have two or three invocations of emacs open, because I need multiple shells, and I need to copy and paste results among them.)

Second, I'm still only human, and I do occasionally make mistakes. Every other editor I have ever used was perfectly happy to let me shoot my foot off, WITHOUT WARNING, with no ability to recover, leaving me wanting to commit unspeakably vile, violent acts against the author of said GDPOS. (The ones that got me weren't QUITE as bad as the crock that almost got Charles Simonyi lynched while he was at Xerox PARC, before he went to Microsoft and inflicted Hungarian notation on the world - an act for which lynching is entirely too soft a punishment.) Emacs has never done this to me; it has never irrevocably destroyed anything without giving me a BIG warning. Back when I was still new to emacs, I would occasionally go "What just happened?", and I invariably figured out what I'd done in a few seconds, and knew how to repair it just as quickly.

There is no such thing as an editor that actually ENHANCES productivity. The best you can get is minimal degradation of productivity. The metric, for me, is "How bad does this thing slow me down?" Compared to emacs, on the kinds of things I normally do, everything else is far worse.

My ONLY gripe with emacs was that it was not available for Oberon, when I was playing with Oberon quite a few years ago.

share|improve this answer

I think the IDE's (Visual Studio, Eclipse, IntelliJ) are fit to solve another class of problems than the ones you solve with emacs / Vim.

When you have a large platform to code on, with lots of libraries and high integration between all elements (sounds like Microsoft), an IDE will prove it's worth. Some will refer to this as "sticking libraries together" and don't suppose it to be "real code". It will help you greatly though when catching errors early (in a way even Emacs can't).

When you develop end-user applications for (say) Android, you can actually do it without Eclipse. However, with all sorts of files that need to be added before deploying, Eclipse will help you a great deal by automating those tasks for you.

So if you're an application developer working on only one platform with lots of libraries (developing Enterprise-class applications in Java EE, .NET etc.) an IDE will be an "improvement" in your workflow. However, as soon as you have to work regularly in a terminal environment (on Unix-servers, for example) or you're using lots of different languages, No IDE can measure against the qualities Vim / emacs.

One last thing is that working using Vim / emacs forces you to understand at least a bit of a platform / language before using it. Many IDEs allow you to operate in a language without knowing what's going on; so using Vim / emacs will force yourself to gain some insight in what you're really doing.

share|improve this answer
7  
I've always considered IDEs to be more of a build environment than a development environment. –  TMN Mar 25 '11 at 17:25

"Better" is a subjective word. If i am happy and productive using a text editor, who is X or Y or Z to say "drop it and use something else"? If it is a corporate policy or such that makes it a can't-but situation then we have no choice though.

share|improve this answer

I'm a Vim user.

I have to use IDEs due to the projects that I'm working on, you can't circumvent that sometimes. I'm quite proficient at using Code::Blocks and Eclipse, however, whenever possible, I like the user interface of said IDEs to work like the one from Vim.

I have my own color scheme for Vim and I want the text editors of other IDEs to work in exactly the same way.

I'd wish for an IDE, that's missing the text editor, and where I can plug-in the editor I want. Wouldn't it be nice, If I could plug in my standard Vim into Emacs or Code::Blocks, but having the rest of the IDE around it?

It somehow escaped the scope of IDE developers, but I secretly wish for it almost always, when either I'm using only Vim and Makefiles for larger projects, or an IDE and its cumbersome text editor.

share|improve this answer

Aside from a little bit of BASIC as a kid, I learned programming on Unix. The Unix philosophy is to have many smaller tools that interoperate, but that each focus on doing one job and doing it well. Hence, it feels natural to me to have separate software for editing, compiling, source control, and debugging. Interestingly, IDEs are "integrated," but you still can't fit all that functionality into one window all at once, so you end up with things like perspectives, where you are essentially switching modes between those different tasks anyway, albeit with some overlap.

I could turn it around and ask why people tolerate painfully slow non-vim editing. The best way I can describe the feeling of watching someone edit code that way is that it feels like when you get stuck behind a car going 10 mph too slow because he's on the phone, or like watching a relatively fast hunt-and-peck typist. They're going fast enough to get the job done, but at the same time slow enough to be maddening.

A lot of people say they spend most of their time thinking anyway, so a little bit faster editing doesn't make much difference. In that case, typing is an interruption, and a few extra seconds of editing can make the difference between keeping your train of thought or having to regain it. Also, if you're a long-time touch typist, you know that your fingers type common words without you even consciously thinking which keys to hit. When you're a long-time vim user, that kind of fluidity comes for things like moving lines and words around. In the time it takes to say "delete" in "delete those 2 lines" my fingers have already done it and my concentration is completely unbroken.

Vim is also extremely customizable, and your installed plugins and vimrc evolve as your work evolves. When something starts getting in your way, you look up a better way to do it, and incorporate that into your configuration or commonly used commands. I learned vi in 1993, and still make customizations when my needs change. Just this week I changed my tab filename completion to work more like bash's, because my workflow changed to do a lot more of that recently and the default behavior was getting on my nerves.

Also, I disagree about it not being worth the time to learn. It took way longer for me to learn to touch type than to feel productive in vi, for a similar boost in code editing speed, but you don't see programmers complaining about how long it took to learn to touch type. And you can learn at your own speed and add new commands to your repertoire as you have the inclination. If you start out with set im in your vimrc (stands for insertmode, but I affectionately call it idiotmode for when a colleague needs to type at my desk), you might not even realize you're using vim at all!

share|improve this answer
1  
+1 I learned emacs back in 1991 - my alternative at the time was the Sunos Notepad. Yuck. I vowed to give myself 1/2 day to learn the basics of emacs and if I could not pick it up in that I would give it up. Well, 20 years later I'm still using emacs, and like you I have slowly gathered a list of tailorings and cusomisings - but only when something irritates me. I can do things FAST in emacs. I use IDEs as well, and thins like not having multiple source files open alonside each other, or split file panes drives me crazy! –  quickly_now Mar 25 '11 at 6:11

I use Emacs as my primary editor. The only other editors I ever considered seriously were vim and TextMate. IDEs (and I tried a few including Eclipse) have not had the features I needed.

I actually had this conversation with a coworker of mine not to long ago. He was telling me how much better IDE are while he was using his mouse to click a bunch of buttons and menus. That just made me laugh.

I'll try out any editor with the following capabilities (all of which are critical the way I develop).

  • all commands can be executed by customizable key-bindings
  • allows remote editing with ssh (yes Emacs has remote editing)
  • allows on the fly macro creation and reuse
  • tightly integrated programming language
  • code and execute using the programming language on the fly
  • tight integration with GBD and family
  • multi-language syntax highlighting in the same buffer
  • autocompletion of keywords, variables, functions, etc

I also tend to do meta programming which often renders auto-refactor tools useless; the one area I think IDEs do tend be good at.

share|improve this answer

I stick to vi because it was the first editor I learned in school and it is the one that I'm the most productive with today. I work with a lot of unix variants and it is available on all of them (and it works the same way regardless of environment). It does what I need it to do, so why change for the sake of changing.

I do use an IDE for my java work (now Intellij Idea), but I spend a lot of my time using vi.

share|improve this answer

You assume they don't evolve. Emacs continues to grow by leaps and bounds; and, while vi was getting kind of hoary, Vim has rejuvenated it and if anything it's growing (feature-wise at least) faster than Emacs.

But when it comes down to it, it's what you work best with that matters. If you're most productive in Eclipse, more power to you. Same if you prefer Vim.

share|improve this answer
16  
+1 for pointing out they're still evolving –  Jeff Mar 25 '11 at 1:25
7  
@Thorbjørn: The core is fairly static, but it doesn't really need to change; when it comes down to it, Emacs is a core Elisp interpreter with interfaces to window systems and terminal environments, augmented by a huge number of libraries. (Take a look sometime at how much of basic Emacs is written in Elisp.) I see a fair number of Elisp packages extending its functionality appearing regularly, as well as updates to existing packages to e.g. add new refactoring mechanisms. (The same is going on with Vim.) –  geekosaur Mar 25 '11 at 6:28
2  
It is, BTW, a testament to the design of Emacs that most of the changes to the core are adding support for the latest new libraries for X11 etc.; Elisp is powerful enough already that most new features at that level can themselves be implemented in Elisp, rather than requiring changes to the core. –  geekosaur Mar 25 '11 at 6:37
2  
@Thorbjorn -- it doesn't have to be Lisp; it could be Ruby or Python or Javascript or ... I doubt that most Notepad users would care about redefining PgUp. I am thinking more of IDEs like Eclipse, where customization requires writing and compiling Java code. –  kevin cline Apr 11 '11 at 17:50
2  
@kevin, the major difference between Emacs and almost everything else is exactly that you can redefine PgUp, or Ctrl-X PgUp, or Mouse-2 PgUp to whatever you want. –  user1249 Apr 11 '11 at 20:08

Programmers are notorious for using the tools that helps them get the job done in the most efficient way possible. These editors are ancient yet still being used because they are good, solid editors, proven by time. If they get the job done and get the job done well, why should we drop them in favor of something else?

share|improve this answer
10  
+1 - programmers are terrible like that. Everyone knows that new things are always better. NOT! :-) –  Stephen C Mar 25 '11 at 7:07

Sometimes I'll be working on mostly bare systems, where the only installed editor is vi. For cases like those, it really helps to know at least basic vi commands.

vi and emacs are also very extendable, so much that they indeed can be full functioning IDEs with the right amount of plugins. For me, I can edit files much faster in vi, as I don't have to take my hands off of the keyboard to move a mouse around. It also has features that I haven't seen in some IDEs (although I admit I haven't looked much), like being able to edit columns of text, storing multiple "cut" words into multiple buffers for pasting, etc.

The editors take some time to learn, but they are also really powerful. And yes, they're not for everybody.

An interesting somewhat related read is Why should I use an IDE?

share|improve this answer

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