[CentOS 7 Series] Vim edit mode and command mode

Source: Internet
Author: User

First, the editing mode

Keys Role
I Insert in current word match either
I Insert at the beginning of the line where the cursor is located
A Insert in current word specifier
A Inserts at the end of the line where the cursor is located
O Inserts a new row on the next line in the current row
O Inserts a new line on the current line


Second, the command mode

Command Role
/word Look for a character after the cursor word, press N to continue searching backwards
? word Look for a character before the cursor Word, press N to continue searching
: n1,n2s/word1/word2/g Find word1 between n1-n2 rows and replace with Word2, and no G replaces only the first word1 of each row
: 1, $s/word1/word2/g Replace all word1 in the document with Word2, and no G replaces only the first word1 of each row
: W Save text
: Q Exit vim
: w! Force save, under root user, even if the text is read-only
: q! Force exit, all changes are not valid
: Wq Save exit, Mtime will update even without any changes
: X Save exit, Mtime does not update if no changes are in the
: Set Nu Show line Numbers
: Set Nonu
Do not display line numbers
: Nohl Cancel highlighting


Vim tools are used in a variety of ways, do not need to be deliberately to remember each, just remember some common. Other usually can practice familiar under.



This article is from the "garbled Age" blog, please be sure to keep this source http://juispan.blog.51cto.com/943137/1940737

[CentOS 7 Series] Vim edit mode and command mode

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.