本文为自用,仅供参考
必备:
beauty(代码格式化,支持主流语言)
Bracket Pair Colorizer(彩色括号,拯救你于重重调用)
chinese(汉化)
前端
Auto Close Tag
Auto rename Tag
HTML Snippets
color info
JavaScript (ES6) code snippets
open in browser
eslint
其它常用:
Code Runner:右键即可编译运行单文件,很方便
风格主题:
ayu
深海主题 Material Theme
吸血鬼主题 Dracula Official
One Dark Pro
设置背景图片[此插件修改通过vscode实现,小概率可能会导致vscode崩掉]:
插件:background
相关配置项:
background-size 参数的第一个设置背景图大小
opacity 设置背景图透明度,推荐0.1,可根据图片适当调整。
文件路径使用 ‘/’ 代替‘’避免转义。
/// background背景配置项
"files.eol": "\n",
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", // formatting only supports LF line endings
"update.enableWindowsBackgroundUpdates": true,
"background.customImages": [
? "file:///D:/code/workspvode/bgimg/孤独小镇.jpg"//图片地址
],
"background.style": {
? "content":"‘‘",
? "pointer-events":"none",
? "position":"absolute",//图片位置
? "width":"100%",
? "height":"100%",
? "z-index":"99999",
? "background.repeat":"no-repeat",
? "background-size":"100%,25%",//图片大小
? "opacity":0.1 //透明度
},
"background.useFront": true,
"background.useDefault": false,//是否使用默认图片
}
插件同步:
setting sync
python:
cmd中执行以下命令:
pip install -U pylint --user
pip install flake8
tips:python通过pip安装库时可通过使用国内镜像加速。
eg:pip install flask ==>pip install flask -i https://pypi.douban.com/simple/
go:
\1. 设置好环境变量go mod,goproxy,gopath,并且把%GOPATH\bin%加入path。
\2. 安装go插件(微软官方)
\3. ctrl + shift + p ,选择Go:Install/Update Tools,选择所有并下载。
Go自定义代码段Demo(需要设置"editor.snippetSuggestions": "top",):
"editor.acceptSuggestionOnEnter": false,--> 此选项建议关闭
? "fmt.Println": {
? "prefix": "pln",
? "body": [
? "fmt.Println($1)",
? ],
? "description": "Log output to console"
},
"err 快速处理": {
? "prefix": "herr",
? "body": [
? "if err != nil{",
? "\tfmt.Printf("$1,error:%v",err)",
? "}"
? ],
? "description": "快速err处理"
},
Vscode Setting示例:https://github.com/lonely-root-number2/dotfiles/blob/master/vscode/settings.json
c/c++:
C/C++(Microsoft)
C/C++ Clang Command Adapter:提供静态检测(Lint),很重要
Include Autocomplete
常用全局代码片段Demo:
"go: HelloWorld": {
? "scope": "go",
? "prefix": "headergo",
? "body": [
? "package main",
? "//Create Date:$CURRENT_YEAR $CURRENT_MONTH_NAME $CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND $CURRENT_DAY_NAME_SHORT",
? "//Auther:DY",
? "//Desc:$1",
? "//@Email:XX",
? "\n",
? "func main(){",
? "\n",
? "}"
? ],
? "description": "GO 快速开始"
},
"java: HelloWorld": {
? "scope": "java",
? "prefix": "headerjava",
? "body": [
? "//Create Date:$CURRENT_YEAR $CURRENT_MONTH_NAME $CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND $CURRENT_DAY_NAME_SHORT",
? "//Auther:DY",
? "//Desc:$1",
? "//@Email:XX",
? "\n",
? "public class $TM_FILENAME_BASE{",
? "\tpublic static void main(String[] args) {\n\t\tSystem.out.println("Hello World");\n\t}"
? "}"
? ],
? "description": "Java 快速开始"
},
"c: HelloWorld":{
? "scope": "c",
? "prefix": "headerc",
? "body": [
? "//Create Date:$CURRENT_YEAR $CURRENT_MONTH_NAME $CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND $CURRENT_DAY_NAME_SHORT",
? "//Auther:DY",
? "//Desc:$1",
? "//@Email:XX",
? "\n",
? "#include <stdio.h>\n",
? "int main(){",
? "\t$1",
? "\treturn 0;",
? "}"
? ],
? "description": "C 快速开始"
},
"Python: HelloWorld":{
? "scope": "python",
? "prefix": "headerpython",
? "body": [
? "#Create Date:$CURRENT_YEAR $CURRENT_MONTH_NAME $CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND $CURRENT_DAY_NAME_SHORT",
? "#Auther:DY",
? "#Desc:$1",
? "#@Email:XX",
? "\n",
? "$2",
? ],
? "description": "Python 头文件"
}
}
文件图标推荐:
vscode-icon
ayu
material icon
路径补全:
Path Intellisense
music:
vsc-netease-music
快速翻译插件:
x-translator
打字输入特效[贼炫,但可能会卡]:
power mode
个人推荐的快捷键配置:
以下快捷键名称为安装了Chinese插件后的。
触发参数提示:Ctrl + T Ctrl + S (提示[ti shi])
触发建议:Ctrl + N (同Vim)
向上/下复制行:Shift + Alt + UpArrow/DownArrow
向上/下移动行: Alt + UpArrow
文件:聚焦到资源管理器试图:ctrl + alt + 1
终端:聚焦到上方编辑器组:ctrl + alt + 2
终端:聚焦到终端:ctrl + alt + 3
cursorhome/cursorend ==> ctrl + ;/ctrl + ' (回车左侧俩)
以下为其它常用快捷键,但推荐使用默认
删除行 ctrl + k
在下面插入行 ctrl + enter
移动
复制
剪切
格式化文档 alt + shift +f
切换行注释 ctrl + /
代码行缩进 ctrl + [ ]
删除光标右侧的所有字 ctrl + delete
多行编辑(列编辑) alt + (shift) +鼠标左键
扩展/缩小选取范围: Shift+Alt+Left 和 Shift+Alt+Right
移动到定义处: F12 / ctrl + 鼠标左键
定义处缩略图:只看一眼而不跳转过去 Alt+F12
Lorem(乱数假文):
Lorem ipsum(使用参考介绍)
鼓励师:
xx鼓励师
其它:
Files:Auto Save选项推荐afterDelay
彻底卸载并且删除用户数据,删除以下两个目录:
C:Users{user}AppDataRoamingCode和C:Users{user}.vscode
以上为个人经验,如有错误,欢迎讨论。禁止任何形式转载
原文:https://www.cnblogs.com/dexte/p/12337237.html