配置

打开 vscode

打开菜单栏[文件]—>[首选项]—>[设置]—>打开设置(settings.json)

基础配置如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
// 底部状态栏
"workbench.colorCustomizations": {
"statusBar.background": "#1A1A1A",
"statusBar.noFolderBackground": "#0A0A0D",
"statusBar.debuggingBackground": "#511f1f"
},
//缩进2格
"editor.tabSize": 2,
//缩进格数不被重写
"editor.detectIndentation": false,
//配置git路径(win)
"terminal.integrated.defaultProfile.windows": "Git-Bath",
"terminal.integrated.profiles.windows": {
"Git-Bath": {
"path": "D:\\Git\\bin\\bash.exe",
"args": []
}
},
//保存自动格式化
"editor.formatOnSave": false,
//自动保存
"files.autoSave": "afterDelay"
}

Vscode 主题字体

1
2
3
4
5
6
//主题发光
"vscode_custom_css.imports": [
"file:///E:/css/synthwave84.css"
],
//字体顺序
"editor.fontFamily": "Consolas,Microsoft Yahei, 'Courier New', monospace"

css 文件地址

安装 Custom CSS and JS Loader 扩展样式插件

ctrl+shift+P 打开插件命令设置

输入命令 Enable Custom CSS and JS 重启生效

安装Fix VSCode Checksums 插件 输入Fix Checksums: Apply 去掉 code 安装似乎损坏。请重新安装。提示

效果
setting

格式化

Prettier - Code formatter
代码格式化

打字特效

教程

Power Mode

设置中搜索(文件—>首选项—>设置)

  1. 启用 powermode.enable

  2. 抖动powermode—>shake 找到Shake intensity 改为 0 去掉抖动

  3. 更换特效powermode—>General 找到Presets 下拉选择需要的特效

背景色透明

Windows opacity

卡顿提速

  1. 打开命令面板(ctrl+shift+P) (cmnd+shift+p)
  2. 输入 Preferences: Configure Runtime Arguments
  3. 添加 “disable-hardware-acceleration”: true
  4. 重启

配置 setting.json

"winopacity.opacity": 240, 100 ~ 255 就能看见

远程控制

所需插件

Remote-SSH

Remote-SSH: Editing Configuration Files

Remote Explorer

无需服务器密码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Host 中文名称
HostName 服务地址
User root

Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa

Host github.com
User 邮箱.com
HostName ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
  1. 打开用户C:\Users\wecy\.ssh路径,记事本打开id_rsa.pub文件 复制内容(要先生成密钥 ssh-keygen -t rsa -C “用户名”)

  2. 服务器进入~/.ssh/ 用 xshell 文件管理打开authorized_keys文件 复制密钥内容

~/.ssh/ /root/.ssh

可选配置

1
2
3
4
5
6
Host dev
HostName xx.cmtspace.cn
User root
Port 22
PreferredAuthentications publickey
IdentityFile "C:\Users\wecy\.ssh\id_rsa"

卸载

  1. 卸载 vscode 软件

  2. 删除没卸干净的配置信息和插件

    • 删除C:\Users\wecy\.vscode本地插件文件夹
    • 删除C:\Users\wecy\AppData\Roaming\Code本地缓存
  3. 重新安装

方法二:原理同方法一

  1. win + r 打开运行 %appdata% 回车
  2. 删除 Code 和 Visual Studio Code 文件夹
  3. 地址栏输入 %userprofile% 回车
  4. 删除 .vscode 文件夹

同步

注:设置同步配置失败,要用管理员身份运行 vscode