Search code examples
gitvimeditorgnunano

Git commit -a opens GNU nano 2.2.6 How should I change it to open Vim instead?


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 !


Solution

  • You can set it from the command line or in your .gitconfig

    git config --global core.editor vim