I only use vi when I must. The commands I memorized so far are:
ZZ save and exit
$ go to end of line
^ go to beginning of line
I recently installed OpenBSD 5.9. Then I had to use
ed to bring up the system because there are no other editors included. So once again I had to search for how to edit and save file with vi and I forget it already. Now I now it's something with pressing ctrl once or twice to switch between modes and
:x!! to save and exit. It seems that I only must remember two commands to do what I must and get out of the vi confusion but I use vi so rarely that I tend to forget it what I must know.
Now if I once and for all try to learn the minimal requirement of what I should know e g how to edit a file and save it, which I have been able to do and then I installed nano and emacs.
For instance, I will never forget ctrl+shift+prtscr+B+U+S+I+E+R because of the mnemonic, how can I learn the basics of vi once and for all?
Or did I miss something and vi is actually so much better that the editors I use today (Clion, emacs, nano, Sublime, Gedit). Now I find that I can do almost everything I want by just remembering these simple commands:
:x save and exit
Esc switch to control mode
Now I find that I can actually use the vi editor to create a file, edit it and save it with this basic knowledge: I create and open the file by writing
vi myfile.txt then I can press i to get into insert mode, write my text and then press : x to save and exit. If all goes wrong, I can press Esc twice and
:q to get out of vi without saving and start again.
Can you answer or comment if this very basic knowledge of vi will be good enough to save me from googling next time or can you infer what I should or must know next time I'm on a system that only has vi?