Pregunta

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 !

¿Fue útil?

Solución

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

git config --global core.editor vim

Otros consejos

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top