OSDN Git Service

Regular updates
[twpd/master.git] / sublime-text.md
1 ---
2 title: Sublime Text
3 category: Apps
4 layout: 2017/sheet
5 ---
6
7 ### Select & Expand
8
9 | `⌘ D`       | select current word (repeat to include next instance of word) |
10 | `⌘ L`       | select current line (repeat to include next line) |
11 | `⌘ ⇧ L`     | split selection into multiple lines |
12 | `⌘ ⇧ A`     | select text inside tag (repeat to expand) |
13 | `Ctrl ⇧ M`  | select to curly or angle brackets (repeat to expand) |
14 {: .-shortcuts}
15
16 Replace ⌘ with Ctrl on Windows and Linux.
17
18 ### Code Folding
19
20 | `⌘ Alt [`         | fold closest block                     |
21 | `⌘ Alt ]`         | unfold closest block                   |
22 | `⌘ K` `⌘ 1`       | fold all first level code blocks       |
23 | `⌘ K` `⌘ 2`       | fold all second level code blocks      |
24 | `⌘ K` `⌘ 3 (etc)` | fold all third level code blocks (etc) |
25 | `⌘ K` `⌘ T`       | fold all HTML attributes               |
26 | `⌘ K` `⌘ 0`       | unfold everything                      |
27 {: .-shortcuts}
28
29 ### Editing
30
31 | `⌘ ⇧ D` | duplicate current line/selection |
32 | `⌘ ⇧ K` | delete current line/selection |
33 | `⇧ del` | delete current line/selection |
34 | `⌘ ⇧ ↑` | move line up   |
35 | `⌘ ⇧ ↓` | move line down |
36 {: .-shortcuts}
37
38 ### Goto
39
40 | `⌘ P`         | goto anything |
41 | `⌘ G`         | goto line number |
42 | `⌘ R`         | goto symbol |
43 | `⌘ P, :`      | goto line number (enter number after `:`) |
44 | `⌘ P, #`      | goto and list fuzzy-matches of string (enter characters after `#`) |
45 | `⌘ P, @`      | goto and list symbol (begin typing symbol name after `@`) |
46 {: .-shortcuts}
47
48 ### Command line
49
50 ```sh
51 $ subl .
52 $ subl README.md
53 ```
54
55 Use `subl` to open files in Sublime from the terminal.