Earlier quoted context omitted.
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.ht…
Some things beginners might not know about Sublime Text
41–50 of 116 posts
Re: Some things beginners might not know about Sublime Text
#42Re: Some things beginners might not know about Sublime Text
#43I am pretty sure that "Quick file opening" is CTRL+P on Windows. Since CTRL+T opens a new tab for me..
Re: Some things beginners might not know about Sublime Text
#44Cmd-P is useful for opening existing files, but what's the preferred way for creating them? I eventually had to get an extension and modify it to replicate emacs' c-x c-f to create files.
Re: Some things beginners might not know about Sublime Text
#45Cmd + 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.
What's really wild is if you do CMD+d several times and then move around with the arrow keys. Multiple cursors follow you around. I'm not sure if this is useful, but it's certainly cool.
For one thing, it goes a surprisingly long way to making up for not having language-sensitive refactoring tools if you’re renaming things, changing parameter lists, etc.
Also, you can make a selection in advance rather than relying on the default of selecting the current word. That selection can even span line breaks and/or include indentation. If you then select some/all instances of the same text as starting points using Ctrl+D, you can change not only the copies of the text but also (for example) extend the selections to include whatever is immediately before or afterwards (even if that is different in each case) or move to the start or end of each line. It’s a quick way to do a lot of common search-and-replace type operations without getting bogged down in regexes or macros.
A related useful technique is using (on Windows) Ctrl+Alt+up/down, which moves up/down a line creating multiple cursors as you go. If you then do Shift+left/right, you can get a “column selection” effect, for example. (You can also drag with the middle mouse button to select a column.)
I hope ST2 will build on these basic features as time goes on. It could allow incremental forward/backward search without cancelling the multiple cursors, let you cycle around which cursor is shown or will be left when you hit escape to cancel multiple mode, maybe even temporarily split the display to show multiple cursors at once if they are far apart. There’s a huge amount of potential here.
Re: Some things beginners might not know about Sublime Text
#46Cmd-P is useful for opening existing files, but what's the preferred way for creating them? I eventually had to get an extension and modify it to replicate emacs' c-x c-f to create files.
I normally do Cmd+N (Create an empty file) Cmd+S (save it). Isn't this sort of the same?
Re: Some things beginners might not know about Sublime Text
#47Cmd-P is useful for opening existing files, but what's the preferred way for creating them? I eventually had to get an extension and modify it to replicate emacs' c-x c-f to create files.
Re: Some things beginners might not know about Sublime Text
#48You can also move the curent line up and down the page using Ctrl + Cmd + Up/Down
Also:
Ctrl+Shift+D duplicates the current line by default (or the current selection, if any). Ctrl+Shift+K deletes the whole line. Ctrl+K twice deletes to end-of-line. Ctrl+K Ctrl+backspace deletes to beginning-of-line.
Combine duplicate, move up/down, and the Ctrl+D multi-cursor stuff, and you have a copy-and-paste coder’s dream editor. ;-)
Re: Some things beginners might not know about Sublime Text
#49Cmd + 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.