配置远程主机的 Visual Studio Code 设置

在远程主机的 ~/.vscode-server/data/Machine/settings.json 中,添加你的配置。

Python

{
    "python.condaPath": "/path/to/conda",
    "python.defaultInterpreterPath": "/path/to/python"
}

Remote SSH

有时候会遇到服务器更新 VS Code / 插件速度很慢的情况,可以启用下面两个选项以在本地下载并上传到服务器:

{
  "remote.SSH.localServerDownload": "always",
  "remote.downloadExtensionsLocally": true
}

Terminal

{
  "terminal.integrated.profiles.linux": {
    "bash": {
      "path": ["/usr/bin/bash", "bash"],
      "args": ["--rcfile", "/path/to/bashrc"],
      "icon": "terminal-bash"
    },
    "zsh": {
      "path": ["/usr/bin/zsh", "zsh"]
    },
    "tmux": {
      "path": "tmux",
      "icon": "terminal-tmux"
    }
  },
  "terminal.integrated.defaultProfile.linux": "zsh"
}

Proxy

{
  "http.proxy": "http://127.0.0.1:7890",
  "http.proxyStrictSSL": true
}

Editor

~/.bashrc 中,添加:

if [ "$VSCODE_INJECTION" = "1" ]; then
    export EDITOR="code --wait"
fi

参考:Configuring the $EDITOR variable

posted @ 2024-11-01 21:55  Undefined443  阅读(54)  评论(0)    收藏  举报