Ubuntu下git提交代码时终端默认的编辑器为nano, 可能习惯了VIM或者VI的工程师看到一堆的选项使用起来并不是很方便,使用 Vim或者VI来为提交代码 git commit -a 添加comments更好用。设置的方法很简单,只需要修改一个配置我们就可以做到。
确保电脑上已经安装了VIM或者VI。
修改git 默认编辑器 git config --global --edit
[core]
editor = vim
#editor = notepad++ # for windows
----
windows下设置notepad++为git的编辑器
1.首先下载安装 notepad++
2.将notepad++安装目录放到path中
3.git config --global core.editor notepad++
4.git commit 自动用 notepad++ 打开,填写注释信息
当然了,也可以将 notepad++ 的目录直接写到 git core.editor中
git config --global core.editor "'D:Notepad++notepad++.exe' -multiInst -notabbar -nosession -noPlugin '$*'"
最后
以上就是拉长耳机最近收集整理的关于git 修改默认编辑器的全部内容,更多相关git内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复