欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

将Git默认编辑器更改为vim

程序员文章站 2022-03-11 09:13:52
...

将Git默认编辑器更改为vim

将Git默认编辑器更改为vim

查看Git逻辑变量

$ git var -l
user.name=j
user.email=[email protected]
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=[email protected]:j/la.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
GIT_COMMITTER_IDENT=j <[email protected]> 1000000004 +0800
GIT_AUTHOR_IDENT=j <[email protected]> 1000000004 +0800
GIT_EDITOR=editor
GIT_PAGER=pager

将当前Git默认编辑器更改为vim

$ git config core.editor vim

将全局Git默认编辑器更改为vim

$ git config --global core.editor vim

再次查看Git逻辑变量

$ git var -l
user.name=j
user.email=[email protected]
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=[email protected]:j/la.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
GIT_COMMITTER_IDENT=j <[email protected]> 1000000004 +0800
GIT_AUTHOR_IDENT=j <[email protected]> 1000000004 +0800
GIT_EDITOR=vim
GIT_PAGER=pager

相关标签: Git git