Change VSCode User Settings location

前端 未结 3 497
鱼传尺愫
鱼传尺愫 2021-02-03 23:52

I want to put my User Settings file under version control, preferably a separate folder, but I can\'t find the option to tell VSCode where my settings file is located.

I

相关标签:
3条回答
  • 2021-02-03 23:52

    You can add a settings file for a workspace like this :

    /yourproject/.vscode/settings.json
    

    Or use the editor and goto :Preferences->settings and select workspace settings in the top bar.

    These can be checked into your project and then to source control.

    Reference : https://code.visualstudio.com/docs/getstarted/settings#_creating-user-and-workspace-settings

    The file is created for you by default when editing the settings in your workspace. There you can select User or Workspace settings.

    You can also open the Settings editor from the Command Palette (⇧⌘P) with Preferences: Open Settings or use the keyboard shortcut (⌘,).

    0 讨论(0)
  • 2021-02-03 23:59

    You can set the location of the global user data folder by launching from the command line with the --user-data-dir option. But I just initialized a git repo in the default user settings location and keep it in source control there.

    0 讨论(0)
  • 2021-02-04 00:19

    Another good option (if you'll pardon the late response) for versioning VSCode's user settings would be to use the Git "bare" repo method of versioning dot-files, as outlined here:

    https://www.ackama.com/blog/posts/the-best-way-to-store-your-dotfiles-a-bare-git-repository-explained

    By making $HOME your Git working directory for a Git Bare repo, all files under $HOME are eligible to be Git-Tracked, including VSCode's user settings. What I like about this approach is it works without moving dot-files or VSCode settings away from their default or expected paths.

    0 讨论(0)
提交回复
热议问题