=============================================================================VI/VIM Command Review and Practice:---------------------------------------The Command mode yy copies the contents of the line where the cursor is located 4yy the copy cursor is located on the line starting with the 4 line of content p paste dd Delete/cut the contents of the line where the cursor is located 2DD Delete/The cut cursor is located on the line where the 2-row content D starts to delete from the current cursor/cut, until the end of the line d0 from the current cursor start delete/cut to the beginning of the line x delete/Cut the current cursor, only delete/Cut One (right delete) X Delete/Cut the one in front of the current cursor, only delete/Cut One (left delete) DW Delete/cut a word---------------------------------------H left J down K up L right---------------------------------------H the upper M of the current screen below the current screen of the middle L---------------------------------------Ctrl+f Turn down a page Ctrl+b turn up one page---------------------------------------20G Quick positioning to line 20th code G quick position to the last line of code GG quickly navigates to the first line of code---------------------------------------W Jump back one word length B jump forward one word length---------------------------------------u undo just the action Ctrl+R anti-undo---------------------------------------v+↑/↓ Select an area (where the cursor is, where the area is) V+↑/↓ Select an area (the entire row of the entire row of the area)>>Move code Overall right<<move the entire code to the left--------------------------------------- . Repeatedly executes the last command---------------------------------------{move by Segment, move up} press the break movement, move down---------------------------------------R replaces a character R with the character after the current cursor--------------------------------------- /haha find where haha appear, display in a yellow background/HHHH find characters that don't exist n next n prev---------------------------------------Shift+zz Save and exit Edit--------------------------------------- last line mode : w save edit: Q Exit Edit: Wq Save and exit Edit: Q!do not save exit edits--------------------------------------- Last-line mode :%s/hello/world/g Replace the hello of all lines into world:11,16s/hello/world/G replaces 11 rows and 16 lines of Hello with the world=====================================================================
Vi/vim Command Review and practice