vscode使用记录

下载

官网下载
在这里插入图片描述
https://az764295.vo.msecnd.net/stable/e8a3071ea4344d9d48ef8a4df2c097372b0c5161/VSCode-win32-x64-1.74.2.zip
如果下载速度慢,就替换上面的链接为
https://vscode.cdn.azure.cn/stable/e8a3071ea4344d9d48ef8a4df2c097372b0c5161/VSCode-win32-x64-1.74.2.zip

设置插件安装路径

在这里插入图片描述

D:\vscode\VSCode\Code.exe --extensions-dir D:\vscode\extensions

设置默认终端

在VSCode中输入快捷键ctrl+shift+p,然后输入settings,选择下面一个
在这里插入图片描述
settings.json 文件里添加下面内容:

    "terminal.integrated.profiles.windows": {
        "Git-Bash": {
        	// 自己的bash路径
            "path": "D:\\app\\git\\bin\\bash.exe",
            "args": []
        }
    },
    "terminal.integrated.defaultProfile.windows": "Git-Bash"

插件

记录自己安装的vscode 插件

主题

markdown

  • Markdown All in One :键盘快捷方式,目录,自动预览等
  • Markdown Preview Enhanced:预览
  • Markdown Math:支持KaTex
  • paste image: 插入文件
    • 文件保存路径:Paste Image: Path
    • 在markdown插入的图片的参考基路径:Paste Image: paste

编程语言

  • Python: python
  • Language Support for Java™ by Red Hat:Java
  • Java Extension Pack:(写,测试,debug)
  • C/C++:c、c++
  • Spring Boot Extension Pack
  • mysq: cweijan.vscode-mysql-manager (连接管理,查询等)

前端

  • Beautify:美化代码
  • guides: 显示代码对齐辅助线
  • JS-CSS-HTML Formatter:代码格式化
  • Eslint:检查代码是否符合规范
  • Vetur:vue语法支持

代码提示

  • Visual Studio IntelliCode: 代码补全提示

远程开发

插件: Remote Development

以管理员身份打开 PowerShell 并运行:

# 检查 OpenSSH 的可用性
Get-WindowsCapability -Online | Where-Object Name -like  'OpenSSH*'
# 如果表示 State : NotPresent 则需要安装
# 安装 OpenSSH 客户端
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~ 0.0.1.0
# 测试
ssh username@ip-address/domain

推荐使用 git 自带的ssh工具

过程试图写入的管道不存在

[11:02:32.463] Checking ssh with "F:\VWware\bin\ssh.exe -V"
[11:02:32.464] Got error from ssh: spawn F:\VWware\bin\ssh.exe ENOENT
[11:02:32.464] Checking ssh with "C:\ProgramData\Miniconda3\ssh.exe -V"
[11:02:32.465] Got error from ssh: spawn C:\ProgramData\Miniconda3\ssh.exe ENOENT
[11:02:32.465] Checking ssh with "C:\ProgramData\Miniconda3\Library\mingw-w64\bin\ssh.exe -V"
[11:02:32.466] Got error from ssh: spawn C:\ProgramData\Miniconda3\Library\mingw-w64\bin\ssh.exe ENOENT
[11:02:32.466] Checking ssh with "C:\ProgramData\Miniconda3\Library\usr\bin\ssh.exe -V"
[11:02:32.467] Got error from ssh: spawn C:\ProgramData\Miniconda3\Library\usr\bin\ssh.exe ENOENT
[11:02:32.467] Checking ssh with "C:\ProgramData\Miniconda3\Library\bin\ssh.exe -V"
[11:02:32.468] Got error from ssh: spawn C:\ProgramData\Miniconda3\Library\bin\ssh.exe ENOENT
[11:02:32.468] Checking ssh with "C:\ProgramData\Miniconda3\Scripts\ssh.exe -V"
[11:02:32.469] Got error from ssh: spawn C:\ProgramData\Miniconda3\Scripts\ssh.exe ENOENT
[11:02:32.469] Checking ssh with "C:\Windows\system32\ssh.exe -V"
[11:02:32.470] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT
[11:02:32.470] Checking ssh with "C:\Windows\ssh.exe -V"
[11:02:32.471] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT
[11:02:32.472] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V"
[11:02:32.474] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT
[11:02:32.474] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[11:02:32.475] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[11:02:32.476] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[11:02:32.530] > OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2

