5.1 Vim Introduction
1. vim is an upgraded version of VI
2. Vim is a color display
3. Yum install vim command:
[< /span>[email protected] ~]# Yum install-y vim-enhanced
4 . three modes : General mode edit mode Command mode
Enter edit mode: I key or a key
5.2 Vim color display and move cursor
Display color, depending on the file name type content syntax, etc.
General mode: Shortcut keys!
light The label moves to first line gg
cursor moves to End of Line : Shift key + g
cursor left Move: h
cursor Right Move: L
cursor Right Move: Space Bar (Specify the mobile number + SPACEBAR to move the specified number of bytes)
cursor Upward Move: k
cursor downward Move: J
5.3 Vim General mode move cursor
1. VIM display color conditions are many: file name, file content, file directory and other factors, the display of the color is not nearly the same.
2. Move the cursor in general mode
Specify Digital + Specify Key = Move to the specified location
Digital One + keyboard h = The current cursor is located, move 11 characters to the left
5.4 Copy cut paste in general mode
1. Cut cursor line DD
scissors Cut 5 lines ( cursor line and bottom 4 line 5 + DD
2. Copy cursor line yy
copy 5 rows ( Cursor Line and the Next 4 lines ): 5 + yy
3. Paste to Cursor downlink Span style= "font-family: Microsoft Jacob Black, Microsoft Yahei; font-size:22px; Color:rgb (223, 64, 42); " > P
4. Paste to Cursor Upstream : Shift + P (uppercase P)
5. Delete cursor pre-character -- shift + X ( capital X)
Delete First 5 characters -- 5 + Shift + x
6. Delete cursor post character -- x
Delete after 5 characters -- 5 + x
7. restore Previous action: u
8. Reverse Restore Previous action :Ctrl + r
9 . tag selected characters: v + move key
Mark selected Character clipping: v + Move Key + x
Paste: P
5.1 Vim-5.4vim Editor