4 week 3rd session vim enters edit mode command mode

Source: Internet
Author: User

Enter edit mode

Enter the mode in which the document can be edited

Key function
I Insert in current character
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 Insert a row below the line where the cursor is located
O Insert a row above the line where the cursor is located
Vim Command mode
Command function
/word Look for a string after the cursor word, press N to go back to search, N to return to search
? word Find a string before the cursor word, press N to continue searching
: n1,n2s/word1/word2/g Find word1 between n1-n2 row ranges and replace with Word2, and no G replaces only the first word1 of each row
: 1, $s/word1/word2/g Replaces all word1 in the document with Word2, and replaces only the first word1 of each line
Attention When replacing a path or ambiguous character, such as/etc/sysconfig, you need to use # or @ instead of "/" in the search, i.e.: #/etc/sysconfig#
: W Save text
: Q Exit Vim
: w! Force save, root user, even if read-only can save
: q! Force exit, all changes are not valid
: Wq Save and exit, modify Mtime
: X Save and exit, do not modify Mtime
: Set Nu Show line Numbers
: Set Nonu Do not display line numbers
: Nohl Do not display highlighting
Vim Practice

Find more scenes to practice


4 week 3rd session vim enters edit mode 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.