打造最好用的VScode Python远程开发环境

文章目录

首先下载VScode。
file->preferences->settings,设置Auto save为on Focuschange,Font size设为18。file->preferences->color themes,选择Dark+(default dark)。
点击extensions,分别输入C/C++、Python、Remote-SSH,下载安装。
按照这个网址:https://docs.microsoft.com/zh-cn/windows-server/administration/openssh/openssh_install_firstuse 中的步骤在windows10上安装和配置openSSH。
在本地机上修改~/.ssh/config,即使用命令:

vim ~/.ssh/config

添加下列内容:

Host hh-b
    hostname 服务器ip地址
    user 登录名
    ForwardAgent yes
    RemoteForward 23 127.0.0.1:23 # 第一个23是服务器的端口,第二个23是本地机的端口

打开VScode,view->extensions或者ctrl+shift+x,搜索python和remote-SSH,安装。然后左侧菜单栏选择REMOTE-SSH,选择hh-b,连接即可。第一次连接自动下载服务器插件,大约几十秒即可完成。

然后在settings中选择连接的服务器那一项,找到edit settings.json,添加下列内容:

{
    "editor.fontSize": 16,
    "editor.formatOnType": true,
    "editor.formatOnSave": true,
    "debug.console.fontSize": 18,
    "markdown.preview.fontSize": 18,
    "terminal.integrated.fontSize": 18,
    "remote.SSH.showLoginTerminal": true,
    "workbench.editor.enablePreview": false,
    "workbench.colorTheme": "Monokai",
    "workbench.fontAliasing": "auto",
    "python.pythonPath": "python3",
    "python.linting.enabled": true,
    "python.linting.lintOnSave": true,
    "python.linting.pylintEnabled": true,
    "python.linting.pylintUseMinimalCheckers": true,
    "python.formatting.provider": "yapf",
    "python.jediEnabled": false,
    "git.autofetch": true,
    "window.zoomLevel": 1,
    "explorer.confirmDelete": false,
    "files.autoSave": "onFocusChange",
    "workbench.colorCustomizations": {
        "editor.selectionBackground": "#aa0000",
        "editor.selectionHighlightBackground": "#aa0000",
    },
    "terminal.integrated.shell.linux": "/bin/zsh",
    "python.dataScience.sendSelectionToInteractiveWindow": false,
    "workbench.sideBar.location": "left",
    "[markdown]": {
        "editor.wordWrap": "off"
    },
    "editor.wordWrap": "on",
    "editor.wordWrapColumn": 80,
}
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值