Ask HN: What code editor do you use?
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?
[+] [-] andrewl|16 years ago|reply
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.
[+] [-] johnswamps|16 years ago|reply
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.
[+] [-] kashif|16 years ago|reply
It's also just much lighter and goes with my preference of using the simplest tool that does the job.
[+] [-] jrockway|16 years ago|reply
[+] [-] roel_v|16 years ago|reply
[+] [-] MattJ100|16 years ago|reply
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.
[+] [-] frossie|16 years ago|reply
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 :-)
[+] [-] jsdalton|16 years ago|reply
Did not know this! FYI, a bit of googling uncovered the following: http://code.google.com/p/nanosyntax/source/browse/trunk/synt...
[+] [-] TrevorBramble|16 years ago|reply
If Vim wasn't always available when Nano was, I'd still use it. ;^)
[+] [-] pook|16 years ago|reply
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
[+] [-] eob|16 years ago|reply
[+] [-] jb55|16 years ago|reply
[+] [-] mapleoin|16 years ago|reply
Well anyway, it worked for me. I have no trouble switching between the 3 editing modes while I program, edit configs and write email (thunderbird for now).
[+] [-] Schmidt|16 years ago|reply
[+] [-] ivanzhao|16 years ago|reply
this makes me wondering the limit of human interfaces. how far can we transform into cyborgs through just "practicing"?
[+] [-] madrik|16 years ago|reply
[+] [-] WesleyJohnson|16 years ago|reply
Visual Studio 2010 at home and 2008 at work. We're primarily .NET so the two just kind of go hand in hand. I'm also spoiled by intellisense.
I also use Eclipse at work since we've been doing a lot with GWT on the client side (thought still using .NET on the backend).
Finally, I'll often use notepad++ for anything JavaScript simply because it takes far too long to load up VS when I want to do something small/edit a file/etc.
[+] [-] henrikschroder|16 years ago|reply
I used to run Resharper when I used Visual Studio 2005, but with 2008 there's much less need for it.
[+] [-] Vitaly|16 years ago|reply
[+] [-] eob|16 years ago|reply
[+] [-] weaksauce|16 years ago|reply
[+] [-] gurraman|16 years ago|reply
The only thing I do not like about vim is that auto-indentation and syntax highlighting feel a bit "shaky". I find many of the editors mentioned here more consistent in that regard.
[+] [-] btilly|16 years ago|reply
[+] [-] mceachen|16 years ago|reply
The main good thing about vi is that it's ubiquitous. You really should know how to use it, at least cursorily.
You can certainly use emacs over ssh (and you know about ssh's X11 forwarding, which let's you run a remote pointy-clicky editor rendered locally?).
Depending on your network and the files you're playing with, sshfs might be a relevant tool to view the files "locally".
If the files are really big, man the "split" command.
[+] [-] jarin|16 years ago|reply
I use Inconsolata font at 14pt and a modified Monokai theme (with darker background) whenever possible.
About once a year or so I decide I'm going to switch to vim. I spend about a week getting my vimrc and plugins set up and use it for a couple more weeks, before I eventually get sick of keyboard navigation and NERDTree and go back to TextMate. I know that with MacVim I get things like scrollwheel support and mouse navigation, but if I'm using those anyway I might as well use them in TextMate and get back my tab triggers and other shortcuts.
It's always good to brush up on vim once in a while though, since it often comes in handy when you need to edit config files on a server or when you are collaborating with a developer who uses vim exclusively. I also wish TextMate had split panes and some of the keyboard shortcuts (o, O, I, and A come to mind), but overall my productivity is better with TextMate.
[+] [-] bilban|16 years ago|reply
[+] [-] vtail|16 years ago|reply
Have you ever tried IDO, http://www.emacswiki.org/emacs/InteractivelyDoThings?
[+] [-] justinweiss|16 years ago|reply
[+] [-] jrockway|16 years ago|reply
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.
[+] [-] mixmax|16 years ago|reply
[+] [-] geedee77|16 years ago|reply
[+] [-] braindead_in|16 years ago|reply
[+] [-] shiloa|16 years ago|reply
Some of my can't-do-without features are: delete line, duplicate line, shift-line (up/down), select word, multi-edit (on gedit), word complete (circle through options bash style) and snippets. If I had to pick between gedit and TextMate, I'd probably go with gedit, but only because I spend a lot more time on it on a daily basis. I'm sure if I had TM at work, I'd probably understand what all the hype is about.. :)
[+] [-] unknown|16 years ago|reply
[deleted]
[+] [-] jjanzer|16 years ago|reply
[+] [-] tgittos|16 years ago|reply
Currently I'm using Visual Studio for all .NET related things, because it's a nice, overall IDE.
I'm also getting into C++, for which I use vim in Ubuntu (although I am far, far from being a decent vim user). I couldn't stand the way it tried to handle everything by default and felt like it was interfering with my understanding of C++ dev. I also didn't like the way the VS solution layout doesn't match the disk layout. I wanted to get more down and dirty with my compiler, and possibly learn make.
I also interchangably use Notepad++, Textmate and e-texteditor depending on what's available on the machine I'm on.
[+] [-] kentosi|16 years ago|reply
Currently at work, it's eclipse for Java development, and Textpad for all quick editing, regular expressions, mass find/replace across files, large files, etc.
[+] [-] eob|16 years ago|reply
[+] [-] kprobst|16 years ago|reply
[+] [-] bwr|16 years ago|reply
[+] [-] ez77|16 years ago|reply
[+] [-] cowmixtoo|16 years ago|reply
[+] [-] jobenjo|16 years ago|reply
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.
[+] [-] mbenjaminsmith|16 years ago|reply
[+] [-] jimmysanchez|16 years ago|reply
http://www.ultraedit.com/products/ultraedit.html
If you work with large files a lot, you may want to check this out:
http://www.ultraedit.com/support/tutorials_power_tips/ultrae...
I also LOVE the scripting. I've written a lot of custom scripts to automate repetitive tasks.
The only downside, it's not free like many of the other editors listed here; however, it is well worth the money.