Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to save exit nvim in git bash commit

I'm using git bash on Win 10 and nvim as the editor. When I commit with no message it opens a blank screen (where blank means BLANK, not mostly blank with a line number at the bottom), I type "stuff", I Esc:wq but "wq" is inserted. I <C-c> and get the obligatory you're-an-idiot-and-didn't-give-a-commit-message error. I start nvim directly and get the same blank screen and the same effect of only the first character of any command after <Esc> is not inserted then we go right back to insert mode so :q acts like iq ... totally at a loss. Is git bash incompatible with nvim?

Edit: In case a visual helps enter image description here

like image 648
Still.Tony Avatar asked Nov 28 '25 00:11

Still.Tony


1 Answers

This neovim/neovim issue 9585 illustrates that nvim can be used with Git.

Check with a git config core.editor how nvim was declared as Git editor.

It can be:

git config --global core.editor '"nvim -u NORC"'

On Windows, this issue suggests:

git config --global core.editor "set LC_CTYPE='en_US.UTF-8';nvim"

Using mhinz/neovim-remote can help:

git config --global core.editor 'nvr --remote-wait-silent'

like image 151
VonC Avatar answered Dec 01 '25 20:12

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!