Enter edit mode, vim command mode, VIM practice

Source: Internet
Author: User
Tags aliases

Enter edit mode

1, [[email protected] ~]# vi/etc/services

2, the input lowercase I and then issued will appear--insert--, you can edit

#

# Each line describes one service, and is of the form:

#

# service-name Port/protocol [aliases ...] [# Comment]


--INSERT--


3, you can add a line under the cursor, with a lowercase o


Vim Command mode

1. Find

/even

# Each line describes one service, and is of the form:


#

# service-name Port/protocol [aliases ...] [# Comment]

/even


2. Press N to select Next (Look down)

3, input? Even select N Forward lookup

4. Replace all even characters with test, and if you don't add g, replace the first line

: 1, $s/enev/test/g

5,: 1,955s/zserv/test/g, in 1 rows to 955 lines replace


Vim Practice

1, [[email protected] ~]# Cp/etc/services/temp/1.txt

2, need to view 45 rows

: 45

3. Delete a row

Dd

Delete 3 rows

3dd

4, restore the previous step

U

5. Move to the last line

G

6. Move to the beginning of the line

Gg

7, copy 2 lines

2yy

8. Paste

P

9, press U to restore the previous step, press Ctrl+r opposite

This article is from the "Discover new things" blog, make sure to keep this source http://shenj.blog.51cto.com/5802843/1977698

Enter 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.