vi and vim commands

http://www.codingdomain.com/file manipulation from the command line:
:r somefile – read in “somefile”
😡 – save and exit (if file is “Read Only”, this command will
exit without saving)
:wq – write and quit (same as above)
:w – write (save) if the file permissions allow it
:w! – save file even if it is read-only as long as we own it
:w somefile – save this file as “somefile”
:q – quit without saving
:q! – quit without saving if changes were made
text input commands (all require “Esc” to terminate):
i – insert text before the character cursor is on
I – insert text at the beginning of the line
a – append (insert text after the character cursor is on)
A – append text to the end of the line
c – change (replace previous text with new one)
takes arguments just like the delete command – it is
a fast and powerful way of changing original text –
much more so than typical “overwrite”
R – start overwriting text
o – start entering text at the beginning of the new line
below the cursor
O – start entering text at the beginning of the new line
above the cursor

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.