vi 编辑命令
创始人
2025-05-29 21:39:41

命令

Summary: movement keys

Here's a recap of the movement keys we just discussed, and a few extras.

Spacebar

advance the cursor one position

^B

page backward

^D

scroll down

^E

expose a line at the bottom of the screen

^F

page forward

^G

Positional status check

^N

next line, same column

^P

previous line, same column

^U

scroll up

^Y

expose a line at the top of the screen

+

next line, at the first non-whitespace character

-

previous line, at the first non-whitespace character

/string

Scan forward for string. If no string is specified, scans for the last string scanned for.

?

Scan backwards for string. If no string is specified, scans for the last string scanned for.

B

backwards one word, ignoring punctuation

linenumberG

Go to specified linenumber (an integer). Defaults to the last line.

H

move cursor to first line of screen

M

middle line of screen

L

last line of screen

W

forward a word, ignoring punctuation

b

backwards a word

e

end of current word

n

next instance of / or ? search pattern

w

next word

Summary: making changes

SPACE

Advance the cursor one position.

^W

Erase a word during insert.

.

Repeats the last change command.

O

Opens and inputs a new line, above the current line.

U

Undoes the changes you made to the current line.

a

Appends text after the cursor.

c

Changes the object you specify to the text you type in after.

d

Deletes the object that you specify.

i

Inserts text before the cursor.

o

Opens and inputs new lines, below the current line.

u

Undoes the last change.

Summary of moving and rearranging text

^

First non-whitespace character on line.

0

Beginning of the line.

$

End of the line.

)

Forward to next sentence break.

(

Backward to previous sentence break.

}

Forward to next paragraph break.

{

Backward to previous paragraph break.

]]

Forward to next section break.

[[

Backward to previous section break.

fx

Find character x forward in the line.

Fx

Find character x backward in the line.

p

Paste text after cursor.

P

Paste text before cursor.

y

Yank.

Y

Yank a whole line.

t

Forward to character x, for operations.

Tx

Back to character x, for operations.

参考

  • Linux Vi Command Help and Examples (computerhope.com)

相关内容

热门资讯

初中半命题作文【通用6篇】 初中半命题作文 篇一我的梦想梦想是每个人心中的火花,是引导我们前进的动力。我也有自己的梦想,那就是成...
美的瞬间初一作文(实用4篇) 美的瞬间初一作文 篇一美的瞬间初一作文初一,一个新的起点,一个新的开始。在这个充满希望和憧憬的时刻,...
初中英语作文常用短语【最新6... 初中英语作文常用短语 篇一In My HometownMy hometown is a small ...
初中的作文(优秀6篇) 初中的作文 篇一:我的梦想作文一:我的梦想初中的作文 篇二:如何养成良好的阅读习惯作文二:如何养成良...
初中优秀作文600字优秀(精... 初中优秀作文600字优秀 篇一:友谊的力量友谊是一种宝贵的情感,它能给我们带来无尽的欢乐和支持。我曾...