f you want to set the editor only for Git, do either (you don’t need both):
core.editor
git config --global core.editor "vim"
GIT_EDITOR
export GIT_EDITOR=vim