开发工具重要配置与使用记录

4 minute

TOC

VSCode

Nginx 嵌套问题

  1. 不支持嵌套 IF
  2. 嵌套的 Location 不会应用外层 IF,但是 root、index、add_header 可以应用

Code 命令

1command palette -> shell command -> select: install 'code' command in PATH

配置文件自动换行规则

1"editor.wordWrap": "off"

快速变换:cmd -> wordWrap -> toggle

单独配置 markdown 自动换行:

1"[markdown]": {
2"editor.wordWrap": "on",
3},

当前工作区不显示 .gitignore 中忽略的文件

编辑: .vscode/settings.json:

1{
2    "explorer.excludeGitIgnore": true,
3}

单击文件在新标签页打开

单击文件在新标签页打开 workbench.editor.enablePreview 为 false

使用多标签模式

Windows -> Native Tabs [v]

tabs 多行模式

workbench.editor.wrapTabs [v]

IDEA

自动生成注释

File | Settings | Editor | File and Code Templates | Includes

Add File Header:

1/**
2 * @Author jiangzhh
3 * @Description: 
4 * @Date: Create in ${TIME} ${DATE}
5 */

使用 \n 作为换行符

Editor | Code Style.

From the Line separator list, select the line separator style you want to apply.

选择 Unix and macOS (\n)。

使用 tab 缩进

根据阿里巴巴 Java 开发手册:

【强制】采用 4 个空格缩进,禁止使用 tab 字符。

说明:如果使用 tab 缩进,必须设置 1 个 tab 为 4 个空格。IDEA 设置 tab 为 4 个空格时,请勿勾选 Use tab character;而在 eclipse 中,必须勾选 insert spaces for tabs。

Uncheck:

File > Settings > Editor > Code Style > Java > Tabs and Indents > Use tab character

控制台中文乱码解决

  1. 菜单栏HELP->Edit Custom VM OPtions中加 -Dfile.encoding=utf-8
  2. 重启idea

IDEA 开启RunDashboard

1# .idea/workspace.xml
2
3<component name="RunDashboard">
4    <option name="configurationTypes">
5        <set>
6            <option value="SpringBootApplicationConfigurationType" />
7        </set>
8    </option>
9</component>

IDEA 关闭拼写

1Settings -> Editor -> Inspection -> Proofreading -> 关闭Typo

IDEA 配置快捷输入

1editor -> live template

IDEA 常用快捷键

1alt + 上下键:将当前行移到上或下一层
2
3alt + 左右键:代码阅读必备,回到上或下一层代码

禁用 double shift

对于2021.2.2之前的版本,方法如下:

Ctrl+Shift+A (Mac下为 Comand+Shift+A) => 输入 Registry => 找到 "ide.suppress.double.click.handler" 并勾选,再 Apply 即可。

对于2021.2.2及之后的版本,可以这么做:

菜单栏依次点击 File => Settings => Advanced Settings => User Interface => 勾选 "Disable double modifier key shortcuts",或者打开设置之后搜索 disable,可快速定位。

忽略文件或目录

忽略文件或目录:

Editor -> File Types -> Ignored Files And Folders

忽略目录,并可以方便的显示和隐藏:

  1. 隐藏:右键目录,Mark Directory As -> Excluded
  2. 显示:右键Projects左侧空白处,Tree Apperance -> Show Excluded Files

单击文件不要在新标签页打开

Editor - General - Editor Tabs - Opening Policy - Enable preview tabs [v]