Skip to content

Commit aecaf27

Browse files
committed
Merge remote-tracking branch 'origin/dev'
2 parents 2043eb1 + 9133550 commit aecaf27

File tree

22 files changed

+152
-63
lines changed

22 files changed

+152
-63
lines changed

en/Tutorial/SourceControl/Git/MacOSX.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ Project, right-click menu 【Git pull】
3636
Project, right-click menu 【Git Push】
3737

3838
<img src="/static/snapshots/tutorial/source_control/git-new-push-en.png" style="zoom:50%; border: 1px solid #eee;" />
39-
39+
40+
**备注**:git push --force: 表示将目前自己本机的代码库推送到远端,并覆盖。请谨慎使用。
4041

4142
## Commit
4243

en/Tutorial/SourceControl/Git/Windows.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ Project, right-click menu 【Git Push】
4747

4848
<img src="/static/snapshots/tutorial/source_control/git-new-push-en.png" style="zoom:50%; border: 1px solid #eee;" />
4949

50+
**备注**:git push --force: 表示将目前自己本机的代码库推送到远端,并覆盖。请谨慎使用。
51+
5052
## Shortcut key configuration
5153

5254
1. toop menu, 【tool】-->【custom keybindings】
Lines changed: 58 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
> HBuilderX 2.0.3+起支持
1+
# EditorConfig
22

3-
## editorconfig是什么?
3+
> Supported from HBuilderX 2.0.3+
44
5-
很多公司都要求各开发成员使用相同的编码风格,比如缩进是空格还是tab。
5+
## What is EditorConfig?
66

7-
`editorconfig`是一套解决这个问题的业内通用规范,通过在项目下存放配置文件`.editorconfig`,并在这个配置文件中描述规则,然后把这个配置文件和其他代码一起提交git/svn,所有项目成员,都会遵循相同的编码规范。
7+
EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs.
88

9-
`HBuilderX`直接支持该规范,无需下载插件,开箱即用。sublime、vscode支持该规范的话需要先下载插件。
9+
The EditorConfig project consists of a file format for defining coding styles and a collection of text editor plugins that enable editors to read the file format and adhere to defined styles.
1010

11-
`editorconfig`的官网是[https://editorconfig.org/](https://editorconfig.org/)
12-
`editorconfig`可以帮助开发者在不同的编辑器和IDE之间定义和维护一致的代码风格。
13-
`editorconfig`包含一个用于定义代码格式的文件和一批编辑器插件,这些插件可以让编辑器读取配置文件并依此格式化代码。
14-
`editorconfig`的配置文件十分易读,并且可以在各个操作系统、编辑器下工作。
11+
EditorConfig files are easily readable and they work nicely with version control systems.
1512

16-
## editorconfig的配置文件是怎样的?
13+
The official website of `editorconfig` is [https://editorconfig.org/](https://editorconfig.org/)
1714

18-
以下是一个用于设置Python和JavaScript行尾和缩进风格的配置文件。
15+
## HBuilderX EditorConfig
16+
17+
`HBuilderX` directly supports this specification, no need to download plug-ins, it can be used out of the box. If sublime and vscode support this specification, you need to download the plug-in first.
18+
19+
## What's an EditorConfig file look like?
20+
21+
Below is an example .editorconfig file setting end-of-line and indentation styles for Python and JavaScript files.
1922

2023
```
2124
# EditorConfig is awesome: http://EditorConfig.org
@@ -48,11 +51,11 @@ indent_style = space
4851
indent_size = 2
4952
```
5053

51-
## 案例
54+
## Case
5255

53-
很多开源项目都用到了`editorconfig`
56+
Many open source projects use `editorconfig`
5457

55-
比如[jQuery](https://github.com/jquery/jquery/blob/master/.editorconfig), `jQuery``Github`上的`.editorconfig`配置文件如下:
58+
For example[jQuery](https://github.com/jquery/jquery/blob/master/.editorconfig), `jQuery` `.editorconfig` configuration file on `Github`
5659

5760
```ini
5861
root = true
@@ -69,55 +72,61 @@ indent_style = space
6972
indent_size = 2
7073
```
7174

72-
如上,可以看到,JQuery配置了:编码格式、缩进风格等
75+
As in the above example, JQuery is configured: encoding format, indentation style, etc.
76+
7377

78+
## Where are these files stored?
7479

75-
## 在哪里存放配置文件
76-
当打开一个文件时,`editorconfig`插件会在打开文件的目录和其每一级父目录查找.`editorconfig`文件,直到有一个配置文件`root=true`
80+
When opening a file, EditorConfig plugins look for a file named `.editorconfig` in the directory of the opened file and in every parent directory. A search for .editorconfig files will stop if the root filepath is reached or an EditorConfig file with `root=true` is found.
7781

78-
如果一个工程中出现多个配置文件,EditorConfig配置文件的读取层级是自上而下的,最深层的配置文件,最后读取。配置规则也是 按照读取的顺序来生效,所以路径上离代码最近的配置规则,优先级最高。
82+
EditorConfig files are read top to bottom and the most recent rules found take precedence. Properties from matching EditorConfig sections are applied in the order they were read, so properties in closer files take precedence.
7983

80-
相对于其他开发工具(如vscode),HBuilderX对editorconfig更完善。在其他工具中,项目外层如果有editorconfig文件,也会影响这个项目,经常让人莫名其妙。HBuilderX没有这个bug。
8184

85+
## File Format Details
86+
87+
EditorConfig files use an `INI` format that is compatible with the format used by Python ConfigParser Library, but [ and ] are allowed in the section names.
88+
89+
The section names are filepath globs (case sensitive), similar to the format accepted by gitignore. Only forward slashes (`/`, not backslashes) are used as path separators and octothorpes (`#`) or semicolons (`;`) are used for comments.
90+
91+
Comments should go on their own lines. EditorConfig files should be `UTF-8` encoded, with either `CRLF` or `LF` line separators.
8292

83-
## 文件格式详情
84-
`editorconfig`文件使用INI格式(译注:请参考维基百科),目的是可以与Python ConfigParser Library兼容,但是允许在分段名(译注:原文是section names)中使用“and”。
85-
分段名是全局的文件路径,格式类似于`gitignore`。斜杠`/`作为路径分隔符,`#`或者`;`作为注释。注释应该单独占一行。`editorconfig`文件使用`UTF-8`格式、`CRLF``LF`作为换行符。
93+
### Wildcard Patterns
8694

87-
### 通配符
88-
| 通配符 | 说明 |
89-
| ---------- | ------------------------------------ |
90-
| * | 匹配除/之外的任意字符串 |
91-
| ** | 匹配任意字符串 |
92-
| | 匹配任意单个字符 |
93-
| [name] | 匹配name字符 |
94-
| [!name] | 匹配非name字符 |
95-
| {s1,s3,s3} | 匹配任意给定的字符串(0.11.0起支持) |
95+
| Wildcard Patterns | Description |
96+
| ---------- | ------------------------------------ |
97+
| * | Matches any string of characters, except path separators (/) |
98+
| ** | Matches any string of characters |
99+
| | Matches any single character |
100+
| [name] | Matches any single character in name |
101+
| [!name] | Matches any single character not in name |
102+
| {s1,s3,s3} | Matches any of the strings given (separated by commas) (Available since EditorConfig Core 0.11.0) |
103+
|{num1..num2} |Matches any integer numbers between num1 and num2, where num1 and num2 can be either positive or negative|
96104

97-
特殊字符可以用`\`转义,以使其不被认为是通配符。
105+
**Notes:** Special characters can be escaped with a backslash so they won't be interpreted as wildcard patterns.
98106

99-
### 支持的属性
107+
### Supported Properties
100108

101-
| 属性说明 | 说明 |
102-
| ------------------------ | ------------------------------------------------------------ |
103-
| indent_style | tab为hard-tabs,space为soft-tabs |
104-
| indent_size | 设置整数表示规定每级缩进的列数和soft-tabs的宽度(译注:空格数)。如果设定为tab,则会使用tab_width的值(如果已指定) |
105-
| tab_width | 设置整数用于指定替代tab的列数。默认值就是indent_size的值,一般无需指定。 |
106-
| end_of_line | 定义换行符,支持lf、cr和crlf。 |
107-
| trim_trailing_whitespace | 设为true表示会除去换行行首的任意空白字符,false反之 |
108-
| insert_final_newline | 设为true表明使文件以一个空白行结尾,false反之 |
109-
| root | 表明是最顶层的配置文件,发现设为true时,才会停止查找.`editorconfig`文件。 |
109+
| Properties | Description |
110+
| ------------------------| ------------------------------------------------------------ |
111+
| indent_style | set to tab or space to use hard tabs or soft tabs respectively. |
112+
| indent_size | a whole number defining the number of columns used for each indentation level and the width of soft tabs (when supported). When set to tab, the value of tab_width (if specified) will be used. |
113+
| tab_width | a whole number defining the number of columns used to represent a tab character. This defaults to the value of indent_size and doesn't usually need to be specified. |
114+
| end_of_line | set to lf, cr, or crlf to control how line breaks are represented. |
115+
|charset |set to latin1, utf-8, utf-8-bom, utf-16be or utf-16le to control the character set. |
116+
| trim_trailing_whitespace| set to true to remove any whitespace characters preceding newline characters and false to ensure it doesn't. |
117+
| insert_final_newline | set to true to ensure file ends with a newline when saving and false to ensure it doesn't. |
118+
| root | special property that should be specified at the top of the file outside of any sections. Set to true to stop .editorconfig files search on current file. |
110119

111-
### 注意
120+
### Notes
112121

113-
1. 在HBuilderX内, 所有的属性名和属性值对`大小写敏感`。通常,如果没有明确指定某个属性,则会使用编辑器的配置,而`editorconfig`不会处理。
114-
2. 推荐不要指定某些`editorconfig`属性。比如,tab_width不需要特别指定,除非它与`indent_size`不同。同样的,当`indent_style`设为`tab`时,不需要配置`indent_size`,这样才方便阅读者使用他们习惯的缩进格式。另外,如果某些属性并没有规范化(比如`end_of_line`),就最好不要设置它。
115-
3. 如果你不需要editorconfig的功能,可以在工具-设置中关闭这个功能。
122+
1. Currently all properties and values are case-insensitive. They are lowercased when parsed. Generally, if a property is not specified, the editor settings will be used, i.e. EditorConfig takes no effect on that part.
123+
2. It is acceptable and often preferred to leave certain EditorConfig properties unspecified. For example, tab_width need not be specified unless it differs from the value of `indent_size`. Also, when indent_style is set to tab, it may be desirable to leave `indent_size` unspecified so readers may view the file using their preferred indentation width. Additionally, if a property is not standardized in your project (`end_of_line` for example), it may be best to leave it blank.
124+
3. If you don't need the function of editorconfig, you can turn off this function in [Settings].
116125

117-
## 启用或关闭editorconfig配置
126+
## HBuilderX editorconfig configuration
118127

119-
在【设置】中,有个editorconfig开关,您可以自由选择开启与关闭`.editorconfig`
128+
In HBuilderX [Settings], there is an editorconfig switch, you can freely choose to turn on or off `.editorconfig`
120129

121-
<img src="/static/snapshots/tutorial/editorconfig.png" />
130+
<img src="/static/snapshots/tutorial/settings/editorconfig_en.png" style="zoom: 45%;border: 1px solid #eee; border-radius: 10px;" />
122131

123132

en/Tutorial/UserGuide/fold.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
# 折叠
22

3-
折叠的快捷键是`alt+-``=`
3+
折叠的快捷键是`alt+-``=`
44

5-
在菜单跳转-折叠里,还有更多折叠的玩法,其中有一个功能非常有用,就是“折叠其他选区”,快捷键是`Alt+Shift+o`
5+
或点击`行号`右边的`-``+`,即可完成折叠展开。
6+
7+
## 顶部折叠菜单
8+
9+
在菜单跳转-折叠里,还有更多折叠的玩法。
10+
11+
<img src="/static/snapshots/tutorial/fold/fold_menu.png" style="border: 1px solid #eee; border-radius: 15px; zoom: 48%;"/>
12+
13+
## 编辑器折叠菜单
14+
15+
如下图所示,在`行号`区域右击,即可看到折叠相关的菜单。
16+
17+
<img src="/static/snapshots/tutorial/fold/fold_menu_for_editor.png" style="border: 1px solid #eee; border-radius: 15px; zoom: 48%;"/>
18+
19+
## 折叠其他选区
20+
21+
其中有一个功能非常有用,就是“折叠其他选区”,快捷键是`Alt+Shift+o`
622

723
比如在本markdown文档源码编辑时,按下`Alt+Shift+o`就可以把其他段落都折叠起来,专注于当前段落的编写。
824

9-
<img src="/static/snapshots/tutorial/fold.png" style="border: 1px solid #eee; zoom: 48%;"/>
25+
<img src="/static/snapshots/tutorial/fold/fold.png" style="border: 1px solid #eee; zoom: 48%;"/>

en/Tutorial/setting.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@
6161
- 智能计算制表符长度
6262
- 编辑器向下滚动一屏
6363

64+
## Sync with editor
65+
66+
<p>项目管理器,右上角,点击 <svg t="1631502274114" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="24803" width="14" height="14"><path d="M873.8304 552.96h-737.28c-22.528 0-40.96-18.432-40.96-40.96s18.432-40.96 40.96-40.96h737.28c22.528 0 40.96 18.432 40.96 40.96s-18.432 40.96-40.96 40.96zM873.8304 307.2h-737.28c-22.528 0-40.96-18.432-40.96-40.96s18.432-40.96 40.96-40.96h737.28c22.528 0 40.96 18.432 40.96 40.96s-18.432 40.96-40.96 40.96zM873.8304 798.72h-737.28c-22.528 0-40.96-18.432-40.96-40.96s18.432-40.96 40.96-40.96h737.28c22.528 0 40.96 18.432 40.96 40.96s-18.432 40.96-40.96 40.96z" p-id="24804" fill="#707070"></path></svg> 图标</svg>,即可设置编辑器同步功能</p>
67+
68+
<img src="/static/snapshots/tutorial/settings/sync.png" style="zoom: 50%;border: 1px solid #eee;" />
69+
70+
6471
## 源码视图常见问题
6572

6673
HBuilderX启动时,会加载`设置配置文件`, 文件损坏(文件格式错误,非json格式),会导致HBuilderX无法启动。

en/_sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* [Plugins Install](Tutorial/PluginsInstall.md)
1212
* User Guide
1313
* [Skill](/Tutorial/UserGuide/skill.md)
14+
* [editorconfig](/Tutorial/UserGuide/editorconfig.md)
1415
* Languages
1516
* [Overview](/Tutorial/Language/Overview.md)
1617
* [CodeAssistant](/Tutorial/Language/CodeAssistant.md)
File renamed without changes.
41 KB
Loading
210 KB
Loading

0 commit comments

Comments
 (0)