[11:02:32.534] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 61280 "192.168.30.8" bash
[11:02:32.536] Terminal shell path: C:\Windows\System32\cmd.exe
[11:02:32.788] > ]0;C:\Windows\System32\cmd.exe 
[11:02:32.789] Got some output, clearing connection timeout
[11:02:32.814] > Bad owner or permissions on C:\\Users\\boy/.ssh/config
> 过程试图写入的管道不存在。
> 
[11:02:34.066] "install" terminal command done
[11:02:34.066] Install terminal quit with output: 过程试图写入的管道不存在。
[11:02:34.066] Received install output: 过程试图写入的管道不存在。
[11:02:34.067] Failed to parse remote port from server output
[11:02:34.068] Resolver error: Error: 
	at g.Create (c:\Users\boy\.vscode\extensions\ms-vscode-remote.remote-ssh-0.109.0\out\extension.js:2:499734)
	at t.handleInstallOutput (c:\Users\boy\.vscode\extensions\ms-vscode-remote.remote-ssh-0.109.0\out\extension.js:2:497056)
	at t.tryInstall (c:\Users\boy\.vscode\extensions\ms-vscode-remote.remote-ssh-0.109.0\out\extension.js:2:620589)
	at async c:\Users\boy\.vscode\extensions\ms-vscode-remote.remote-ssh-0.109.0\out\extension.js:2:580447
	at async t.withShowDetailsEvent (c:\Users\boy\.vscode\extensions\ms-vscode-remote.remote-ssh-0.109.0\out\extension.js:2:583753)
	at async k (c:\Users\boy\.vscode\extensions\ms-vscode-remote.remote-ssh-0.109.0\out\extension.js:2:577412)
	at async t.resolve (c:\Users\boy\.vscode\extensions\ms-vscode-remote.remote-ssh-0.109.0\out\extension.js:2:581124)
	at async c:\Users\boy\.vscode\extensions\ms-vscode-remote.remote-ssh-0.109.0\out\extension.js:2:847283
[11:02:34.072] ------

参考解决方案:修改成 git 自带的ssh工具
在这里插入图片描述

省略输密码

# 生成SSH密钥对, 如果生成过可以忽略
ssh-keygen -t rsa

# 将公钥文件复制到远程服务器上
ssh-copy-id username@ip-address 
# 连接测试
ssh username@ip-address 

参考使用 vscode + Remote-SSH 插件 + vscode-server 进行远程开发

参考博客

使用vscode打造python开发环境
VS Code打造一个完美的Springboot开发环境
VSCode中4个Settings(JSON)的区别与联系

settings.json 设置

{
    "workbench.colorTheme": "One Dark Pro",
    "workbench.iconTheme": "vscode-icons",
    "editor.glyphMargin": false,
    "vsicons.dontShowNewVersionMessage": true,
    "explorer.confirmDelete": false,
    "workbench.startupEditor": "newUntitledFile",
    "java.errors.incompleteClasspath.severity": "ignore",
    "java.home": "D:\\java\\jdk",
    "java.configuration.maven.userSettings": "D:\\java\\maven\\conf\\settings.xml",
    "maven.executable.path": "D:\\java\\maven\\bin\\mvn.cmd",
    "maven.terminal.useJavaHome": true,
    "maven.terminal.customEnv": [
        {
            "environmentVariable": "JAVA_HOME",
            "value": "D:\\java\\jdk"
        }
    ],
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "files.exclude": {
        "**/.classpath": true,
        "**/.project": true,
        "**/.settings": true,
        "**/.factorypath": true
    },
    "python.jediEnabled": false,
    "explorer.confirmDragAndDrop": false,
    "beautify.language": {  
        "js": {
          "type": ["javascript", "json"],
          "filename": [".jshintrc", ".jsbeautifyrc"]
          // "ext": ["js", "json"]
          // ^^ to set extensions to be beautified using the javascript beautifier
        },
        "css": ["css", "scss"],
        "html": ["htm", "html"]
        // ^^ providing just an array sets the VS Code file type
    },
    "editor.renderIndentGuides": false,
    "[javascript]": {
        "editor.defaultFormatter": "lonefy.vscode-JS-CSS-HTML-formatter"
    },
}
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值