json
复制代码
{
// VSCode LaTeX Workshop 插件的设置
// ------------------------------------------------------------------------------------------------------
//何时构建 LaTeX 项目 onFileChange:文件更改时编译文件 onSave:保存代码时自动编译文件 never:从不自动编译)
"latex-workshop.latex.autoBuild.run": "onSave",
//右键显示上下文菜单
"latex-workshop.showContextMenu": true,
//启用智能感知功能包功能,也就是自动补全功能
"latex-workshop.intellisense.package.enabled": true,
//错误信息显示
"latex-workshop.message.error.show": true,
//警告信息显示
"latex-workshop.message.warning.show": true,
//recipes编译链中使用的编译命令
"latex-workshop.latex.tools": [
{
"name": "latexmk_pdflatex",
"command": "latexmk",
"args": ["-synctex=1", "-interaction=nonstopmode", "-file-line-error", "-pdf", "%DOCFILE%"]
},
{
"name": "latexmk_xelatex",
"command": "latexmk",
"args": ["-synctex=1", "-interaction=nonstopmode", "-file-line-error", "-xelatex", "%DOCFILE%"]
},
{
"name": "latexmk_lualatex",
"command": "latexmk",
"args": ["-synctex=1", "-interaction=nonstopmode", "-file-line-error", "-lualatex", "%DOCFILE%"]
}
],
//配方,编译顺序在左侧LaTex中可以看到
"latex-workshop.latex.recipes": [
{
"name": "latexmk (pdflatex) 推荐纯英文",
"tools": ["latexmk_pdflatex"]
},
{
"name": "latexmk (xelatex) 推荐含中文",
"tools": ["latexmk_xelatex"]
},
{
"name": "latexmk (lualatex) 现代复杂文档",
"tools": ["latexmk_lualatex"]
}
],
//清除中间过程文件的类型
"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",
"*.synctex.gz"
],
//何时删除中间过程文件 onBuilt:编译时清除过程文件;onFailed:当编译失败时,清除辅助文件:never:不清除过程文件。
"latex-workshop.latex.autoClean.run": "onFailed",
//默认编译顺序 first:使用latex-workshop.latex.recipes中的第一条编译链,lastUsed:使用最近的一次编译所用的编译链
"latex-workshop.latex.recipe.default": "lastUsed",
// 正反向同步
"latex-workshop.synctex.afterBuild.enabled": true,
//反向同步快捷键绑定 ctrl-click: 为默认选项,使用Ctrl/cmd+鼠标左键单击;double-click : 使用鼠标左键双击
"latex-workshop.view.pdf.internal.synctex.keybinding": "double-click",
//查看LaTexPDF tab: 在VSCode标签;browser: 在网络浏览器;external: 在外部查看器
"latex-workshop.view.pdf.viewer": "tab",
//PDF 参考文献查看 auto : 自动;tabOrBrowser : vscode内置pdf查看器或默认浏览器;external : 外部pdf查看器。
"latex-workshop.view.pdf.ref.viewer":"tabOrBrowser",
//指定了用于查看 PDF 的外部查看器的命令的相关路径
"latex-workshop.view.pdf.external.viewer.command": "C:/App/SumatraPDF/SumatraPDF.exe",
//latex-workshop.view.pdf.external.view.command的参数 %PDF%是用于生成PDF文件的绝对路径的占位符
"latex-workshop.view.pdf.external.viewer.args": [
"%PDF%"
],
//指定在使用外部 PDF 查看器时,触发 SyncTeX(同步预览)功能的命令的相关路径
"latex-workshop.view.pdf.external.synctex.command":"C:/App/SumatraPDF/SumatraPDF.exe", //定位
//指定在使用外部 PDF 查看器进行 SyncTeX(同步预览)操作时的参数
"latex-workshop.view.pdf.external.synctex.args":[
"-forward-search",//执行正向搜索操作
"%TEX%",//触发syncTeX时,扩展名为.tex的LaTeX文件路径
"%LINE%",//源文件中的行号信息
"-reuse-instance",//表示复用外部 PDF 查看器的实例,避免每次都启动新的实例,提高效率。
"-inverse-search",//执行反向搜索操作
"code -r -g \"%f:%l\"", // 定位到VScode所在的.exe文件
"%PDF%"//在触发SyncTeX时,会被替换为生成的PDF文件路径
],
// ------------------------------------------------------------------------------------------------------
// Python 语言格式化设置
// ------------------------------------------------------------------------------------------------------
"[python]": {
// 使用 Ruff 作为默认格式化工具
"editor.defaultFormatter": "charliermarsh.ruff",
// 保存时自动格式化代码
"editor.formatOnSave": true,
// 保存时执行的代码操作
"editor.codeActionsOnSave": {
"source.fixAll": "explicit", // 显式修复所有可自动修复的问题
"source.organizeImports": "explicit" // 显式整理 import 语句
}
},
// ------------------------------------------------------------------------------------------------------
// Git 集成设置
// ------------------------------------------------------------------------------------------------------
"git.autofetch": true, // 自动 fetch 远程更新
"git.confirmSync": false, // 同步(pull/push)时不弹确认框
"git.suggestSmartCommit": false, // 不提示"智能提交"(即无暂存区时直接提交)
// ------------------------------------------------------------------------------------------------------
// 远程连接相关设置
// ------------------------------------------------------------------------------------------------------
// 指定某些扩展必须在远程(workspace)端运行(而非本地 UI 端)
"remote.extensionKind": {
"GitHub.copilot": ["workspace"],
"GitHub.copilot-chat": ["workspace"],
"ms-python.vscode-pylance": ["workspace"]
},
// SSH 的 HTTP / HTTPS 代理(留空表示不使用)
"remote.SSH.httpProxy": "",
"remote.SSH.httpsProxy": "",
// 使用 curl 和 wget 的配置文件(如 .curlrc、.wgetrc)中的代理等设置
"remote.SSH.useCurlAndWgetConfigurationFiles": true,
// 指定 SSH 配置文件路径(Windows 路径需双反斜杠转义)
"remote.SSH.configFile": "C:/Users/yanho/.ssh/config",
// 为特定远程主机指定操作系统平台("1" 和 "3" 是 config 中 Host 的别名,均为 Linux)
"remote.SSH.remotePlatform": {
"1": "linux",
"3": "linux"
},
// ------------------------------------------------------------------------------------------------------
// 设置 HTTP 代理地址(这里指向本地代理)
"http.proxy": "http://127.0.0.1:7897",
// Python 默认解释器路径(使用 venv)
"python.defaultInterpreterPath": "C:\\Users\\yanho\\Desktop\\git\\tad\\.venv\\Scripts\\python.exe",
}