Ask HN: What code editor do you use?

43 points by eob ↗ HN
I've been using TextMate for a few years now, but recently have been doing a lot of work in projects that have either 1) a lot of files or 2) really big files. Both of these situations cause TextMate to crawl to a halt.

I've used Emacs in the past, but something about the way in which you can navigate code just makes me feel less than efficient in it. Maybe I didn't take enough time to memorize all the required shortcuts. Mastering an editor that can be used over an ssh session certainly seems a plus.

So a question to all the coders out there: what editor do you use? Why did you choose it? What are the downsides?

142 comments

[ 4.3 ms ] story [ 222 ms ] thread
Oy, a holy war is about to happen.

I'll open the Emacs lobby with http://sites.google.com/site/steveyegge2/effective-emacs and http://sites.google.com/site/steveyegge2/the-emacs-problem

To give the illusion of fairness, here is a blogpost in which I praise Vim: http://zipwith.blogspot.com/2010/05/power-of-vim.html

Thanks for the links. I don't mean to start a holy war, though they are fun :) I'm looking more for a reasoned discussion of the pros and cons of different editing environments.
> though they are fun

not the fifty thousandth time.

Boring for people who've already had the debate a hundred times, I agree, but I think it's not totally bad that some kinds of debates recur, as new people who haven't really participated in the debate before arrive somewhere. There's a sense in which debating an issue yourself, against someone else who's genuinely debating it, gets to understanding in a different way than just reading a writeup of a debate some other people had ten years ago.
I somewhat suspect I'll be unique on this one here. I use nano full-time.

I use it because it is simple, it gets the job done, and I don't find that I need anything more.

It's true it's missing a couple of features commonly found in code editors. But when I start thinking code folding would be useful, I take it as a sign that this file is getting too large and would be better split. Nano also obeys the simple UI principle of having a non-modal interface. I haven't used an editor with bells and whistles for some years, and I'm liking it.

Also contrary to popular belief, nano does support syntax highlighting - this just isn't enabled by default in most distros.

Now, laugh.

Now, laugh

Well, I'll admit that was... unexpected, but I am certainly not going to laugh. After all, the best code editor is the one you feel most productive in, and you seem to have a rational explanation for it so sure, knock yourself out :-)

I actually used Nano for a long time as well! I'd been using Pine since 1994 so it always felt quite natural.

If Vim wasn't always available when Nano was, I'd still use it. ;^)

Notepad++ because it's relatively simple and gets the job done. I like unbloated minimalism.
I use Notepad++ as well most of the time for this exact reason. It's minimalist enough but still has useful features such as colouring keywords which I miss when I use just notepad.
Sublime Text. It has the minimap. It has multiple cursors. It has macros. It has plugins. It has color schemes. It's simple. It's beautiful. It's actively developed. It's affordable.

Downsides? It's Windows only.

http://www.sublimetext.com/features

This looks like a great editor. It's proprietary, though. Damn.

Why is it that, as with Opera, every now and then you find an amazing program which, even more amazingly, is closed-source?

Emacs, however, offers minimap as well: http://www.emacswiki.org/emacs/MiniMap

I wonder how well we did compared to Sublime.

These days, I'm actually more amazed when I find an amazing desktop program which is open-source. Maybe it's just because opinionated software appeals to me.
Open source software has a hard time being opinionated.
a) Fosdev ;) b) because I'm part of the team developing it, and it takes care of a lot of setup stuff, etc. c) plenty (almost everything) as it's a new, fresh product/project

I'd love to hear more about how the projects have 1) a lot of files or 2) really big files... and how you navigate around the proj. should the really big files be broken into smaller files? etc...

Dare I say Coda? Um, I guess I just did...
I use kwrite, unless I'm at a console, in which case I use nano.

Easy to use, and no holy wars.

Textmate on the mac, sublime text and scite on the PC, eclipse for Java
Ye can gain mine Emacs when ye wrest it from mine chill, mortified fingers.

    O ye'll tak' the high road and I'll tak' the low road  
    And I'll be a editin afore ye  
    For me and my emacsen will ne'er wont to gae  
    On the Vim Vimmy scriptin o' productivitin'
