Live data from Hacker News

Some things beginners might not know about Sublime Text

blog.alainmeier.com

31–40 of 116 posts

Re: Some things beginners might not know about Sublime Text

#31
post #15

Cmd + d selects the current word. Subsequent Cmd + d presses will select the following instance of the word for editing. Makes it easy to do things such as renaming a local variable or changing both the opening and closing element of a HTML tag.

Also notable is that you can skip the currently selected element (i.e. unselect it) if you press ctrl+k+d. Sublime will then continue to select the next word, but leaves the one you just selected unselected.

Re: Some things beginners might not know about Sublime Text

#33
post #32

Still doesn't seem to have 'correct indentation' which I would use often, especially for 'data' files like XML or JSON.

This is probably obvious for most people, but when you can't find a feature you want in an editor, you should look for plugins.

So, in this case, you would go to http://wbond.net/sublime_packages/community and search for "indent" or "pretty" or "xml".

Re: Some things beginners might not know about Sublime Text

#35
One of my favorite features is the flexibility of the Goto Anything dialog (CMD+T or CMD+P) e.g.:

- Goto file: "con pos" -> app/controllers/posts_controller.rb

- Goto line in file: "con pos:100" -> app/controllers/posts_controller.rb line 100

- Goto function in file: "con pos@foo" function foo in app/controllers/posts_controller.rb

Also one that came up recently is CMD+ALT+Q to auto-wrap long comments to your ruler (e.g. 80 columns).

Re: Some things beginners might not know about Sublime Text

#36
post #31
post #15

Cmd + d selects the current word. Subsequent Cmd + d presses will select the following instance of the word for editing. Makes it easy to do things such as renaming a local variable or changing both the opening and closing element of a HTML tag.

Also notable is that you can skip the currently selected element (i.e. unselect it) if you press ctrl+k+d. Sublime will then continue to select the next word, but leaves the one you just selected unselected.

ctrl+k+d was added recently and was quite a big improvement but it's still hard to use because if you do one wrong cmd+d you'll have to either start again or use the mouse. the way cloud9 ace[1] handles this is better, since it keeps last added selection as active one and from there you can add selections with ctrl+alt arrows or remove with ctrl+alt+shift arrows

[1]http://ajaxorg.github.com/ace/build/kitchen-sink.html

Re: Some things beginners might not know about Sublime Text

#37

Earlier quoted context omitted.

The command and alt modifiers work when I use the arrow key but this ctrl doesn't seem to do anything... OS X lion. For example, I put the caret in front of a camelCased variable and press ctrl+right arrow, nothing happens. Am I doing it wrong?

You need to hold alt _and_ ctrl at the same time.

[deleted]

Re: Some things beginners might not know about Sublime Text

#38
I've been using {g}vi{m} for 20 years now, but just bought ST2. I like how this whole discussion revolves around finding keystrokes in ST2 that yield the convenience of doing things I took for granted in vim. Maybe I should just yield to the wisdom of the crowd, go back to VIM, forget about having a file explorer on the left side (NERDtree's wonkiness drove me to ST2), and learn to use Ctrl-P. It's what people keep suggesting to use in ST2.

Re: Some things beginners might not know about Sublime Text

#39
post #35

One of my favorite features is the flexibility of the Goto Anything dialog (CMD+T or CMD+P) e.g.: - Goto file: "con pos" -> app/controllers/posts_controller.rb - Goto line in file: "con pos:100" -> app/controllers/posts_controller.rb line 100 - Goto function in file: "con pos@foo" function foo in app/controllers/posts_controller.rb Also one that came up recently is CMD+ALT+Q to auto-wrap long comments to your ruler (…

You dont even need the spaces.

    "conpos:100"
works fine.

Re: Some things beginners might not know about Sublime Text

#40
You guys know that you can go to the Default Keymaps file and get all of these tips in one list right? You can even change them...

EDIT: Just for fun, here is that file on OS X: https://gist.github.com/3117613 Notice the "context" definitions. Also check out how the auto-pairing functionality is defined in terms of the key binding DSL. And how you can define nonstandard layouts for the panes. And so on.

Sublime is great. It reminds me of a less insane version of Foobar2000.

Post reply on HN