Vim Full-screen plain text editorVim Use1 Vim file namelast-line modecommand----> input a append i insert O open (line break)command----> Last line: w Save: q! do not save exit: Wq Save and exit: N moves to the first line (n refers to a number): Set Nu sets line number: Set Nonu de-set line number 2 Command mode operation 1) Cursor MovementH J k L (on one line) GG Move to the beginning of the fileG move to end of file 2) Delete entire row clippingDD Delete a single lineNDD Delete multiple linesp paste Past (delete how many lines to paste)x Delete a characterDG is removed from the line where the cursor is located to the end of the file 3) CopyyyNyy 4) Revocationu undoctrl+r anti-revocation 5) Display line number: Set Nu: Set Nonu Vim configuration file~/.VIMRC manually created, vim configuration file 6) Find/Find what to look down (enter first) N NextN Previous 7) Replace: 1,10s/old/new/g replaces all old with 1 to 10 rows as new:%s/old/new/g replaces entire file with old as new:%s/you want to replace who/what/g%s/backup/aaa/g: Add # to the beginning of 21,23s/^/#/g: Add # to the end of 21,23s/$/#/g A = ten#a =10:%s///g
Linux-vim Editor