Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How do you make naked `git commit` default to emacs?


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: