When i run git commit
it opens up 2 vi editor panes instead of one. The top pane is totally blank. The bottom pane is what I expect to see when running git commit
. Every time I want to commit I have to close the top pane using :q
before I can write my commit message.
Has anyone seen something like this before? What is the solution?
I don't know why this worked, but I commented out a line in my .vimrc that changed the colorscheme.
colorscheme solarized
. Seems to have fixed the problem somehow. I guess the git commit wants to use a vi without customization and for some reason opens up a secondary pane when a different colorscheme is present.
UPDATE:
Fixed by putting the colorscheme solarized
line in my .vimrc in an if block to see if it is called by git commit
.
Changed .vimrc:
if $_ != 'git commit'
colorscheme solarized
endif
I believe the issue is that Git doesn't know what editor you want to use, so it runs vi
by default, which launches Vim in compatibility mode.
This could also happen with other applications, so you could set the VISUAL
and/or EDITOR
environment variables (or/as well as the git-specific GIT_EDITOR
) in your ~/.bashrc
to fix this:
EDITOR=vim
VISUAL=vim
Alternatively, you can configure git itself to use vim:
git config --global core.editor "vim"
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