-
首先打开VS Code
-
使用组合键 command+shift+p,输入intall,选择 'Shell Command: Install 'code' command in Path', 如下图
截屏2020-11-04 下午5.11.31.png
-
此时code命令就可以直接调用VS来编辑可打开文件。
-
终端输入 git config --global core.editor "code -w" 设置git编辑器为VS Code。
可查看 vim ~/.gitconfig 文件内,是否已经正确改变。
[core]
editor = code -w
- 当使用类似 git commit -a -s时,自动弹出VSCode,编写完成,command+w组合键,即可完成输入,回到终端继续进行操作。
网友评论