只要一个键盘的Visual Studio Code : Vim 之 Cheat Sheet(●----●)

本文介绍了如何在Visual Studio Code中使用Vim模式,重点聚焦于Normal模式下的核心操作,帮助开发者提高编辑效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Normal mode

NotationMeaningConduction
xdelete N chars under and after cursorpress x once
wcursor N words forwardpress w once
aappend text after the cursor N timespress a once
nrepeat the latest ‘/’ or ‘?’ N timespress n once
Nrepeat the latest ‘/’ or ‘?’ N times in opposite directionpress shift & n
pput the text after the cursor N timespress p once
Gcursor to line N, default last linepress shift & g
ggcursor to line N, default first line start Select modepress gg
Aappend text after the end of the line N timespress shift & a
Cchange from the cursor position to the end of the line, and N-1 more linespress shift & c
Renter replace modepress shift & r
s(substitue)delete N chars and start insertpress s
Sdelete N lines and start insert; synonym “cc”press shift&s
obegin a new line below the cursor and insert text, repeat N timespress o
Obegin a new line above the cursor and insert text, repeat N timespress shift&o
bcursor N words backwardpress b
>{motion}shift Nmove lines one ‘shiftwidth’ rightwardspress >
d{motion}delete Nmove textpress d then any keys associated with motions
gu{motion}make lowercacepress g & u then {motion}
gU{motion}make uppercacepress g & U then {motion}
c{motion}delete Nmove text and start insertpress c
d{motion}delete N move txtpress d once
y{motion}yank Nmove textpress y
r{char}replace N chars with {char}press r & {char}
f{char}cursor to the Nth occurrence of {char} to the leftpress f then any single char
F{char}cursor to the Nth occurrence of {char} to the leftpress F & {char}
` {A-Za-z}cursor to the mark {a-zA-Z0-9}press ` and any char
m{A-Za-z}set mark {A-Za-z} at cursor positionpress m then {A-Za-z}
t{char}cursor till before Nth occurrence of {char} to the leftpress t & {char}
T{char}cursor till after Nth occurrence of {char} to the rightpress T & {char}
gr{char}virtual replace N chars with {char}press g & r & {char}
gRenter virtual replace modepress g & R
gaprint ascii value of character under the cursorpress g & a
g<C-]>same as :tjump to the tag under the cursorpress g then press Ctrl&] same time
^cursor to the first CHAR of the linepress ^
$cursor to the end of Nth next linepress $
*search forward for the Nth occurrence of the ident under cursorpress *
.repeat the last change with count replaced with Npress .
:use command-line mode to execute an Ex commandpress /
/use command-line mode to perform a forward searchpress /
?use command-line mode to perform a backward searchpress ?
=use command-line mode to evaluate a Vim script expressionpress =
;repeat latest f, t, F or T N timespress ;
,repeat latest f, t, F or T in opposite direction N timespress ,
@:repeat the previous “:” command N timespress @&:
&repeat last : spress &
<C-]>ta to ident under cursorpress Ctrl & ]
<C-N>same as “j”, cursor N lines downwardpress Ctrl&N same time
<C-R>same as “u”, redo changes which were undone with ‘u’press Ctrl&R
<C-=>zoom windowspress Ctrl&W & Ctrl&=
<C-W>=make all windows same height & widthpress Ctrl&W and =
<CR>press the carriage return key (also known as <Enter>)
<C-L>redraw screenpress Ctrl&L
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值