Vi: Difference between revisions

No edit summary
No edit summary
 
Line 29: Line 29:


=== [[VI Cheetsheet]] ===
=== [[VI Cheetsheet]] ===
* Esc - Escape to view-only mode.  Press ''Esc'' before using the following commands to get out of whatever mode you're already in.
* <kbd>Esc</kbd> - Escape to view-only mode.  Press ''Esc'' before using the following commands to get out of whatever mode you're already in.
* i - Enter insert mode.  Place the cursor where you want to type and press ''i'' before typing.
* <code>:w !sudo tee %</code> force write file using sudo to 'tee' the standard output to the file descriptor
* x - Delete the character under the cursor.
* <kbd>i</kbd> - Enter insert mode.  Place the cursor where you want to type and press ''i'' before typing.
* dd - Delete the current line.
* <kbd>x</kbd> - Delete the character under the cursor.
* :q! - Quit
* <code>dd</code> - Delete the current line.
* :wq - Save and Quit
* <code>:q!</code> - Quit
* <code>:wq</code> - Save and Quit
See our [[VI Cheetsheet]] or http://www.eec.com/business/vi.html for more
See our [[VI Cheetsheet]] or http://www.eec.com/business/vi.html for more