Linux into Vim's edit mode and command mode Operation command

Source: Internet
Author: User

Enter edit mode:


Keys

Role

I

Insert in current word match either

L

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

Insert a new row on the previous line in the current row


Vim Command mode:


Keys

Role

/word

Look for a string after the cursor word, press N to go back to search

? word

Find a string before the cursor word, press N to continue searching

: n1,n2s/word1/word2/g

Find word1 before N1-N2 line 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 can be saved

: q!

Force exit, all changes are not valid

: Wq

Save and exit

: Set Nu

Show line Numbers

: Set Nonu

Do not display line numbers


This article is from the "Gary Blog" blog, please be sure to keep this source http://taoxie.blog.51cto.com/10245493/1980049

Linux into Vim's edit mode and command mode Operation command

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.