|
1 | | -# 高效极客技巧 |
| 1 | +# Effective geek skills |
2 | 2 |
|
3 | | -惯常来讲,ide和编辑器是2个产品类别。 |
4 | | -ide侧重于某种语言的语法分析、提示、转到定义、调试。一般比较厚重。 |
5 | | -而编辑器则是对通用文本处理,提供更高效的通用文本处理能力,比较轻量,但语法分析能力不足。 |
6 | | -上一代HBuilder是一个典型的IDE,语言处理非常强大,但在字处理、轻量方面客观讲不如优秀的编辑器。 |
7 | | -而新的HBuilderX,定位是ide和编辑器的完美结合,那么HBuilderX就会提供轻量且世界顶级的高效字处理能力。 |
8 | | -看完这些,你一定会惊叹,原来极客是这么玩的。 |
| 3 | +Generally, ide and editor are two product categories. |
9 | 4 |
|
10 | | -### 免拖动选择 |
| 5 | +IDE focuses on the grammatical analysis, prompting, transition to definition, and debugging of a certain language. Generally heavier. |
11 | 6 |
|
12 | | -用鼠标拖着选中一片文本,是一个很容易让食指抽筋的操作。尤其是触摸板更痛苦。但是背诵很多相关的快捷键也一样痛苦。 |
| 7 | +The editor is for general text processing, providing more efficient general text processing capabilities, relatively lightweight, but insufficient grammatical analysis capabilities. |
13 | 8 |
|
14 | | -HBuilderX提供了更友好方式:`智能双击`和`Ctrl+扩大选区`。 |
| 9 | +HBuilderX, positioning is the perfect combination of ide and editor, then HBuilderX will provide lightweight and world-class efficient word processing capabilities. |
15 | 10 |
|
16 | | -### 智能双击 |
| 11 | +After reading these, you will be amazed, it turns out that geeks play like this. |
17 | 12 |
|
18 | | -在HBuilderX中,但凡特殊点的字符,都能智能双击。 |
| 13 | +### Drag-free selection |
19 | 14 |
|
20 | | -- 双击引号/括号内侧,是选中引号/括号内的内容 |
21 | | -- 双击逗号两侧,是选择逗号前一段或后一段 |
22 | | -- 双击行尾,是选中该行(不含回车符) |
23 | | -- 双击连词符(-_)选中整个词 |
24 | | -- 双击折叠行首内容开头,选择折叠段落 |
25 | | -- 双击行首缩进,选择相同缩进的段落 |
26 | | -- 双击列表符号,选择列表段落 |
27 | | -- 双击Tag开头或结尾,选择整段Tag |
28 | | -- 双击属性赋值等号=,选择Html属性 |
29 | | -- 双击if、function等关键字,选择整段包围区域 |
30 | | -- 双击分号,选择js等语言的;分号前段落 |
31 | | -- 双击css类名左侧,选择Css类 |
32 | | -- 双击注释符选择注释区域 |
33 | | -- 双击#选择markdown标题段落 |
34 | | -- 双击语法定义符开头选择markdown图片、超链接、加粗、倾斜、代码等语法区 |
35 | | -- [了解JSON智能双击](/Tutorial/Language/json?id=智能双击,快速选中数组或键值对) |
| 15 | +Dragging and selecting a piece of text with the mouse is an easy operation to make the index finger cramp. Especially the touchpad is more painful. But reciting many related shortcuts is just as painful. |
36 | 16 |
|
37 | | -下面是一个gif图例,双击选中tag和包围父tag |
| 17 | +HBuilderX provides a more friendly way: `smart double-click` and `Ctrl+ Enlarge selection`. |
38 | 18 |
|
39 | | -1. 双击div tag的首或尾可以选中这个tag,即开头的<左侧或结尾的>右侧。当然双击if、双击缩进符、双击括号引号内侧...很多位置都可以通过智能双击选中。具体见HBuilder的选择菜单。 |
40 | | -2. 按Ctrl+]包围,就可以在这个选区首尾加父标签,同时闪烁光标。如果在js里,按下Ctrl+]不是包围tag,而是包围if、for等函数库,方便快速把一段代码放入if块中。 |
41 | | -3. 输入div即可在首尾添加包围标签 |
| 19 | +### Smart double-click |
| 20 | + |
| 21 | +In HBuilderX, any characters with special points can be double-clicked intelligently. |
| 22 | + |
| 23 | +- Double-click the inside of `quotation marks/brackets` to select the content in `quotation marks/brackets` |
| 24 | +- Double-click on both sides of the `comma` to select a paragraph before or after the comma |
| 25 | +- Double-click the `end of line` to select the line (without carriage return) |
| 26 | +- Double-click the `conjunction symbol` (-_) to select the entire word |
| 27 | +- Double-click the beginning of the content at the beginning of the collapsed line and select the collapsed paragraph |
| 28 | +- Double-click `line beginning indentation` to select the same indented paragraph |
| 29 | +- Double click `list symbol` to select the list paragraph |
| 30 | +- Double-click the beginning or end of `Tag` to select the entire tag |
| 31 | +- Double-click the attribute assignment equal sign `=`, select the Html attribute |
| 32 | +- Double-click on keywords such as `if`, `function`, etc. to select the entire enclosing area |
| 33 | +- Double click `semicolon`, select js and other languages; paragraph before semicolon |
| 34 | +- Double-click on the left side of the `css` class name and select the Css class |
| 35 | +- Double click `Comment symbol` to select the comment area |
| 36 | +- Double click `#` to select markdown title paragraph |
| 37 | +- Double-click the beginning of the grammar delimiter to select markdown images, hyperlinks, bold, italic, code and other grammatical areas |
| 38 | +- [JSON smart double-click](/Tutorial/Language/json?id=Smart double-click, quickly select an array or key-value pair) |
| 39 | + |
| 40 | +The following is a gif legend, double-click to select the tag and surround the parent tag |
| 41 | + |
| 42 | +1. Double-click the beginning or end of `div tag` to select this `tag`, which is the left side of the beginning `<` or the right side of the end `>`. Of course, double-click `if`, double-click `indentation`, double-click `inside bracket quotation mark`...many positions can be selected by smart double-clicking. See the selection menu of HBuilder for details. |
| 43 | +2. Press `Ctrl+]` to surround, you can add parent tags at the beginning and end of this selection, and the cursor blinks at the same time. If you are in js, pressing `Ctrl+]` does not enclose the tag, but encloses libraries such as `if`, `for`, etc., so that you can quickly put a piece of code into the `if` block. |
| 44 | +3. Enter `div` to add surrounding tags at the beginning and end |
42 | 45 |
|
43 | 46 | <img src="/static/snapshots/tutorial/dbclick.gif" /> |
44 | 47 |
|
45 | | -### 多光标 |
| 48 | +### Multi-cursor |
46 | 49 |
|
47 | 50 | <img src="/static/snapshots/tutorial/more_cursor.gif" /> |
48 | 51 |
|
49 | 52 |
|
50 | | -### 扩大选区 |
| 53 | +### Expand the constituency |
51 | 54 |
|
52 | | -`=`是`+`的默认键位置,所以`Ctrl+=`其实就是`Ctrl`键和`+`号一起按下。 |
| 55 | +`=` is the default key position of `+`, so `Ctrl+=` is actually pressing the `Ctrl` key and the `+` sign together. |
53 | 56 |
|
54 | | -在HBuilderX里可以智能的判断选区范围,持续扩大选区,无鼠标快速选中你需要的选区。 |
| 57 | +In HBuilderX, you can intelligently judge the selection area, continue to expand the selection area, and quickly select the selection area you need without the mouse. |
55 | 58 |
|
56 | 59 | <img src="/static/snapshots/tutorial/selection_expand.gif" /> |
57 | 60 |
|
58 | 61 |
|
59 | | -### 反包围 |
| 62 | +### Anti-encirclement |
60 | 63 |
|
61 | | -1. 双击tag p开头,选中该tag。 |
62 | | -2. 按反包围`Ctrl+Shift+]`,可去掉tag p并自动处理子节点的缩进。 |
| 64 | +1. Double-click the beginning of tag p to select the tag. |
| 65 | +2. Press "Ctrl+Shift+]" to remove the tag p and automatically process the indentation of the child nodes. |
63 | 66 |
|
64 | 67 | <img src="/static/snapshots/tutorial/selection_1.gif" /> |
65 | 68 |
|
66 | | -这里多提一句HBuilderX的快捷键理念,就是符号化,而不是字母化。很多工具的快捷键都是控制键+功能英文单词中的一个字母,这个是极难记忆的。 |
| 69 | +One more thing to mention here is HBuilderX's concept of shortcut keys, which is symbolization, not alphabetization. The shortcut keys of many tools are control keys + function a letter in English words, which is extremely difficult to remember. |
67 | 70 |
|
68 | | -符号化让快捷键的记忆变简单,比如`Ctrl+]`是包围。 |
| 71 | +Symbolization makes it easier to memorize shortcut keys, such as `Ctrl+]` for enclosing. |
69 | 72 |
|
70 | | -而反操作或增强操作一般是加Shift,比如Ctrl+Shift+]是反包围。 |
| 73 | +The reverse operation or enhancement operation is generally to add `Shift`, for example, `Ctrl+Shift+]` is anti-enclosure. |
71 | 74 |
|
72 | | -### 选中相同语法词及跳过某词 |
| 75 | +### Select the same grammatical word and skip a word |
73 | 76 |
|
74 | | -1. 下图中,使用普通的选择相同词Ctrl+e(mac是Cmd+d),会把所有div都选中。但使用Ctrl+Shift+e(mac是Cmd+Shift+d),会智能识别语法,剔除不相干的词。 |
75 | | -2. 下图按下选择相同语法词,同时选中tag首尾的div,而不会选中子节点的div。 |
76 | | -3. 然后就可以方便的将原div改名为p |
| 77 | +1. In the figure below, using the normal selection of the same word `Ctrl+e` (MacOSX: `Cmd+d`), all divs will be selected. But using `Ctrl+Shift+e` (MacOSX: `Cmd+Shift+d`), it will intelligently recognize the grammar and eliminate irrelevant words. |
| 78 | +2. In the following figure, press to select the same grammatical word, and at the same time select the `div` at the beginning and end of the `tag`, but not the div of the child node. |
| 79 | +3. Then you can easily rename the original `div` to `p` |
77 | 80 |
|
78 | 81 | <img src="/static/snapshots/tutorial/selection_2.gif" /> |
79 | 82 |
|
80 | | -备注: |
81 | | -- 如果想选择配对括号,靠相同词是不行的。选中相同语法词会选中匹配的2个左右括号 |
82 | | -- 批量选中所有相同词是Ctrl+Alt+e(mac是ctrl+alt+d) |
| 83 | +Remark: |
| 84 | +-If you want to choose matching parentheses, you cannot rely on the same words. Selecting the same grammatical word will select the matching 2 left and right brackets |
| 85 | +-Batch selection of all the same words is `Ctrl+Alt+e` (MacOSX: `ctrl+alt+d`) |
| 86 | + |
| 87 | +### Select All Reference Symbols |
83 | 88 |
|
84 | | -### 选择相同语法词或配对符号 |
| 89 | +Menu【Select】【Select All Reference Symbols】 |
85 | 90 |
|
86 | | -菜单【选择】【选择相同语法词或配对符号】 |
| 91 | +MacOSX shortcut keys:`command+shift+d` |
87 | 92 |
|
88 | | -MacOSX快捷键:command+shift+d;Windows快捷键:ctrl+shift+e |
| 93 | +Windows shortcut keys:`ctrl+shift+e` |
89 | 94 |
|
90 | 95 | <img src="/static/snapshots/tutorial/renameTag.gif" style="zoom: 50%;border: 1px solid #eee; border-radius: 5px;" > |
91 | 96 |
|
92 | | -### 交换选区内容 |
| 97 | +### swap selection content |
93 | 98 |
|
94 | | -当需要交互2个选区的内容时,选中a、剪切、点b前面、粘贴、选中b、找到之前a的位置点击、粘贴...这么长的操作太低效。 |
| 99 | +When you need to interact with the contents of two selection areas, select a, cut, click in front of b, paste, select b, find the position of a before, click, paste... Such a long operation is too inefficient. |
95 | 100 |
|
96 | | -来看HBuilderX的`Ctrl+Shift+x`交互选区,也就是Ctrl+x的增强版。 |
| 101 | +Let’s take a look at HBuilderX’s `Ctrl+Shift+x` interactive selection, which is an enhanced version of Ctrl+x. |
97 | 102 |
|
98 | | -1. 双击第1个style属性后的引号内侧,可选中引号内容。 |
99 | | -2. 按下Ctrl后继续双击第2个style属性后的引号内侧,可选中2个引号内的选区。 |
100 | | -3. 按下Ctrl+Shift+x,交换style属性的内容。 |
| 103 | +1. Double-click the inside of the quotation mark after the first style attribute to select the content of the quotation mark. |
| 104 | +2. After pressing Ctrl, continue to double-click the inside of the quotation mark after the second style attribute to select the selection within the 2 quotation marks. |
| 105 | +3. Press `Ctrl+Shift+x` to exchange the contents of the style attribute. |
101 | 106 |
|
102 | 107 | <img src="/static/snapshots/tutorial/selection_swap_1.gif" /> |
103 | 108 |
|
104 | | -如果不选择内容,光标放置到2行,可直接交换这2行的内容,如下图 |
| 109 | +If you don’t select the content, place the cursor on two lines, and you can directly exchange the content of these two lines |
105 | 110 |
|
106 | 111 | <img src="/static/snapshots/tutorial/selection_swap_2.gif" /> |
107 | 112 |
|
108 | 113 |
|
109 | | -### 撤销最后一个多选区或多光标 |
| 114 | +### Undo the last multi-selection area or multi-cursor |
110 | 115 |
|
111 | | -选区选多了或选错了,不用担心要重头选,Ctrl+Shift+z不是撤销编辑内容,而是撤销最后一个选区。 |
| 116 | +If you have selected too many or wrong selections, don’t worry about re-selecting. `Ctrl+Shift+z` is not to undo the editing content, but to undo the last selection. |
112 | 117 |
|
113 | | -1. 双击选中class |
114 | | -2. 按`Ctrl+e`选中相同词 |
115 | | -3. 按`Ctrl+Shift+z`,不再选中最后一个词。 |
| 118 | +1. Double click to select class |
| 119 | +2. Press `Ctrl+e` to select the same word |
| 120 | +3. Press `Ctrl+Shift+z`, no longer select the last word. |
116 | 121 |
|
117 | 122 | <img src="/static/snapshots/tutorial/selection_cancel.gif" /> |
118 | 123 |
|
119 | | -如果多选了一个词,还可以点`Ctrl+鼠标右键`取消一个选区。 |
| 124 | +If you select one more word, you can click `Ctrl+right mouse button` to cancel a selection. |
120 | 125 |
|
121 | | -跳过当前词选下一个词,`Alt+Shift+e`(mac是`ctrl+shift+d`) |
| 126 | +Skip the current word and select the next word, `Alt+Shift+e` (mac is `ctrl+shift+d`) |
122 | 127 |
|
123 | 128 |
|
124 | | -### 批量合并行 |
| 129 | +### Join Lines |
125 | 130 |
|
126 | | -下图示例,是把css合并为一行时的快捷操作 |
| 131 | +The example is a shortcut operation when combining css into one line |
127 | 132 |
|
128 | 133 | <img src="/static/snapshots/tutorial/selection_merge.gif" /> |
129 | 134 |
|
130 | | -1. 双击`{`内侧选中class |
131 | | -2. 按`Ctrl+双击`选中另一个class |
132 | | -3. 按反格式化`Ctrl+Shift+k`,可以把每个css的区块代码都合并为一行 |
133 | | -4. `Ctrl+k`是格式化代码,那么`Ctrl+Shift+k`就是合并为一行。 |
| 135 | +1. Double-click inside `{` to select class |
| 136 | +2. Press `Ctrl+double-click` to select another class |
| 137 | +3. Press the reverse format `Ctrl+Shift+k` to merge each css block code into one line |
| 138 | +4. `Ctrl+k` is the formatting code, then `Ctrl+Shift+k` is merged into one line. |
134 | 139 |
|
135 | | -### 同时注释if段首尾 |
| 140 | +### At the same time annotate the beginning and end of the if paragraph |
136 | 141 |
|
137 | | -if块的调整很常见,除了包围、反包围外,常用操作还有同时注释掉if段首尾。 |
| 142 | +The adjustment of if block is very common. In addition to enclosing and deenclosing, common operations include commenting out the beginning and end of if paragraphs at the same time. |
138 | 143 |
|
139 | | -1. 双击if选中if代码块 |
140 | | -2. 按`Ctrl+\`在选区首尾加光标,变成多光标模式 |
141 | | -3. 按`Ctrl+/`注释掉选区首尾行 |
| 144 | +1. Double-click `if` to select the `if` code block |
| 145 | +2. Press `Ctrl+\` to add the cursor at the beginning and end of the selection to change to multi-cursor mode |
| 146 | +3. Press `Ctrl+/` to comment out the first and last lines of the selection |
142 | 147 |
|
143 | 148 | <img src="/static/snapshots/tutorial/selection_if.gif" /> |
144 | 149 |
|
145 | | -### 其它技巧 |
146 | | -- [转到定义](/Tutorial/UserGuide/goto?id=转到定义) |
147 | | -- [折叠](Tutorial/UserGuide/fold) |
148 | | -- [大纲](/Tutorial/userinterface?id=文档结构图) |
| 150 | +### Other |
| 151 | +- [Go to Definition](/Tutorial/UserGuide/goto?id=转到定义) |
| 152 | +- [Fold](Tutorial/UserGuide/fold) |
| 153 | +- [Outline](/Tutorial/userinterface?id=文档结构图) |
0 commit comments