Emacs be an organism. It be runnin' all the while. On the other hand, I'll admit to using vi from eshell.
(comment deleted)
Komodo Edit works well on all platforms and support 'scp' for file access.
Komodo Edit (Mac) with the Vim bindings turned on. It's lightweight with some advanced features like code completion and basic project management (find & replace in project, etc).
I finally settled on Komodo as well.
I got Komodo IDE but it was way too slow on Mac. Not sure why. I switched over to Netbeans 6.9.
After a long stint with Vim (and a brief one with eclipse), I too have been using Komodo Edit.

The vim bindings are good. The app is OS X is fine. (Though I had to hack the source to make the "Go To file" not look in the history, which was bothering me with my many branches). Also removed anti-aliasing, which is awful for code IMHO.

It crashes from time to time, but I think it's the best all around choice right now for good vi bindings, sensible auto-completion, multi-language support, etc.

Plus I like that it's cross-browser and open source, in case I ever want to leave OS X for something better.

eclipse. Why? Default for java. Some pluses... nice plugin based architecture, stable code. Autocomplete, refactoring, source code generation, etc. are not optional things when you're trying to do too much all the time. It's nice working in something that is pretty standard and offers you the ability to share styles etc.

Downsides.. IDE-ification of development. Slow startup time (wants SSD hybrid drive for this). Synchronizing plugin versions can be a pain in the ass. Fairly steep learning curve to advanced features.

I use netbeans because it is on parity of sucking as bad as zend studio but it is free. I really like the "intellisense" as i went from C# asp.net stuff to php

i really want to give jetbrains my money but they haven't put out anything for me...yet :)

