2015-06-04 by Komile
VIM Basic Command
Open a file vim index.php
Description of several modes
Normal Mode
That is, the general Normal mode, the default into Vim, in this mode.
Insert Mode
Insert mode, in fact, refers to the state of editing input. In normal mode, you can press I to enter.
Command-Line
command-line mode, normal mode by the colon (:) into command-line mode, you can enter a variety of commands
General mode
Four directional keys
J: down, K: Up, H: left, L: Right
10J: Move Down 10 rows
10k: Move up 10 rows
0: Start with a line
$: End of line
Shift+g: Jumps to the last line
GG: Jump to the first line
DDP up and down two lines interchange
CTRL +G show current file information
DD: Delete When moving forward
3DD: Cursor row, delete 3 rows down
YYP: Copy a line below the cursor
YyP: Copy to top of cursor
GD, queries the current word and retains it to the current location
In the Insert mode
A: Insert after cursor
o: Insert a row below the cursor line
Shift+o: Inserts a row on the line where the cursor is located
Shift+i cursor to beginning of line edit
I cursor original position edit
Command-line mode
: Wq Save changes and exit
: W save does not exit, generally can be used for debugging
: 40 Move to line 40th
:!pwd View the path to the current file
VIM Basic Command