VSCode 中 Json 文件介绍

发布时间 2023-11-14 12:27:46作者: 若澧风

Visual Studio Code 官方文档

1. Json 配置文件

Editing JSON with Visual Studio Code

settings.json 分类

  • defaultsettings.json : 只读格式,相当于官方的参考文档;
  • settings.json: 自定义形式,优先级大于默认的 settings.json 文件,ctrl+shift+o 查看默认提供的格式,而后自定义新的形式;
    • 用户设置的 settings.jsonC:\Users\Administrator\AppData\Roaming\Code\User
    • 工作目录设置的 settings.json:优先级最高;

UI 界面和 Code 界面切换按钮

1.1 基本配置

ctrl+shift+o 输入 editor.mouseWheelZoom 可直接查看

    // ctrl+滚轮缩放设置
    "editor.mouseWheelZoom": true,
    // 关闭右侧的缩略图显示
    "editor.minimap.enabled": false,
    // vim 操作的粘贴操作可传递到系统剪贴板上
    "vim.useSystemClipboard": true,

1.2 终端配置

Terminal Profiles

Vim 操作 | ctrl+shift+o: terminal.integrated.profiles.windows

default terminal profile on Windows

	// The default terminal profile on Windows.
	//  - null: Automatically detect the default
	//  - PowerShell: $(terminal-powershell) PowerShell
	// - path: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
	//  - Windows PowerShell: $(terminal-powershell) Windows PowerShell
	// - path: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
	//  - Git Bash: $(terminal) Git Bash
	// - path: D:\\Git\bin\bash.exe
	// - args: ['--login','-i']
	//  - Command Prompt: $(terminal-cmd) Command Prompt
	// - path: C:\WINDOWS\System32\cmd.exe
	// - args: []
	//  - Ubuntu-20.04 (WSL): $(terminal-ubuntu) Ubuntu-20.04 (WSL)
	// - path: C:\WINDOWS\System32\wsl.exe
	// - args: ['-d','Ubuntu-20.04']
	//  - JavaScript Debug Terminal: $($(debug)) JavaScript Debug Terminal
	// - extensionIdentifier: ms-vscode.js-debug
	"terminal.integrated.defaultProfile.windows": null,

terminal.integrated.profiles.windows

// terminal.integrated.profiles.windows 中的设置
	"terminal.integrated.profiles.windows": {
		"PowerShell": {
			"source": "PowerShell",
			"icon": "terminal-powershell"
		},
		"Command Prompt": {
			"path": [
				"${env:windir}\\Sysnative\\cmd.exe",
				"${env:windir}\\System32\\cmd.exe"
			],
			"args": [],
			"icon": "terminal-cmd"
		},
		"Git Bash": {
			"source": "Git Bash"
		}
	},

// 移除指定的终端类型
  "terminal.integrated.profiles.windows": {
    "Git Bash": null
  }