简体   繁体   中英

How do I make vim my editor of choice for git notes?

Is there any way to use vim to edit git notes? At the moment all I have is the git notes add -m command.

git config --global core.editor "vim"

It's configured the same way as for any other git command that invokes an editor.

http://git-scm.com/book/en/Customizing-Git-Git-Configuration

core.editor
By default, Git uses whatever you've set as your default text editor or else falls back to the Vi editor to create and edit your commit and tag messages. To change that default to something else, you can use the core.editor setting:

$ git config --global core.editor emacs
Now, no matter what is set as your default shell editor variable, Git will fire up Emacs to edit messages.

Just specify vim rather than emacs .

You can also use the $GIT_EDITOR , $VISUAL , or $EDITOR environment variable (the latter two are used by a number of commands, not just Git).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM