Useless VIM 按钮

本文详细介绍了Vim文本编辑器中的各种模式(如正常模式、插入模式、可视模式等)以及核心命令,包括移动、编辑、复制、删除、查找替换和宏录制等功能。
摘要由CSDN通过智能技术生成

set number

set relativenumber

move

h => left

j => down

k => up

l => right

n + h/j/k/l => left/down/up/right jump n line

Insert mode

i =>  insert before cursor

o => insert a new line below cursor

a => insert after cursor

I => cursor jump to the beginning of the line

O => insert a new line above cursor

A => cursor jump to the end of the line

v => Visual mode

V => Visual line mode

ctrl + v => Visual block mode

d => delete (cut)

y => copy (yank)

c => change

Normal mode

D => delete rest of the line

dd => delete whole line

yy == Y => copy whole line

5yy => copy 5 line

C => change rest of the line

cc => change whole line

r => replace

R => replace mode

p => paste below

P => paste above

u => undo

5u => undo 5 times

ctrl + r => redo

w => jump to next word (separated by space or -)

W => jump to next word (separated by space)

b => jump to previous word (separated by space or -)

B => jump to previous word (separated by space)

e => jump to the end of a word

0 => jump to the beginning of a line

$ => jump to the end of a line

% => jump between { and }

d% => delete between { and }

dw => delete next word

d2w => delete next 2 words

db => delete previous word

d2b => delete previous 2 words

d0 => delete until to the beginning of the line

d$ => delete until to the end of the line

diw => delete in a word

ciw => change in a word

yiw => copy in a word

di" => delete inner "

ci" => change inner "

yi" => copy inner "

di( => delete inner ()

ci( => change inner ()

yi( => copy inner ()

t* => jump to the position before next *

f* => jump to the next *

T* => jump to the position after previous *

F* => jump to the previous *

dt( => delete everything up until (

gg => jump to beginning of the file

G => jump to end of the file

15G == :15 => jump to line number 15

== => indented line

gg=G => indented all line in the file

search

/ => search

n => go next

N => go back up

? => reverse search

n => go back up

N => go next

# => search word upward

* => search word downward

ma => mark as “a” way point

'a => jump to the “a” way point

zz => scroll cursor to screen center

:%s/A/B/g => full file replace A to B

:s/A/B/g => replace A to B in selected lines (Visual mode)

. => repeat command

:reg => view registers (copy delete history)

"3p => paste name "3 register

qa + some actions + q => record the macro as name “a”

@a => execute macro “a"

  • 5
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值