Skip to content

Instantly share code, notes, and snippets.

@LittleNewton
Last active April 30, 2024 16:08
Show Gist options
  • Save LittleNewton/f813f348e4384e1978f6e466d4b33c39 to your computer and use it in GitHub Desktop.
Save LittleNewton/f813f348e4384e1978f6e466d4b33c39 to your computer and use it in GitHub Desktop.
Visual Studio Code 个人配置
/*
* Author: 刘鹏
* Description: 个人 VScode 配置文件
* Create Date: 2020, Apr. 12
* Update Date: 2021, Nov. 6
* Email: littlenewton6@gmail.com
*/
{
// ======================== Editor 设置 BEGIN ========================
"editor.renderWhitespace": "all",
"editor.suggestSelection": "first",
"editor.fontFamily": "'Fira Code', Monaco, Menlo, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.tabSize": 8,
"editor.insertSpaces": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.largeFileOptimizations": true,
"editor.renderControlCharacters": true,
// 配置语言的默认格式化工具
"[html]": {"editor.defaultFormatter": "vscode.html-language-features"},
"[c]": {"editor.defaultFormatter": "ms-vscode.cpptools"},
"[cpp]": {"editor.defaultFormatter": "ms-vscode.cpptools"},
"[javascript]": {"editor.defaultFormatter": "vscode.typescript-language-features"},
"[xml]": {"editor.defaultFormatter": "DotJoshJohnson.xml"},
// ======================== Editor 设置 END ========================
// ======================== LaTeX 设置 BEGIN ========================
// bibtex 格式
"latex-workshop.bibtex-format.tab": "tab",
// 自动编译,全部关闭,当且仅当你认为有需要的时候才会去做编译
"latex-workshop.latex.autoBuild.run": "never",
"latex-workshop.latex.autoBuild.cleanAndRetry.enabled": false,
// 设置 latex-workshop 的 PDF 预览程序,external 指的是外部程序
"latex-workshop.view.pdf.viewer": "external",
"latex-workshop.view.pdf.ref.viewer": "external",
"latex-workshop.view.pdf.external.viewer.command": "D:/Users/newton/Documents/Softwares/software_windows/design/SumatraPDF-3.2-64.exe",
"latex-workshop.view.pdf.external.viewer.args": [
"%PDF%"
],
// 配置正向、反向搜索:.tex -> .pdf
"latex-workshop.view.pdf.external.synctex.command": "D:/Users/newton/Documents/Softwares/software_windows/design/SumatraPDF-3.2-64.exe",
"latex-workshop.view.pdf.external.synctex.args": [
// 正向搜索
"-forward-search",
"%TEX%",
"%LINE%",
"-reuse-instance",
// 反向搜索
"-inverse-search",
"\"C:/Program Files/Microsoft VS Code/Code.exe\" \"C:/Program Files/Microsoft VS Code/resources/app/out/cli.js\" -gr %f:%l",
"%PDF%"
],
// 这是一些独立的编译选项,可以作为工具被编译方案调用
"latex-workshop.latex.tools": [
{
"name": "Windows XeLaTeX",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
]
},
{
"name": "Windows Biber",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
},
{
"name": "WSL XeLaTeX",
"command": "wsl",
"args": [
"/usr/local/texlive/2021/bin/x86_64-linux/xelatex",
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"%DOCFILE%"
]
},
{
"name": "WSL Biber",
"command": "wsl",
"args": [
"/usr/local/texlive/2021/bin/x86_64-linux/biber",
"%DOCFILE%"
]
},
{
"name": "macOS / Linux XeLaTeX",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"%DOCFILE%"
]
},
{
"name": "macOS / Linux Biber",
"command": "biber",
"args": [
"%DOCFILE%"
]
}
],
// 这是一些编译方案,会出现在 GUI 菜单里
"latex-workshop.latex.recipes": [
{
"name": "Windows XeLaTeX 简单编译",
"tools": [
"Windows XeLaTeX"
]
},
{
"name": "Windows xe->bib->xe->xe 复杂编译",
"tools": [
"Windows XeLaTeX",
"Windows Biber",
"Windows XeLaTeX",
"Windows XeLaTeX"
]
},
{
"name": "XeLaTeX 简单编译",
"tools": [
"WSL XeLaTeX"
]
},
{
"name": "xe->bib->xe->xe 复杂编译",
"tools": [
"WSL XeLaTeX",
"WSL Biber",
"WSL XeLaTeX",
"WSL XeLaTeX"
]
},
{
"name": "macOS XeLaTeX 简单编译",
"tools": [
"macOS XeLaTeX"
]
},
{
"name": "macOS xe->bib->xe->xe 复杂编译",
"tools": [
"macOS / Linux XeLaTeX",
"macOS / Linux Biber",
"macOS / Linux XeLaTeX",
"macOS / Linux 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",
"*.bcf",
"*.run.xml",
"*.synctex.gz"
],
// ======================== LaTeX 设置 END ========================
// ======================== VScode Terminal 设置 BEGIN ========================
// 设置各个操作系统下的 VScode 内置 shell
"terminal.integrated.profiles.windows": {
"normal_pwsh7": {
"path": "C:\\Program Files\\PowerShell\\7\\pwsh.exe\\pwsh.exe",
"args": [
"-noexit",
"-file",
"D:\\Users\\newton\\Documents\\PowerShell\\Microsoft.PowerShell_profile.ps1"
]
}
},
"terminal.integrated.defaultProfile.windows": "PowerShell",
"terminal.integrated.profiles.linux": {
"normal_zsh ": {
"path": "/usr/bin/zsh",
}
},
"terminal.integrated.defaultProfile.linux": "normal_zsh",
"terminal.integrated.profiles.osx": {
"normal_zsh ": {
"path": "/usr/bin/zsh",
}
},
"terminal.integrated.defaultProfile.osx": "normal_zsh",
"terminal.integrated.confirmOnExit": "never",
"terminal.integrated.fontFamily": "'FiraCode NF'",
"terminal.integrated.lineHeight": 1.0,
// ======================== VScode Terminal 设置 END ========================
// ======================== WORKBENCH 设置 BEGIN ========================
"workbench.iconTheme": "material-icon-theme",
"workbench.startupEditor": "newUntitledFile",
"workbench.sideBar.location": "left",
"workbench.activityBar.visible": true,
"workbench.colorTheme": "Visual Studio 2019 Dark",
"workbench.editor.untitled.hint": "hidden",
"workbench.editorAssociations": {
"*.ipynb": "jupyter.notebook.ipynb"
},
// ======================== WORKBENCH 设置 END ========================
// ======================== 乱七八糟 设置 BEGIN ========================
// 删除文件不确认
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
// 打开文件最大占用内存数目
"files.maxMemoryForLargeFilesMB": 8192,
"files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true
},
"files.autoSave": "afterDelay",
"files.associations": {
"*.config": "ssh_config"
},
// TypeScript 配置
"typescript.format.placeOpenBraceOnNewLineForControlBlocks": true,
"typescript.format.placeOpenBraceOnNewLineForFunctions": true,
"typescript.format.insertSpaceAfterTypeAssertion": true,
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": true,
"javascript.format.placeOpenBraceOnNewLineForControlBlocks": true,
"javascript.format.placeOpenBraceOnNewLineForFunctions": true,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": true,
"typescript.format.insertSpaceAfterConstructor": true,
// 远程配置
"remote.SSH.remotePlatform": {
"EMC_Debian-11": "linux",
"EMC_RedHat": "linux",
"EMC_Ubuntu-18.04": "linux",
"OptiPlex_Ubuntu-20.04": "linux",
"OptiPlex_Kubuntu-20.04": "linux"
},
// DIFF 文件忽略空字符
"diffEditor.ignoreTrimWhitespace": false,
// PowerShell 默认版本
"powershell.powerShellDefaultVersion": "PowerShell Core 7 (x86)",
// Git 插件配置
"gitlens.advanced.messages": {
"suppressGitMissingWarning": true,
"suppressLineUncommittedWarning": true
},
// 调试控制台配置
"debug.console.fontFamily": "'FiraCode NF'",
"debug.console.fontSize": 14,
"security.workspace.trust.untrustedFiles": "open",
"redhat.telemetry.enabled": true,
"[python]": {
"gitlens.codeLens.symbolScopes": [
"!Module"
],
"editor.wordBasedSuggestions": false
},
"python.defaultInterpreterPath": "C:\\Users\\newton\\miniconda3\\python.exe",
// ======================== 乱七八糟 设置 END ========================
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment