I am trying to add a commit message to my changes using
git commit -a
OR just plain
git commit
this somehow opens GNU Nano 2.2.6 editor and I am not at all comfortable with it. So the question is :
How can I modify my settings so that it always opens with VIM ?
What I already have done is inserting following line in my ~/.bash_profile
set EDITOR = vim
Please help !
You can set it from the command line or in your .gitconfig
git config --global core.editor vim
To make Vim the default editor for Git only, see HST's answer. However, you probably want to have Vim as the default for all applications.
That can be done by
export EDITOR=vim
in your ~/.bash_profile
or ~/.bashrc
. The key is the export
, otherwise the setting won't inherit to launched processes, like Git is.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With