VSCode Extension Settings-Sync(VSCode设置同步)

团队合作中,你肯定想让每个人开发环境设置是一样的,起码基础设置是一样的。Settings Sync 满足你的需求,让新加入的成员快速搭建相同的开发环境。

对于个人而言我也希望我在做不同场景的事情的时候使用不用的配置。如纯写 markdown 的时候,写个人 Blog 的时候,
或者做前端开发的时候,可能每种场景用的插件和做的设置是不一样的,有些插件又有冲突。也做为我使用该插件的情况。

Settings Sync

General

个人感觉如下内容你要理解:

  • About gists, Public and Secret Gist.

  • Gist Settings

    同步内容的 gist-id,只有第一次操作的时候需要填写,之后就会记录到你的设置中sync.gist

    Open the command palette: Ctrl+Shift+P (Cmd+Shift+P on Mac), 输入 open user settings.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    "sync.gist": "d9ac5f7d193ffeeec7d8459451b2217a",
    "sync.host": "",
    "sync.pathPrefix": "",
    "sync.quietSync": false,
    "sync.askGistName": false,
    "sync.removeExtensions": true,
    "sync.syncExtensions": true,
    "sync.autoDownload": false,
    "sync.autoUpload": false,
    "sync.lastUpload": "2018-07-31T07:03:09.646Z",
    "sync.lastDownload": "",
    "sync.forceDownload": false,
  • Global Settings

    这里的 token 就是类似你的密码,想要 update / upload settings 必须要有这个,可以 GitHub 中手动重新生成。

    1. Open the command palette: Ctrl+Shift+P (Cmd+Shift+P on Mac), 输入 Sync Advanced Options.
    2. 选择Edit Extension Local Settings
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    {
    "ignoreUploadFiles": [
    "projects.json",
    "projects_cache_vscode.json",
    "projects_cache_git.json",
    "projects_cache_svn.json",
    "gpm_projects.json",
    "gpm-recentItems.json"
    ],
    "ignoreUploadFolders": ["workspaceStorage"],
    "ignoreExtensions": [],
    "replaceCodeSettings": {},
    "gistDescription": "Visual Studio Code Settings Sync Gist",
    "version": 300,
    "token": "e8f1678289913259c10ca55c47f44405cffb17d7",
    "downloadPublicGist": false,
    "supportedFileExtensions": ["json", "code-snippets"],
    "openTokenLink": true
    }

    如果你像我一样不同场景有不同的 extensions 和不同的配置,需要切换的时候,就删除配置中的gisttoken,又会提示你输入 gisttoken 了,输入你对应的 gisttoken ,重新同步就行了。

Install Settings Sync

  1. Open Visual Studio Code
  2. Press Ctrl+P to open the Quick Open dialog
  3. Type ext install Shan.code-settings-sync, then click enter after find the extesnion
  4. Click reload button after Installed

Upload VSCode Settings

  1. Open the command palette: Ctrl+Shift+P (Cmd+Shift+P on Mac)
  2. sync: Update / upload settings, for first time, input gist-id
  3. Get Done information on OUTPUT Window

Download VSCode Settigns

  1. Press ctrl+shift+P , then type sync: advance options to select sync: download from public gist, if secret gist, skip this step.
  2. Press ctrl+shift+P, then type sync: download settings, then input gist-id
  3. Get Done information on OUTPUT Window
  4. Reload VSCode

Tips: 如果没显示 Done,就关闭 VSCode,反复尝试几次.

Make gist Public from Secret

如何你想分享的 Secret 给别人,但是别人只能读取,不能修改(当然你提供了 token 一样可以修改)。可以将你的 gist 从 Secret 改成 Public。

  1. 进入 gis 的详细页面,如gistT id e7a2c92023d52bb30d9db275e506d83d
  2. 点击edit修改
  3. 点击make public, then update secret gist.

VSCode Settings

个人 VSCode Settings 分享。

Markdown

感谢支持,让我安静的做蚂蚁梦!