Copyright: Attribution, allow others to create paper-based, and must distribute paper (based on the original license agreement with the same license Creative Commons )
Article Directory
vim is an enhanced version of vi (more a font color), now mainly used vim
these two commands function is the same. You hit vi victor.txt and vim victor.txt is the same, and so are the same.
A switch, three modes
Edit mode: the same word edit mode, and so on up and down arrow keys
two,
1. Enter edit mode from command mode
Can be inserted before the character at the cursor press i.
Other insert mode is achieved by moving a cursor position, all characters are inserted before the cursor.
command | meaning |
---|---|
i and I (uppercase i) | i inserted before the cursor, I first inserted line |
a sum A | After a cursor insertion, the insertion end of the line A |
o sum O | o at the cursor next line is inserted, O insert a row in the row where the cursor |
2. Move the cursor
command | meaning | command | meaning |
---|---|---|---|
h | The cursor is moved to the left | l | Move the cursor to the right |
j | Move the cursor down | k | Cursor up |
PS: a direction key to move | |||
ctrl+f | Scroll forward (front) | ctrl+b | Scroll backward (back) |
3. Delete
command | meaning |
---|---|
dd | Bank delete all content |
d0 | Delete the contents of the cursor before the Bank |
D | Delete the Bank cursor itself and subsequent content |
4. revoked
command | meaning |
---|---|
in | Undo |
ctrl + r | Anti revoked |
5. Copy Paste
command | meaning |
---|---|
yy | Copy the current line |
p | In the open position the cursor down the new line paste |
Reference:
more comprehensive:
https://www.jianshu.com/p/d2e4e377e6c5