SublimeText good keys
selection
Alt-Shf-W
wrap selection in a tag (type to replace P, if needed)
Class and ID (. and #) can expand, too. (custom)
Ctrl-Shf-A
select to TAG, cumulative
Ctrl-Shf-M
select to BRACKET [ ], { }, ( ), cumulative
Ctrl-Shf-J
select to INDENTATION, cumulative
Ctrl-Shf-space
select to SCOPE, ie: syntax-highlighted text
(HTML: in normal text selects ALL)
Ctrl-Shf-,
select to PARAGRAPH, ie: blank lines (custom)
Ctrl-L
select line and drop to next, cumulative
Ctrl-Shf-L
convert selected block to multiple cursors
multi-cursors
Ctrl-Alt-Up,Dn
add cursor above, below line (OS might supersede this)
Ctrl-click
drag multiple selections
Ctrl-T
transpose 2 or more selections
Ctrl-D
select "word" (Ctrl-D select next match)
Ctrl-K-D
unselect current, jump to next match
Ctrl-U
soft undo selection, repeatable (also undoes edit, like Ctrl-Z)
Ctrl-Shf-U
soft redo, repeatable
NB! Emmet plug-in overrides Ctrl-U. (custom)
Alt-F3
select ALL occurrences of selection (guess word if no selection)
column select
Shf-Rclick
drag to create multiple cursors in column
Ctrl-Shf-Rclick
non-adjacent column cursors
mousewheel
press and drag, same as Shf-Rclick
lines
Ctrl-/
toggle line comment ( // or <!-- --> )
Ctrl-Shf-/
toggle block comment in PHP, CSS, or JS
in HTML comment entire tag block (Emmet plugin)
Ctrl-Shf-Enter
new line above
Ctrl-Enter
new line below
Ctrl-Shf-D
duplicate line (or selection)
Ctrl-Shf-Up/Dn
shift line(s) up/down
Ctrl-Shf-V
paste indented
Ctrl-], [
shift line(s) right, left
Ctrl-Shf-{, }
collapse, expand control block
Ctrl-M
jump to matching bracket { } or ( )
restore indents
Ctrl-Shf-P rein
indent nested blocks, using command palette
Edit > Line > Reindent
using menu
NB: Avoid on PRE sections. Messes w/indenting.
sort
F9
sort lines
Ctrl-F9
sort lines (case sensitive)
search
Ctrl-I
incremental (F3 or Ctrl-I find next) ENTER to exit
Ctrl-Shf-I
backwards (F3 find previous)
Ctrl-F
find (F3 or ENTER find next) ESC exit
Ctrl-Shf-F
search multiple files. Can combine Unix-style paths, file patterns, symbolic locations:
/c/www/root/owrc, *.html, *.php, <open files>
F4 next result
Ctrl-H
search/replace (Alt-A preserves case)
Ctrl-Shf-H replace and find next
Ctrl-Alt-Enter replace ALL
Ctrl-F2
set/clear bookmark
F2
jump to bookmark
Ctrl-Sh-F2
clear ALL bookmarks
Ctrl-P
GoTo anything, preview or open tabs (or files in project)
# fuzzy matching
: line number (ex: aj:54)
@ symbol list (HTML, IDs, CSS selectors, JS or PHP functions)
ESC exit preview. ENTER open file.
tab navigation
Ctrl-PgDn, PgUp
next, prev (across groups)
Ctrl-Tab, Shf-Tab
next, prev in stack (stays in group)
Ctrl-P
search tabs
window management
Alt-Shf-1, 2, 3, 4
single, 2 cols, 3 cols, 4 cols
Alt-Shf 8, 9
2 rows, 3 rows
Alt-Shf-5
4-window grid
Ctrl-Shf-1, 2, 3, 4
move file to group 1, 2, 3, 4
Ctrl-1, 2, 3, 4
focus group 1, 2, 3, 4
View the same file in a 2nd window.
- create new column or row using commands above
- File > New View into File
- Ctrl-Shf-1, 2, 3, 4 to shift to other window
UTF-8
0145, 0146
0147, 0148
Custom
User Preference menus:
Preferences > Key Bindings -User
Preferences > Settings - User
User Preference files start in Sublime Text\Packages\User\
key mapping
Default (Windows.sublime-keymap
user settings
Preferences.sublime-settings
color scheme
Monokai Soda.tmTheme (or whatever is default)
keymap
// expand to paragraph
{"keys": ["ctrl+shift+,"], "command": "expand_selection_to_paragraph" },
// fix Emmet override of Ctrl-U
{
"keys": ["shift+ctrl_alt_u"],
"args": {"action": "update_image_size"},
"command": "run_emmet_action",
"context": [{"key": "emmet_action_enabled.update_image_size}]
},
// restore default Ctrl-U and Shift-Ctrl-U
{ "keys": ["ctrl+u"], "command": "soft_undo" },
{ "keys": ["shift+ctrl+u"], "command": "soft_redo" }
user settings
// # or . inserts ID or CLASS in a tag (using Alt-Shift-W)
"auto_id_class": true,
"auto_complete_commit_on_tab": true,
"tab_size": 2
color scheme
// more prominent selection
<key>selection</key>
<string>#662288</string>
<key>selectionBorder</key>
<string>#00eeff</string>