The VIM editor has two modes of operation: Normal mode and edit mode, when the editor is opened, the default is normal mode.
The VIM editor processes data in a memory buffer.
Vim (vi) filename Edit file
Press the I key to enter edit mode, press ESC to exit edit mode and go to normal mode.
In edit mode, press ESC to enter normal mode, then enter: Enter the command line mode, input QW (Q: Exit; w: Save) command to save the file and exit the Vim editor.
In command-line mode:
Q: If the buffer data is not modified, exit
Q! : Cancels all modifications to the buffer data and exits
W FileName: Save the file to another file name
WQ: Save the buffer data to a file and exit
Operations in Normal mode:
H: Move one character to the left
J: Move Down one line
K: Move up one line
G: Move to the last line
Num G: Move to the specified row
GG: Move to First line
X: Delete the character at the current cursor position
DD: Deletes the current cursor in the row
DW: Delete the word at the current cursor location
d$: Deletes the current cursor position to the end of the line
J: Delete line breaks at the end of the line at which the current cursor is located (stitching lines)
U: Undo Previous Edit Command
A: Append data after the current cursor
A: Append data at the end of the current line
Copy and paste (in normal mode):
Y: Copy
YW: Copying words
y$: Copy to end of line
P: Paste
V: Enter visual mode (high brightness displays the text to be copied)
Other popular editors are: Emacs, KDE, Gnome, and more.
Note: This blog post is for individual study notes only
Basic usage of VIM editor