Vi/Vim Basic ReferenceBy Dag, on January 25th, 2017
A very short reference on using Vi/Vim.
Not my first option but sometimes the only one. When I started with Linux in '99/'00 I immediately attached myself to Pico, then Nano. I could never use it for more than basic editing needs though, nor did I want to. So for those who does, in a *nix environment, I understand. My more advanced editing needs are done in a graphical environment, admittingly mostly on a Windows workstation.
ESC goes to command mode, where I can: dd - to delete current line. u - to undo last action. shift+x - to delete previous character from curser. x - to delete next character from cursor. i - to start inserting before cursor. a - to start inserting after cursor. :q - to quit without changes (use :q! to force). :wq - to quit saving changes. i and a will enter input mode. ESC will go back to command mode.
This is pretty much all the basics I need in emergency editing where nano is not available, as Vi/Vim is sometimes the only default alternative on slim GNU/Linux installations without Internet access. Keeping it simple will make it easier to remember and use at those rare occations.