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 {: .-shortcuts}
34
35 ### Goto
36
37 | `⌘ P`         | goto anything |
38 | `⌘ G`         | goto line number |
39 | `⌘ R`         | goto symbol |
40 | `⌘ P, :`      | goto line number (enter number after `:`) |
41 | `⌘ P, #`      | goto and list fuzzy-matches of string (enter characters after `#`) |
42 | `⌘ P, @`      | goto and list symbol (begin typing symbol name after `@`) |
43 {: .-shortcuts}
44
45 ### Command line
46
47 ```sh
48 $ subl .
49 $ subl README.md
50 ```
51
52 Use `subl` to open files in Sublime from the terminal.