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 |
| | |

相关推荐
golang学习记6 小时前
VSCode AI新特性:HydraFusion来了:系统会自己组队干活
ide·人工智能·vscode
文祐15 小时前
下载Visual Studio 2017 Build Tools version 15.9
ide·visual studio
golang学习记17 小时前
Jetbrains 正式官宣:全新AI IDE正式发布!
ide·人工智能·intellij-idea·air
mklpo14717 小时前
在win7 sp1 系统上安装最新版 的 Visual Studio Code。2026-10-04
ide·vscode·编辑器
Highcharts.js2 天前
图表开发实战总结| 7 条“黄金法则”与“性能铁律”
前端·javascript·vue.js·编辑器·时序数据库·highcharts
1024奇点2 天前
【仓颉语言入门 · 第24课】
开发语言·ide·开源
广东帝工3 天前
智能防撞进入高增长周期:多技术融合推动桥梁防护从被动硬抗迈向主动预警时代
编辑器
oooost4 天前
Jupyter Notebook 常用快捷键速查
ide·python·jupyter
承渊政道4 天前
Linux系统学习【线程概念与控制核心知识详解】
linux·运维·vscode·学习·ubuntu·线程创建 终止 等待
yqj2344 天前
ESP32-S3中小智项目优化内容
ide·macos·xcode