111. Vscode

插件列表

插件名 用途
C/C++
Chinese (Simplified)
Code Runner
highlight-words
indent-rainbow
IntelliCode
IntelliCode API Usage Examples
LaTeX Workshop
One Dark Pro
Path Intellisense
Power Mode
Python
Remote - SSH
Vim
vscode-icons

卸载

1、退出vscode

2、删除配置文件

1
2
3
sudo rm -rf $HOME/Library/Application\ Support/Code
# if you're using insider*
sudo rm -rf $HOME/Library/Application\ Support/Code\ -\ Insiders/

或者

1
2
3
4
5
6
7
sudo rm -rf $HOME/Library/Preferences/com.microsoft.VSCode.helper.plist
sudo rm -rf $HOME/Library/Preferences/com.microsoft.VSCode.plist
sudo rm -rf $HOME/Library/Caches/com.microsoft.VSCode
sudo rm -rf $HOME/Library/Caches/com.microsoft.VSCode.ShipIt/
sudo rm -rf $HOME/Library/Application\ Support/Code/
sudo rm -rf $HOME/Library/Saved\ Application\ State/com.microsoft.VSCode.savedState/
sudo rm -rf $HOME/.vscode/

3、删除扩展插件

1
2
3
sudo rm -rf $HOME/.vscode
# if you're using insider*
sudo rm -rf $HOME/.vscode-insiders/

4、从应用中删除vscode(如果存在的话,如果直接解压后使用似乎不用做)

5、卸载所有vscode系统配置

6、重新下载vscode安装

1
sudo rm -rf $HOME/.vscode

删除云端配置

设置代码模板:自动生成文件名、作者、创建日期等信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"pyheader": {
"prefix": "test",
"body": [
"/**",
"* @author: test",
"* @desc:$1",
"* @date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
"* @Email:test@qq.com",
"* @url:test.com",
"*/",
"",
""
],
"description": "test"
}
}
  1. 打开 vs­code 在左下角设置图标 -> 用户代码片段
  2. For_Loop: 当前 snip­pet 名字。
  3. pre­fix: 前缀,代码块使用快捷方式;键入前缀,按 tab 键,代码块就会被使用。
  4. body: 代码块内容;换行使用 rn。
  5. de­scrip­tion: 键入前缀,vs­code 感知到前缀,显示的说明内容。
  6. $1,$2,$0: 指定代码模块生成后,编辑光标出现位置;使用 Tab 键进行切换 (编辑光标按 $1,$2,$3...$0 的顺序跳转),$0 是光标最后可切换位置。

Snippet 语法

Tabstops

$1,$2 指定代码块生成后,光标出现的位置;不同位置的相同 $1 位置同时出现光标。

Placeholders

给光标出现位置加上默认值;例如,${1:an­other\${2:place­holder}}$1 处位置默认值是 an­other

Choice

光标位置设置多个值可供选择;例如,${1|one,two,three|}$1 位置处可以选择 one,two,three 中一个词填充在此处。

Variables

  1. 常用变量

    • TM_SELECTED_TEXT 当前选中内容或空字符串
    • TM_CURRENT_LINE 当前行内容
    • TM_CURRENT_WORD 光标处字符或空字符串
    • TM_LINE_INDEX 从 0 开始的行号
    • TM_LINE_NUMBER 从 1 开始的行号
    • TM_FILENAME 当前被编辑文档名
    • TM_FILENAME_BASE 当前被编辑文档名,没有后缀
    • TM_DIRECTORY 当前被编辑文档目录
    • TM_FILEPATH 当前被编辑文档全路径
    • CLIPBOARD 当前剪切板内容
    • WORKSPACE_NAME 打开的工作空间或文件夹的名称
  2. 日期和时间相关变量

    • CURRENT_YEAR 当前年
    • CURRENT_YEAR_SHORT 当前年后两位
    • CURRENT_MONTH 月份,两位数字表示,例如 02
    • CURRENT_MONTH_NAME 月份全称,例如’July’
    • CURRENT_MONTH_NAME_SHORT 月份简写 ,例如’Jul
    • CURRENT_DATE 某天
    • CURRENT_DAY_NAME 星期几, 例如’Monday’
    • CURRENT_DAY_NAME_SHORT 星期几的简写, ‘Mon’
    • CURRENT_HOUR 小时,24 小时制
    • CURRENT_MINUTE 分钟
    • CURRENT_SECOND 秒数
    • CURRENT_SECONDS_UNIXUnix 时代以来的秒数

