美文网首页
MacOS中使用VS Code(Visual Studio Co

MacOS中使用VS Code(Visual Studio Co

作者: lee_zhou_iOS开发者 | 来源:发表于2020-11-04 17:22 被阅读0次
  1. 首先打开VS Code

  2. 使用组合键 command+shift+p,输入intall,选择 'Shell Command: Install 'code' command in Path', 如下图


    截屏2020-11-04 下午5.11.31.png
  3. 此时code命令就可以直接调用VS来编辑可打开文件。

  4. 终端输入 git config --global core.editor "code -w" 设置git编辑器为VS Code。

可查看 vim ~/.gitconfig 文件内,是否已经正确改变。

[core]
    editor = code -w
  1. 当使用类似 git commit -a -s时,自动弹出VSCode,编写完成,command+w组合键,即可完成输入,回到终端继续进行操作。

相关文章

网友评论

      本文标题:MacOS中使用VS Code(Visual Studio Co

      本文链接:https://www.haomeiwen.com/subject/opwgvktx.html