Into the edit mode VIM Command mode VIM practice

Source: Internet
Author: User

Enter edit mode
Edit mode, which is the mode that we can modify the document, configure
I insert in the current word match either
I (uppercase) is inserted at the beginning of the line where the cursor is
A inserts after the current character
A (uppercase) is inserted at the end of the line.
o Insert another line below the current line
O (uppercase) Inserts an additional line above the current line

·
·
·
·
·
VIM Command mode
Find:/Add the characters you want to find:

·
Replace: (: 1,21s/yang/huang/g) means to replace Yang with Huang in 1-21 lines (no G will replace only the first one in a row)

·
Without the G-look.

·
(: 1, $s/yang/huang/g) means 1-The last line replaces Yang with Huang
If the word you want to replace character has a slash that conflicts with a slash in the original format, we can add a backslash before the slash to replace the word character.
If we replace/bin/bash with Yang, we can write it (: 1, $s/\/bin\/bash/yang/g) br/>! [] (http://i2.51cto.com/images/blog/201804/13/c711dc097779eaebe206e85562521df8.png?x-oss-process=image/ watermark,size_16,text_qduxq1rp5y2a5a6i,color_ffffff,t_100,g_se,x_10,y_10,shadow_90,type_zmfuz3pozw5nagvpdgk=)
`
You can also change the slash in the format to # or @.


`
: Wq Save Exit
: wq! Force Save exit
: q! Force not save exit
: Set NU Displays the number of rows
: Set Nonu does not display line numbers
: Nohl Suppress search results
: x (uppercase) is similar to: Wq, but is used when you do not change the contents of the file: Wq exit changes the Mtime, and: X (uppercase) does not
·

·
·
·
·
·
Vim Practice

Into the edit mode VIM Command mode VIM 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.