VsCode-Terminal 设置

部分设置

1
2
3
4
"workbench.colorCustomizations" : {
"terminal.foreground" : "#00FD61",
"terminal.background" : "#383737"
}

完整设置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"workbench.colorCustomizations": {
"terminal.background": "#181818",
"terminal.foreground": "#D8D8D8",
"terminalCursor.background": "#D8D8D8",
"terminalCursor.foreground": "#D8D8D8",
"terminal.ansiBlack": "#181818",
"terminal.ansiBlue": "#7CAFC2",
"terminal.ansiBrightBlack": "#585858",
"terminal.ansiBrightBlue": "#7CAFC2",
"terminal.ansiBrightCyan": "#86C1B9",
"terminal.ansiBrightGreen": "#A1B56C",
"terminal.ansiBrightMagenta": "#BA8BAF",
"terminal.ansiBrightRed": "#AB4642",
"terminal.ansiBrightWhite": "#F8F8F8",
"terminal.ansiBrightYellow": "#F7CA88",
"terminal.ansiCyan": "#86C1B9",
"terminal.ansiGreen": "#A1B56C",
"terminal.ansiMagenta": "#BA8BAF",
"terminal.ansiRed": "#AB4642",
"terminal.ansiWhite": "#D8D8D8",
"terminal.ansiYellow": "#F7CA88"
}

用户配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
{
//{{{> begin

/// workplace
// file
// 自动保存选项
"files.autoSave": "onWindowChange",
"files.autoGuessEncoding": true,
// editor
"editor.fontSize": 15.5,
"editor.suggestSelection": "recentlyUsedByPrefix",
"editor.inlayHints.fontFamily": "JetBrainsMono Nerd Font, JetBrains Mono, MesloLGS NF, Menlo, Monaco, Courier New, monospace",
"editor.snippetSuggestions": "inline",
"editor.fontFamily": "JetBrainsMono Nerd Font, JetBrains Mono, MesloLGS NF, Menlo, Monaco, Courier New, monospace, Menlo for Powerline",
"editor.wordWrap": "on",
"editor.quickSuggestionsDelay": 10,
// 自动修正格式
"editor.formatOnType": false,
"editor.cursorWidth": 4,
"diffEditor.wordWrap": "on",
// workbench
"workbench.colorTheme": "One Dark Pro",
"workbench.iconTheme": "vscode-icons",
"workbench.sideBar.location": "right",
"workbench.startupEditor": "none",
"workbench.colorCustomizations": {
"editorCursor.foreground": "#ff6347",
"terminalCursor.foreground": "#ff6347"
},
// 资源管理器排列方式
"explorer.sortOrder": "foldersNestsFiles",
// update 发行说明
"update.showReleaseNotes": false,
// 关闭工作区信任
"security.workspace.trust.enabled": false,
// 在文件和文件夹上显示错误和警告
"problems.decorations.enabled": false,
// 选项卡是否应在多行之间换行
"workbench.editor.wrapTabs": true,

/// abundant
// "editor.formatOnPaste": true, // 粘贴自动修正格式
// "files.trimTrailingWhitespace": true, // 自动删除尾随空格
// "files.trimFinalNewlines": true, // 自动删除空行
// "workbench.editor.decorations.colors":false,

/// terminal
"terminal.integrated.inheritEnv": true,
"terminal.integrated.fontSize": 16,
"terminal.integrated.fontFamily": "JetBrains Nerd Font, DroidSansMono Nerd Font, MesloLGS NF",
"terminal.integrated.cursorWidth": 4,

/// powermode
"powermode.enabled": true,
"powermode.presets": "particles",
"powermode.shake.enabled": false,
"powermode.combo.counterEnabled": "hide",
"powermode.combo.timerEnabled": "hide",

/// python
// "python.defaultInterpreterPath": "~/anaconda3/bin/python",
"python.languageServer": "Default",
"python.defaultInterpreterPath": "~/anaconda3/bin/python",
// "python.linting.enabled": false,

/// cpp
"C_Cpp.errorSquiggles": "disabled",
"C_Cpp.intelliSenseEngine": "default",
"C_Cpp.intelliSenseUpdateDelay": 500,
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Attach, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 80, AccessModifierOffset: -4 }",
"C_Cpp.suggestSnippets": false,

