Some of the simplest configurations are those that can be written in the. VIMRC:
Description: Vimtutor is a good vim learning document that can be entered directly on the command line Vimtutor.
Delete the letter at the cursor with X;
Add with a at the end of a line;
Many commands that change text consist of an operator and an action.
The deletion command using the delete operator D is in the following format:
D Motion
which
D-delete operator.
Action object for the motion-operator (listed below).
A short list of actions:
W-does not include its first character from the current cursor position until the beginning of the next word.
e-from the current cursor current position until the end of the word, including the last character.
$-from the current cursor current position until the end of the current line.
Enter 0 (number 0) to move the cursor to the beginning of the line.
Enter $ to move the cursor to the end of the line.
Enter 2w to move the cursor forward by two words.
Enter 3e to move the cursor forward to the end of a third word.
A delete operator can be combined with an action. As above: d2w, d3e, D0, d$ and so on;
DD Delete the whole line, 2DD delete two rows;
Enter u to undo the last executed command, and enter U to undo the modification of the entire row.
Input Ctrl-r undo the Undo command, which is recovery.
Enter p after the last deleted content is placed in the cursor.
If you delete a row with DD and then press p, it will be pasted on the next line of the cursor.
To change the text until the end of a word, enter either CE or CW;
Changing the class operator works in the same way as deleting a class, which is equivalent to inserting mode. The Operation format is:
c [NUMBER] Motion
Enter CTRL-G to display the current position of the cursor in the current edit file and the file status information.
Enter uppercase G to allow the current cursor to jump directly to the last line of the file.
Enter GG to allow the current cursor to jump directly to the first line of the file.
Enter a line number, and then enter an uppercase G to jump to that line or enter: line number.
Enter R and a character to replace the character where the cursor is located.
Enter uppercase R to replace multiple characters consecutively.
Input: s/old/new/g can replace old to new, the cursor is on the line;
Input: S/old/new. Note that this command only changes the first matching string of the row where the cursor is located.
Enter: #, #s/old/new/g where #,# represents the line number of the two lines in several rows of the replace operation.
Input:%s/old/new/g is the replacement of each matching string in the entire file.
How to execute external commands within VIM: Enter:! The external command can then be executed immediately after entering an external command.
To save changes to a file, enter: W FILENAME.
Enter o to open a new line below the cursor and into insert mode.
Enter O to open a new line above the cursor and into insert mode.
W, e,$,0 can move the cursor;
Use V to enter visual mode, move cursor selection, copy text using operator y, paste text using P.
Write it here first and then add it later.