ubuntu下提交代码 git commit -a 将编辑器默认的nano改为vim
富凯风
2023-12-01
[QUESTION]
如何将ubuntu git commit -a 默认的nano改为vim ?
[ANSWER]
Ubuntu下git提交代码时终端默认的编辑器为nano, 可能习惯了VIM的工程师看到一堆的选项使用起来并不是很方便,使用 Vim 来为提交代码 git commit -a 添加comments更好用。设置的方法很简单,只需要修改一个配置我们就可以做到。
操作步骤如下:
echo export EDITOR=/usr/bin/vim >> ~/.bashrc
重启终端再提交代码的时候就会默认使用VIM编辑。