Hacker News new | ask | show | jobs
by TouchyJoe 2171 days ago
How do you make naked `git commit` default to emacs?
2 comments

I believe the default is simply to open your default editor so just set $VISUAL (and $EDITOR, read the manual for your shell) in your environment. This has the added benefit (?) of using that editor for commands that open a visual editor such as crontab -e or even visudo (with some caveats of course).

If you want to use a different editor just for git you can set $GIT_EDITOR in your environment.

git config --global core.editor <EDITOR>
It also respects $EDITOR, though that would impact more than just git, of course.