Vi/vim Command Review and practice

Source: Internet
Author: User

=============================================================================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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.