I've opened and modified a vim or vi that I don't normally use when editing a configuration file, but I can't get back to the terminal from vim/vi.
How to terminate vim/vi (hereafter referred to only as vim) in such cases
This will put Vim in neutral mode and allow you to enter commands
You should see the command you're typing in the lower left corner of the screen.
I'm an uncle of emacs, so I must have forgotten how to terminate Vi.