IntelliJ IDEA for clojure and groovy. TextMate for everything else.
IDEA is also the best Scala IDE IMHO.
jEdit is my third arm. Hypersearch is amazing and the beanshell rules.
vi, Xcode, Xemacs, Eclipse, textedit. That's a good start. Depends on what is handy. emacs wins for super-large files (>1GB).
Other than logs, do you handle text files > 1GB?
Not logs. The gate-level EDIF of a full chip can be pretty big... Sometimes you need to check out exactly how two logic gates were generated by synthesis.
At work I use various flavors of Visual Studio (including VS.NET 2003 on Windows 7 http://technikhil.wordpress.com/2010/01/12/visual-studio-200...). For any quick editing and especially text manipulation it's notepad++ or emacs. I am trying to learn emacs but I am still not completely there yet - I use it for text editing mostly with some python editing.
SlickEdit has been a long time friend.
> I've used Emacs in the past, but something about the way in which you can navigate code just makes me feel less than efficient in it.

Have you ever tried IDO, http://www.emacswiki.org/emacs/InteractivelyDoThings?

Indeed. I don't even have to think about files anymore, thanks to eproject. If I want to edit my module Foo::Bar, I just say visit-project-file (C-c C-f), type in ::Ba or some other convenient substring, and hit enter. Now I'm there.

And that's the worst case. If I want to see the definition of some function that the point is currently near, I just press M-. to visit it. And M-* to pop back to where I was before.

recently gedit is my favourite. Really fast and easy to setup. Also to move my settings from one computer to another I just need to copy 1 folder and install one package. That, in combination with command line is very powerful for me.

I used to use different editor for every language but I am getting more and more comfy with gedit.

I've noticed that gedit is a little sluggish to start and somewhat buggy. All that same it's a great editor.
I used to use jEdit, which is still a very nice editor. And it ran on Mac/Unix/Windows, which was good because I moved among all three systems. But the last I looked (three or four years ago) development had stalled. And I got into a job where I periodically had to SSH to various Solaris boxes and edit on the console, in Vim. I knew just enough Vim to edit config files and simple shell scripts without too much pain. Then I'd come back out to jEdit and start putting :s and other Vim commands in my files. It was hard to shift gears.

So I decided to pick an editor that I could stay with for a long time, maybe forever, because it did so many things and was so configurable. It had to run on my Mac at home, the Windows nd Unix machines at work, and also on the console. It came down to Emacs or Vim. My boss was an Emacs guy, and could do wonderful things with it. But I'd had a few RSS problems, and I'd read about what Emacs did to some users' hands. So I went with Vim, and I'm very happy with it.

Really, the only downside is that I don't have Vim everywhere, so when I'm stuck somewhere that doesn't have it my hands do the wrong thing. (Like in our crappy email system. I write long messages in Vim and paste them in, but I do short ones in the mail client. And hit escape when I'm done. And then hit cancel to say that I'm not abandoning the message.)

As far as I know, the only editor more configurable than Vim is Emacs. But Vim does do a lot. I use it for Ruby, shell scripts, HTML, CSS, XML, Perl, prose, looking around in log files, and more. It handles long files easily. You can script it with its built-in language (not as powerful as ELisp, of course) or other scripting languages.

I sometimes meet people who don't know the difference between Vi and Vim. When I say I use Vim they ask how I can get by with such a limited editor that won't split windows and doesn't have tabs and so on. So when I say Vim, I mean Vim 7.2, available at vim.org.

But Emacs and other tools are worth getting familiar with as well. It's good to not be too provincial.

I couldn't ever give up vi key-bindings but I liked the rest of emacs more, so I use emacs in viper-mode (comes built-in), which emulates vi. You can use emacs as a modal editor but still fall back on all the emacs functionality.

For most of the time it works like the best of both worlds, but it's not perfect . You can't use viper-mode in every mode and it's obviously not full vi(m) emulation. Installing the vimpulse.el script (google it) adds a lot of missing vim functionality though.

I accidentally used Vim the other day. I noticed Vim now has Emacs keybindings -- C-n goes to the next line, C-p goes to the previous line, etc. For a second, I thought that C-x C-s was going to save my file and I was going to be able to exit with C-x C-c. Nope. I had to make the journey over to the ESC key. So close...
You can use ZZ to save and close a document in Vim :)
I thought that sequence showed me an interactive listing of processes.
I think you're supposed to map Caps to be an ESC key in vim, just like most people who use emacs map it to be an extra Ctrl.
No, you map it to Ctrl, and use Ctrl-[ instead of Esc.
Can't you just use ctrl-c?
I find it easier to hit ctrl-[, but yeah, ctrl-c does the same thing.
depends where that C is I guess, the Sholes (qwerty) placement of the [ might strain ones pinky! There is something satisfying about banging the escape key hard.
I have jj mapped to Esc in insert mode. If you type it quickly, the two j characters vanish and you escape out of insert mode. If you type them slowly, or preface them with ^v, you get two j characters in your text. I rarely need two j's in my text, of course, so it's a good escape key sequence, but pick whatever you want. I chose jj because it keeps me on home row.
I have used both Emacs and Vim extensively. Personally, I find Vim groks the idea of text manipulation much better. The key binding scheme/system actually feels like something that you can build upon, bindings string together nicely.

It's also just much lighter and goes with my preference of using the simplest tool that does the job.

I use http://www.e-texteditor.com/ on Windows. It's a clone of Textmate, supporting its bundles and all that; works very, very well.
(comment deleted)
big fan of e text editor. I have been desperately trying to compile the new source code releases for ubuntu but not too successful. (Not to familiar with linux programming/building). It works on wine though.
Does it work seamlessly through wine? I've been missing textmate snippets lately but it's frustrating to work around little problems?
I didn't use it for a long time. It works, but it still needs cygwin to be install for some snippets. That's a little ironic. installing cygwin on wine.. but I guess that's the only way to get a text-mate like editor on linux.

Or you could try something called Red Car Editor (http://redcareditor.com) which proclaims to be an editor specially made for ruby/rails programmers. It looks pretty impressive, but again I couldn't get it installed properly. (I think the latest version runs on jRuby platform)

EDIT: I got inspired to try Red Car again after posting this comment. Uninstalled Ruby completely from Windows 7, installed jRUby 1.5. Red car gem installation went perfectly, but the editor is shockingly slow and unresponsive. I don't know if the same applies to linux platform, or if there is something wrong with my system (its a 2 year old laptop, and its been a long while since I have reinstalled the Windows OS)