Vim Introduction:
Vim is an upgraded version of VI, VIM is a color display, install vim using yum install-y vim-enhanced.
Vim is divided into three modes: General mode, edit mode and command mode.
Vim color display and move cursor:
Vim is displayed color, and is based on the name or content of the file to display different colors, and can be/etc/vimre to edit the configuration file, or in the user's home directory to edit VIM/ROOT/.VIMRC this file, the default file does not exist.
Vim General mode to move the cursor:
Move Cursor Command
Keys |
Role |
h or LEFT ARROW key |
The cursor moves one character to the left |
L or right ARROW keys. |
The cursor moves one character to the right |
K or downward direction key |
Move the cursor up one character |
J or DOWN ARROW keys |
Move the cursor down one character |
Ctrl+b or PageUp key |
Text page to turn one page forward |
Ctrl+f or PageDown key |
The text page turns backward one page |
Number 0 or Shift+6 |
Move to the beginning of the bank |
Shift+4 |
Move to the end of our line |
Gg |
Move to First line |
G |
Move to Tail line |
NG (n is any number) |
Move to Nth row |
Vim general mode copy, cut and paste:
Use the following shortcut command
Keys |
Role |
X,x |
X means to remove one character backwards and X to delete one character forward |
Nx |
Remove n characters backwards |
Dd |
Delete/Cut the row where the cursor is located |
NDD (n is number abbreviation) |
Delete/cut n rows after the row of the cursor |
Yy |
The copy cursor is in the row |
P |
From the line where the cursor is located, paste the contents that have been copied or pasted down |
P |
From the line where the cursor is located, paste the contents that have been copied or pasted up |
Nyy |
Copy n rows down from the line where the cursor is located |
U |
Revert back action |
V |
Moving the cursor after pressing v selects the specified character, and can be copied, pasted, and so on |
This article is from the "Gary Blog" blog, please be sure to keep this source http://taoxie.blog.51cto.com/10245493/1979733
Introduction to the simple application of VIM tools for Linux