vscode指定擴展安裝位置

默認狀況下,(Windows)vscode的安裝路徑爲C:\Users\用戶名\.vscode\extensionsapp

若是想要自定義擴展的安裝路徑,沒法直接在vscode中修改。可是,在啓動vscode的時候,能夠指定擴展路徑。code

cmd$ D:\VSCode\bin\code --help

Usage: code.exe [options] [paths...]

To read output from another program, append '-' (e.g. 'echo Hello World | code -')

Options:
  -d, --diff <file> <file>           Compare two files with each other.
  -a, --add <dir>                    Add folder(s) to the last active window.

Extensions Management:
  --extensions-dir <dir>
      Set the root path for extensions.
  --list-extensions
      List the installed extensions.

能夠看到,code有個選項--extensions-dir,它用來指定擴展安裝位置。因此,能夠修改vscode的快捷方式,加入code的啓動選項。blog

例如,我想將擴展路徑設置爲g:\vscode-extensions,先建立好這個目錄。而後,按下圖修改:cmd

而後將原來C:\Users\用戶名\.vscode\extensions下的擴展剪切到新的擴展路徑g:\vscode-extensions下。it

再用快捷方式打開vscode便可。可能須要從新配置顏色主題,不過這都不是問題。io

相關文章
相關標籤/搜索