Work with VSCode,Git-bash and gVim on windows

[VSCode] 常用插件

  • mshr-h.veriloghdl
  • vscodevim.vim
  • yzhang.markdown-all-in-one

[VSCode] 设置Git-bash作为默认终端

打开vscode的设置文件,settings.json,添加以下设置(注意:以前的terminal.integrated.shell.windows已经废弃):

    //"terminal.integrated.shell.windows": "D:\\Program Files\\Git\\bin\\bash.exe",
    "terminal.integrated.profiles.windows": {
        "Git-Bash": {
          "path": "D:\\Program Files\\Git\\bin\\bash.exe"
        }
    },
    "terminal.integrated.defaultProfile.windows": "Git-Bash",

[VSCode] 设置在终端中“选中复制”和“右键粘贴”

打开vscode的settings:
1) 选中复制: 搜索 copy on selection,勾选;
2) 右键粘贴: 搜索 right click behavior, 下拉选择 paste (not copypaste)。

[Git-bash] warning:LF will be replaced by CRLF…

原因:Windows的换行是CRLF,Linux的换行是LF。
解决方案:简单的说,git做如下设置即可:

#提交时转换CRLF为LF,检出时不转换
git config --global core.autocrlf input

如果你想在Window上保留CRLF的格式,设置如下:

#提交时转换为LF,检出时转换为CRLF
$ git config --global core.autocrlf true

参考:关于 LF will be replaced by CRLF 问题出现的原因以及解决方式

[Git-bash] fatal: no matching host key type found. Their offer: ssh-rsa

现象:git 通过ssh-rsa认证链接远程库的时候提示如下信息:

Unable to negotiate with xxx port xxx: no matching host key type found. Their offer: ssh-rsa
fatal: Could not read from remote repository.

Please make sure you have the correct access rights 
and the repository exists.

原因:Git-bash 2.32版本之后,可能是认为ssh-rsa加密性能太弱,默认不支持ssh-rsa。
方案1:设置使支持ssh-rsa,即在 ~/.ssh/config 文件中加入以下内容(没有这个文件就新建一个):

Host <host address>
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa

方案2:升级使用加密更强大的算法。(TODO)

[Git-bash] 支持Makfile

Git-bash 默认是不支持gcc和Makefile的,有两种解决方法:

  • 方案1:安装gcc套件,gcc支持makefile。

参考:给git-bash加点儿料——gcc、make、cmake

  • 方案2:仅支持makefile。

参考:让GIT BASH支持make

[Git-bash] 生成ssh key

  • ssh-rsa:ssh-keygen -t rsa -N “” --C “generated by xxx”
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值