I. Introduction of VIM
Vim is a powerful text editor, the upgrade version of VI, with color display, the default has three modes: General mode, command mode, edit mode
Install Vim
[Email protected] ~]# VIM/ETC/PASSWD
-bash:vim: Command not found
[Email protected] ~]#
[email protected] ~]# Yum install-y vim-enhanced
...
second, color display, Move Cursor
[[email protected] ~]# VIM/ETC/PASSWD under etc will display color according to different files,
[[email protected] ~]# cp/etc/passwd/tmp/does not display color in/tmp
[[email protected] ~]# VIM/ETC/VIMRC vim configuration file
Move the cursor in general mode
h or LEFT ARROW key: The cursor moves one character to the left
I or have arrow keys: The cursor moves one character to the right
K or UP ARROW: The cursor moves up one character
J or DOWN ARROW: the cursor moves down one character
Ctrl+b: Text page forward one page
Ctrl+f: Text page to turn backward one page
Number 0 or shift+6: Move to the top of the bank
Shift+4: Move to the end of the bank
GG: Move to First line
G: Move to the tail line
NG (n is any number): Moves to nth row
Third, delete, copy, paste
X: Delete one character forward
X: Remove one character backwards
NX: Remove n characters backwards
DD: Which row of the delete/pre-tangent cursor
NDD: Delete/Pre-tangent the line after row n rows
YY: The copy cursor is in the row
Small p: Pastes the copied or pasted content from the line where the cursor is located
Large p: Pastes the copied or pasted content from the line where the cursor is located
Nyy: Starts at the line where the cursor is located, copying the n rows down
U: Restore previous action
V: Move the cursor after V to select the specified character, then you can implement copy and paste
Linux centosvmware Vim Introduction, vim color display and move cursor, VIM general mode move cursor, VIM general mode copy, cut and paste