For example, I would prefer to write my commit messages in vim
, but it is opening emacs
.
How do I configure git to always use vim
instead? Note that I want to do this globally, not just for a single project.
For example, I would prefer to write my commit messages in vim
, but it is opening emacs
.
How do I configure git to always use vim
instead? Note that I want to do this globally, not just for a single project.
From man git-commit
:
ENVIRONMENT AND CONFIGURATION VARIABLES
The editor used to edit the commit log message will be chosen from the
GIT_EDITOR
environment variable, thecore.editor
configuration variable, theVISUAL
environment variable, or theEDITOR
environment variable (in that order).
You can either set core.editor in your git config
git config --global core.editor "vim"
or set the VISUAL or EDITOR environment variables.
export VISUAL=vim
export EDITOR=vim
For emacs users
.emacs
:
(server-start)
shellrc
:
export EDITOR=emacsclient