vscode 使用

目录

[Settings]

1、vscode显示120字符或者80字符提示线

[Extensions]

[1、 git commit message helper](#1、 git commit message helper)


[Settings]

1、vscode显示120字符或者80字符提示线

1、 File -> Preferences -> Settings

2、 Search settings:editor:rulers

3、setting.json 文件中配置 "editor:rulers"

javascript 复制代码
"editor.rulers": [        
    { "column": 80, "color": "#00ff4c" },
    { "column": 100, "color": "#ff00ff" },
    { "column": 120, "color": "#ff0000" }
]

4、语句长度

一条常见但有点过时的规则,就是语句长度应限制在80个字符以内,理由如下。

■ 超过80个字符的语句很难读。

■ 80个字符的限制不鼓励深度嵌套。

■ 长于80字符的语句行在8.5×11英寸规格纸张上放不下,特别是当一面打印

两栏代码时(每张物理输出页面打印两页代码)。

有了大幅面的显示器、窄的字体和横向打印模式,80个字符/行的限制日益显

得武断了。一行上有90个字符常比为避免超出80个字符将其拆分为两行要容易

读得多。

常见的代码行长度限制为 80 或 120 字符,具体根据公司团队、项目类型,可以定制不同编码规范。

[Extensions]

1、 git commit message helper

Git commit message helper - Visual Studio Marketplace

1、install

2、使用

使用一:

  • main: Added

</> main: Fixed

|| main: Removed

<- -> main: Updated

使用二:

Ctrl + Shift + P 搜索> git prefix

3、Type

|----------|-------------------------------------------------------------------------------------------------------------|
| feat | A new feature |
| fix | A bug fix |
| docs | Documentation only changes |
| style | Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) |
| refactor | A code change that neither fixes a bug nor adds a feature |
| perf | A code change that improves performance |
| test | Adding missing tests or correcting existing tests |
| build | Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) |
| ci | Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) |
| chore | Other changes that don't modify src or test files |
| revert | Reverts a previous commit |
| | |

相关推荐
时空自由民.5 小时前
vim入门配置教程
编辑器·vim·excel
zh_xuan7 小时前
解决VS Code 控制台中文乱码
c++·vscode·乱码
周末也要写八哥7 小时前
Eclipse 2024全流程网盘下载与安装配置教程详解
java·ide·eclipse
猿儿本无心8 小时前
快速搭建Python项目(Vscode+uv+FastAPI)
vscode·python·uv
ChampaignWolf11 小时前
在 Eclipse 中使用 Tabnine
java·ide·eclipse
π同学12 小时前
ESP-IDF+vscode开发ESP32第十二讲——event
vscode·esp32·事件循环库event
诗水人间13 小时前
VsCode 中使用Copilot调用Deepseek V4模型
ide·vscode·copilot
梦想家加一13 小时前
vscode为什么下载了汉化插件却不生效
ide·vscode·编辑器
神码编程14 小时前
【Unity】MiniGame编辑器小游戏(十五)中国象棋局域网对战【Chinese Chess】(上)
unity·编辑器·游戏引擎·小游戏
NiceCloud喜云15 小时前
Claude API 流式输出(SSE)实战:从打字机效果到工具调用全流程
java·前端·ide·人工智能·chrome·intellij-idea·状态模式