R: change to the Replace mod
gg: jump to the head of the file
G:jump to the tail of the file
$:jump to the tail of the line
^:jump to the head of the line
shift + ~: change the current smaller letter to bigger, or the bigger to smaller
x:delete the content on the right
X:delete the content on the left
ctrl + v : change to visual block mod, use hjkl th decide a paremeter, and
then use shift + i to change to insert mod, input "//" in the current position then every line you have chosen will be dealt with
d: under visual-block mod, use d to delete a lot of content
shift + #:search the current word within the whole file
o and a:enter the insert mod, but the difference is that the former
will start a new line for you when you enter the mod, the latter will
start a new space of letter for you
shift + zz: exit vim
:!g++/gcc filename:bianyiwenjian
:!ls -al -> !./a.out: output the result of the operation
!command: make the command operated without leaving vim
%s/word1/word2: change word1 to word2
:vs filename can make you edit multiple file at the same time, and you can move the cursor by ctrl+w/ww
Vim常用指令整理
最新推荐文章于 2025-08-10 23:04:57 发布