I'm starting to learn git, and am on Ubuntu 20.04.
When I make the command git merge master, it brings me to a (I think) Vim window to enter the merge message. The problem is, when I press Esc, and then hit : to do :wq, it starts recording a macro.
But then it doesn't even seem like Vim. As a sanity test, if I enter the "Vim window" (the one that I go into after running git merge master), and I press Esc j, it goes into some [justified file] mode, and goes all the way to the bottom of the text (instead of like normal, going down one line).
Why is it doing this? What is this?
Run
git var GIT_EDITOR
to know which editor git is using. Once you know which editor you use, you’ll be able to look for specific help for this editor. You can set the editor used by git with git config --global core.editor vim (for instance).
Git chooses the editor to use based on (in this order) and the previous command git var GIT_EDITOR goes through this:
$GIT_EDITORcore.editor in the configuration file (check with git config core.editor)$VISUAL$EDITORNote: In general, the value of an environment variable $VAR can be checked with echo $VAR in your shell.
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