/// leetcode
"settingsSync.ignoredExtensions": [
"leetcode.vscode-leetcode"
],

/// Doxygen
"doxdocgen.generic.authorName": "<username>",
"doxdocgen.generic.authorEmail": "<usermail>",
"doxdocgen.generic.order": [
"brief",
"empty",
"tparam",
"param",
"return",
],
"doxdocgen.file.versionTag": "@version 1.0",
"doxdocgen.generic.dateFormat": "YYYY-MM-DD HH:MM:SS",

/// git
// "git.ignoreMissingGitWarning": true,

/// vim
"vim.useSystemClipboard": true,
"vim.replaceWithRegister": true,
// "vim.visualstar": true,
"vim.mouseSelectionGoesIntoVisualMode": false,
"editor.cursorBlinking": "solid",
// Use key mappings from a `.vimrc` file.
"vim.vimrc.enable": true,
// Path to a Vim configuration file. If unset, it will check for `$HOME/.vscodevimrc`, `$HOME/.vimrc`, `$HOME/_vimrc`, and `$HOME/.config/nvim/init.vim`, in that order.
"vim.vimrc.path": "~/.vimrc",

/// incedent-rainbow
// Using the light mode
"indentRainbow.indicatorStyle": "light",
// we use a simple 1 pixel wide line
"indentRainbow.lightIndicatorStyleLineWidth": 2,
// the same colors as above but more visible
"indentRainbow.colors": [
"rgba(255,255,64,0.3)",
"rgba(127,255,127,0.3)",
"rgba(255,127,255,0.3)",
"rgba(79,236,236,0.3)"
],

/// latex
// 使用内置pdf浏览器预览pdf文件
"latex-workshop.view.pdf.viewer": "tab",
// tex文件时禁止自动编译
"latex-workshop.latex.autoBuild.run": "never",
// 隐藏在编译出现错误或警告时自动弹出的提示窗口
"latex-workshop.message.error.show": false,
"latex-workshop.message.warning.show": false,
// 启用或禁用自动提示功能
"latex-workshop.intellisense.package.enabled": true,
// 启用或禁用数学符号的自动提示功能。
"latex-workshop.intellisense.unimathsymbols.enabled": true,
// 配置自动提示的更新延迟时间
"latex-workshop.intellisense.update.delay": 0,
"latex-workshop.latex.recipe.default": "lastUsed",
// 自动清理
"latex-workshop.latex.autoClean.run": "onBuilt",
// 发行版的可执行文件路径
// "latex-workshop.latex.path":
// 将编译工具配置添加到用户设置中
"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"%DOC%"
]
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
},
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}
],
// 编译方案配置
"latex-workshop.latex.recipes": [
{
"name": "XeLaTeX",
"tools": [
"xelatex"
]
},
{
"name": "latexmk",
"tools": [
"latexmk"
]
},
{
"name": "PDFLaTeX",
"tools": [
"pdflatex"
]
},
{
"name": "BibTeX",
"tools": [
"bibtex"
]
},
{
"name": "pdflatex -> bibtex -> pdflatex*2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
},
{
"name": "xelatex -> bibtex -> xelatex*2",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
},
{
"name": "xelatex*2",
"tools": [
"xelatex",
"xelatex"
]
}
],
// 编译后自动清理多余文件
"latex-workshop.latex.clean.fileTypes": [
"*.aux",
"*.bbl",
"*.blg",
"*.idx",
"*.ind",
"*.lof",
"*.lot",
"*.out",
"*.toc",
"*.acn",
"*.acr",
"*.alg",
"*.glg",
"*.glo",
"*.gls",
"*.ist",
"*.fls",
"*.log",
"*.fdb_latexmk",
"*.pdfsync"
],

// "vsicons.dontShowNewVersionMessage": true,

//<}}} end

}