Vim editor function list

1. Text editor vim

1.1 Moving the Cursor

h move to the left
l move to the right
j Move Downward
k Move up

insert image description here

1.2 Vim entry and exit

  • First make sure you load the normal mode (key press)
  • Then press 'shift+' on the keyboard and enter 'q! ', press Enter,
    exiting the editor in this way will discard the changes you have made since entering the editor
  • vimtutor<Enter>, you can enter vim practice

1.3 Text editing delete

  • In command mode, you can press the 'x' key to delete the character at the cursor position
    For example:
    insert image description here
    insert image description here

1.4 Insertion of text editing

  • In command mode, you can press the i key to insert text

insert image description here
insert image description here

1.5 Addition of text editing

  • Press A to add text
    insert image description here
    insert image description here

1.6wq save the file and exit

insert image description here

2. Delete class command

2.1dw can delete the end from the cursor

1. Press to make sure it is in normal mode
2. Move the cursor to the beginning of the word to be deleted
3. Input dw to delete the word
insert image description here
insert image description here

2.2d$ Delete from the current cursor to the end of the line

insert image description here
insert image description here

2.3dd can delete the entire line of a current

insert image description here
insert image description here

Three. Three modes of the vim editor

Command mode: move the cursor, jump, copy, delete...
input mode; edit the content of the file
Last line mode: exit the vim editor, save, and realize the format setting

3.1 Command mode

insert image description here
1.G can jump to the last line 1G, gg can jump to the last line. 10G can jump to the tenth line
2.yy can copy the whole line, 2yy can copy two lines
down 3.p paste down, p paste up
4 .u undo once, U undo all

3.2 Input mode

 i 从光标所在开始编辑
 o  从光标所在行的下一行开始编辑

3.3 Operation in last row mode

q Exit
q without saving! Force quit without saving
wq save and quit
i ignore case

Guess you like

Origin blog.csdn.net/fyb012811/article/details/131853728