Change default editor that opens in command line?

You would have to set a variable $GIT_EDITOR in your ~/.bashrc file to vi. Alternatively, you can create a ~/.gitconfig file with the values:

[core]
    editor = vi

You can also place this file inside your local git repository so that it only affects that one particular project.

For other non-Git specific editors, there's also the variable $EDITOR, which will work for other things in the same way (like sudoers configuration).

For reference:

https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreeditor

1 Like