【问题标题】:Extending settings.json in VSCode在 VSCode 中扩展 settings.json
【发布时间】:2019-08-26 20:11:37
【问题描述】:

我想将 VSCode 的 settings.json 版本检查到我们团队的 git 存储库中,同时仍然允许各个开发人员在此之上添加自己的设置(即,以防他们想要配置他们正在使用的某些扩展)。是否可以告诉 VSCode 查看两个不同的文件? IE。 settings.json 和 settings-local.json,其中 settings-local.json 被 git 忽略。

【问题讨论】:

    标签: visual-studio-code vscode-settings


    【解决方案1】:

    使用code --user-data-dir /path/to/user/data/dir 运行 vscode。 VS Code会自动在选择的目录下生成一些文件夹,settings.json会位于:SELECTED_DIRECTORY/User/settings.json

    【讨论】:

    • 如何在不同的用户配置之间切换?从桌面快捷方式运行将使用默认设置启动 VSCode,但是如何使用您在答案中描述的方式创建的自定义设置运行它?
    • @youssef 您可以编辑快捷方式。你的操作系统是什么?
    • @youssef 在 xfce4 上:xfce4-terminal -e 'code --user-data-dir /path/to/user/data/dir'
    • 感谢您的信息!还发现了这些链接,现在我知道我在寻找什么,这给了我更多信息:code.visualstudio.com/docs/editor/…github.com/Microsoft/vscode/issues/7243
    【解决方案2】:

    本地设置覆盖 (settings.local.json) · 问题 #37519 · microsoft/vscode https://github.com/Microsoft/vscode/issues/37519#issuecomment-344414444

    这是来自 vscode 开发人员的提示。

    【讨论】:

    【解决方案3】:
    {
        "editor.renderWhitespace": "all",
        "editor.tabSize": 2,
        "javascript.validate.enable": false,
        "typescript.updateImportsOnFileMove.enabled": "never",
        "editor.fontSize": 13,
        "editor.suggestSelection": "first",
        "diffEditor.ignoreTrimWhitespace": false,
        "terminal.integrated.shell.osx": "/bin/zsh",
        "eslint.format.enable": true,
        "eslint.validate": [
            "javascript",
            "javascriptreact",
            "typescript",
            "typescriptreact"
        ],
        "javascript.preferences.importModuleSpecifier": "relative",
        "typescript.preferences.importModuleSpecifier": "relative",
        "workbench.activityBar.visible": true,
        "gitlens.gitCommands.closeOnFocusOut": true,
        "editor.semanticHighlighting.enabled": false,
        "tabnine.experimentalAutoImports": true,
        "workbench.colorTheme": "Atom One Dark",
        "editor.wordWrap": "off",
        "[typescriptreact]": {
            "editor.defaultFormatter": "esbenp.prettier-vscode"
        },
        "editor.formatOnSave": true,
        "[javascript]": {
            "editor.defaultFormatter": "esbenp.prettier-vscode"
        },
        "git.autofetch": true,
        "editor.lineHeight": 25,
        "[typescript]": {
            "editor.defaultFormatter": "esbenp.prettier-vscode"
        },
        "window.zoomLevel": 1,
        "[json]": {
            "editor.defaultFormatter": "esbenp.prettier-vscode"
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多