o # open a line below and insert
shift o # open a line above and insert
p # paste below
shift p # paste above
a # append
shift a # append at the end of the line
shift i # insert at the beginning of the line
/ return # search
n # next match
shift n # previous match
# # search the word currently hovering upward
* # search the word currently hovering downward
f <character> # find and jump over the next <character>
shift f <char> # jump over the previous <char>
t <character> # jump before the required <character>
shift t <char> # jump after the required <char>
# 对于以上f和t
; # 重复操作到下一个(往后)
, # 往前操作
x # delete current char
s # delete current char and go into insert mode
shift d # delete rest of the line
shift c # delete rest of the line and go into insert mode
shift s # delete the whole line and go into insert mode (indented)
d w # delete the rest of the word
c w # delete the rest of the word and go into insert mode
d i w
# magic "i"
y i <char> # yank all things inclosed by <char>
v i <char> y # 和上面效果一样,只不过先进了visual mode
d 2 i <{> # 删去两层{}内的内容
c i p # delete the paragraph
v a <{> # 选中且包含两边的{}
# moving
gg # go to the top
G # go to the bottom
: <line number> # jump to the line
<line number> G # jump to the line
<number> j # go down <number> lines (记得看relative line number)
{ # go up to next empty line
} # go down to next empty line
v } # 选中一个paragraph
ctrl u # up half page
ctrl d # down half page
% # moving to the matching pair ("dfdfdf"中的") 用于找func的开始
file
ctrl ^ # jump between recent opening two files
ctrl o # jump back files in the history
ctrl i # jump forward in the file history
# marks
:m<char> # local mark
:m<CHAR> # global mark
:Ex # open a file tree
# relate with windows
ctrl-w # begin the window commands
ctrl-w (then) v # open a vertical window
ctrl-w (then) s # open a horizontal window
ctrl-w hjkl # move between windows
:close # close window
ctrl-w c # close current window, especially useful for splited terminal
:resize some_num # increase some_num rows, or decrease
ctrl-w = # split windows evenly
# some other way to work with windows
:sp # horizontal split window
:vsp # vertical split window
# open terminal in vim
: bel[owright] ter
: vert[ical] bo[ttomright] ter
# resize window, increase/descrease current window size
:res[ize] +5
:res[ize] -5
fzf ctrl+p fuzzy finder plugin
Takeaway
ctr