文章目录
首先下载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,
}