When I reverted to a previous commit in Git, I was surprised to see the editor that opened was - I believe - nano. Well it was something confusing anyway and it did not respond to navigation like 5G in an expected manner. I was able to figure out that ^ was control so from there I managed to escape out of there somehow though sadly with a default revert message.
How can I change this to open the little vi editor that comes with Zorin? Is it to do with the system or with Git?
I believe that vi is included as well, but is not the default.
Were you working in an IDE or the GIT app? What were you in that launched the terminal emulator?
Thank you I will add the change locally as I always set up a local email and user name per project anyway, although that can be done from the command line without opening config. So since you mentioned this is based on the config for Git and not based on the system default, I tried git config core.editor "vi" and got it in there.
I have never actually had the editor open because on commits I use -m to add the message. It was just when I did the revert, which is not a common occurence, that I realized it was defaulting to an editor I wasn't familiar with.
EDIT Just tested it out with a messageless commit and it worked! Thanks so much!
It's pretty useful to have this setup, but as you correctly inferred the default editor is nano — in nano you can press Ctrl+O first, to save it, and then Ctrl+X to exit.
Other commands like commit --amend will use the editor as well. I personally would recommend using it this way as it allows you to write more meaningful messages. Well, you can technically do that also inline with -m, but having your editor setup and the ability to write multiple lines easily is really convenient.
If you want to take things further, you can even enforce particular message formats... but that is admittedly more advanced (read: cumbersome )
I probably should have figured this out on my own by camly surveyinig Nano. But I panicked when I started to navigate and to my surprise my navigation input was being inserted into the document. Chaos ensued as I tried to figure out how to get out of there without writing a bunch of gibberish.
Most of my projects require only very simple commit messages so I can keep track of what I've done, since I'm the only one on the project and just pushing to a remote that is just a bare repo on a USB drive. But I will follow your advice and start using commit --amend sometimes so I can keep my mind limber.