VSCode远程开发配置
安装VS Code
下载地址:https://code.visualstudio.com/
安装Git
下载地址:https://git-scm.com/download/win/
- 添加环境变量
Path:
D:\Program Files\Git\bin;
D:\Program Files\Git\cmd;
D:\Program Files\Git\usr\bin;
远程开发扩展
- 安装Remote-SSH扩展,linux远程
- 安装Remote-WSL扩展,windows子系统远程
- 安装Remote Development扩展
- 安装ssh客户端,Git客户端自带,需要设置好环境变量
扩展设置Remote-SSH:Path为
gitpath/usr/bin/ssh.exe
- 配置settings.json,配置运行环境
- 配置launch.json,配置调试环境
安装go
下载地址:https://dl.google.com/go/
- 环境变量设置
Path设置Go安装目录的的bin文件路径;
创建GOPATH目录,包含src,bin,pkg路径,并设置为GOPATH环境变量;
cmd窗口运行go version检查是否按照完毕;
Go语言扩展
- 安装go语言支持插件
扩展搜索go,下载Rich Go language support for Visual Studio Code;
- 根据需要下载中文支持插件
扩展搜索chinese
- 添加国内代理
cmd执行
go env -w GOPROXY=https://goproxy.cn,direct
- 安装go语言开发工具包
ctrl+shift+p输入go,选择
Go:Install/Update Tools
,
如果安装失败可以将go get -v xxxxx
命令拷贝到cmd窗口单条执行,
如果还失败到https://github.com/golang搜多相关模块clone到go工程src目录,
再次用go get -v
命令安装。
- vscode无法正确加载环境变量
cmd执行
code 项目路径
重新加载项目。
Python扩展
- 安装python扩展
- 安装django扩展
- 安装Beautify扩展
- python项目‘.vscode’目录下的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",
"python.linting.enabled": true,
"python.linting.lintOnSave": true,
"python.linting.pylintEnabled": true,
"python.linting.pylintUseMinimalCheckers": true,
"python.formatting.provider": "yapf",
"git.autofetch": true,
"window.zoomLevel": 1,
"explorer.confirmDelete": false,
"files.autoSave": "onFocusChange",
"workbench.colorCustomizations": {
"editor.selectionBackground": "#aa0000",
"editor.selectionHighlightBackground": "#aa0000",
},
"workbench.sideBar.location": "left",
"[markdown]": {
"editor.wordWrap": "off"
},
"editor.wordWrap": "on",
"editor.wordWrapColumn": 80,
"python.pythonPath": "/home/git/venv/jumpserver/bin/python"
}
其他扩展
- 安装HTML CSS Support扩展
- 安装Son of Obsidian扩展
- 安装View In Browser扩展
- 安装XML Tools扩展
- 安装Path Intellisense扩展
- 安装Material Icon Theme扩展