Basic vim Commands

a.Vim has two mode .

1. Insert mode (Where you can just type like normal text editor. Press i for insert mode)

2. Command mode (Where you give commands to the editor to get things done . Press ESC for command mode)

b.Most of them below are in command mode:

  

Inserting Text

A Append text at the end of the line . (跳转光标至行尾)
i Insert text before the cursor . (跳转光标至当前位置)
I Insert text before the first non-blank in the line. (跳转光标至行首)

  

Deleting Text

[count]dd Delete [count] lines --> [count] fewer lines

[count]x

Delete [count] characters under and after the cursor

(删除[count倍数]单个字符)

Copying and Moving Text

[count]yy Yank(copy) [count] lines 
[count]p Put the text after the cursor [count] times.

c.Saving files

["x]p Put the text [from register x] after the cursor [count] times.
原文地址:https://www.cnblogs.com/JasperZhao/p/12893368.html