Hacker News new | ask | show | jobs
by wbond 5404 days ago
Jon (jskinner) has been doing a great job of continuous releases with a mix of new features and bug fixes. It is easily the best $60 I've ever spent on an editor or IDE.

If you haven’t tried Sublime Text 2 before, I recommend taking it for a whirl. Most developers I've shown it to really like it. Here are some reasons it won me over:

Multiple selections. Select a variable and then press Ctrl+d/Cmd+d a few times. Now type a new variable name. Or, select a few lines and press Ctrl+Shift+l/Cmd+Shift+l. You can now make batch edits to all lines

Goto Anything (Ctrl+p or Cmd+p). Start typing a filename. Type an @ and then start typing a function or method name. Hit escape instead of enter to return to where you were.

It also has a very nice Python API that makes writing plugins fun. http://www.sublimetext.com/docs/2/api_reference.html

There are so many other little things done right that you find once you start digging in.

4 comments

Some more:

If you have indentation set to use spaces, you can hit tab and it will add 4 spaces, then hit backspace and it will delete all 4 spaces. Most text editors won't do that.

It matches parentheses and braces, but you can just ignore it. Type a '(' followed by a ')'. With every other graphical editor I've tried that has brace matching, you end up with '())'. With sublime, you end up with '()'.

Fyi, the Eclipse does bracket matching as well. In fact, I think Sublime Text borrows the concept partially from Eclipse. [1]

Eclipse is slightly if I remember correctly, since it lets you skip all closed braces with a tab. That way, typing (([tab] gives you (())_ , where _ is the cursor. Very convenient.

[1] I don't remember the details, but I remember that I posted a few lines to the Sublime Text forum, that fixed part of the way bracket matching worked to make it more like Eclipse. This was later put into Sublime Text proper. This is what I love - Jon actually looks at the things people are doing, and puts the good stuff directly into ST.

Couple of features I wish ST2 had:

1) Ability to rename files and tell that to git/any revision control while it does it.

2) Bundler integration to automatically add all bundles to the project so they can be searched on.

I wish it had code folding, and I wish I could do a block cursor instead of the | (easier to see) but I don't think those are hugely popular requests.
Last I've seen, code folding has been requested from day 1. And I see requests / lamentations / mentions of it every time discussions about it crop up, without exception.

Personally, as shiny as the scroll-preview is, the fact that it doesn't show the structure of the entire document makes it almost worthless to me. As much as I hate visual studio, MetalScroll[1] was fantastic. You can see functions by shape, visually navigate the entire file at a glance (though I have good visual memory, so that may be easier for me), and it shows folds, breakpoints, changed lines, and selections. ST2 shows... about a screen in either direction.

[1] http://code.google.com/p/metalscroll/

I would like to second this sentiment. That feature has become a vital part of how I navigate code, especially for projects that I am looking at for the first time.

It's the only thing preventing me from using SublimeText 2.

SublimeText's minimap is not as feature rich as metal scroll, but its pretty useful in general as a nav tool. I often find myself wishing Chrome had a scrollable minimap.
The userecho page on Code Folding has a lot of votes, though there's some speculation that it'd be pretty difficult to do with the current implementation of the editor control.

http://sublimetext.userecho.com/topic/19281-syntax-code-fold...

If you do #1, you might as well throw in more commands. I can see why the author might not want to cascade in to that just yet.
I've moved from TextMate to Sublime Text 2 over the past few weeks. The only thing I miss from TM is the ability to jump back to the last opened file with command-t.

Has anyone managed to hack their config to enable that feature? I understand there are some callbacks available that might help, but I haven't figured out how to put them into action.

Ctrl+Tab and Ctrl+Shift+Tab navigate through the "stack" of recently opened views (files). Is this what you mean?
That only cycles between currently open tabs, so that's not quite the same. The genius of TextMate's go-to-file pane was that before you started typing, it would list your recently closed files, so the go-to-file pane had two functions in one, both servicing the need to open something that is not currently open.
That sounds like a mix of switching recent tabs and Goto File (ctrl+p/cmd+p).
Have you tried the "show files" panel? Ctrl/cmd-T. Works like TextMate's. Works like ctrl/cmd-P except it only accepts files, and will show a default file list when it opens.
Well, that was my original point above – the difference between cmd-T in TextMate vs. Sublime Text 2 is that TextMate ordered the files with the most recently opened at the top.

In TextMate, I got used to using cmd-t to jump back and forth between files. Minor thing, really. I just wondered if anyone hacked that same behavior into Sublime Text.

I missed that somehow, although it seems perfectly obvious now. I'm flexible enough to relearn a familiar key binding. (How often do you hear that in reference to a text editor?!)

Thanks!

Wish it could be hacked, but while you _can_ create search panels like that, you can't access the list of recently opened documents, as far as I've found.
Sublime Text 1 had a plugin that gave a Most Recently Used shortcut to open recently closed documents. It used the file-opening hook, recording ever file to an sqlite DB.
I also like it so much I wish he would go meta and tell us about the initial (winning) choices he made for developing ST2.