Change Default Git Editor
在Ubuntu上初次安装git的时候,git的默认编辑器为nano,自己
更喜欢vim一些,于是学习了一下修改方法,在此记录下来。
运行如下命令即可:
$ git config --global core.editor vim
可用的编辑器列表 [1]:
| Editor | Config value |
|---|---|
| nano | nano |
| vim | vim |
| neovim | nvim |
| emacs | emacs |
| sublime text | subl -n -w |
| atom | atom --wait |
| vscode | code --wait |
当然,你也可以应用一下以前记录的内容,
用cfg来代替config,如:
$ git config --global alias.cfg config
然后:
$ git cfg --global core.editor vim
[1] 列表来自Change the default git editor
以上。