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