Vim初级用法速查

[b]Chapter 2. Simple Editing (简单的编辑命令) [/b]
[table]
|Table 2.1. Edit Commands
|Text Object | Change | Delete | Copy
|1 word | cw | dw | yw
|2 words, not counting punctuation | 2cW or c2W | 2dW or d2W | 2yW or y2W
|3 words back | 3cb or c3b | 3db or d3b | 3yb or y3b
|1 line | cc | dd | yy or Y
|To end of line | c$ or C | d$ or D | y$
|To beginning of line | c0 | d0 | y0
|Single character | r | x or X | yl or yh
|Five characters | 5s | 5x | 5yl
[/table]
[table]
|Table 2.2. Movement
|Movement | Commands
|←,↓,↑,→ | h, j, k, l
|To first character of next line | +
|To first character of previous line | -
|To end of word | e or E
|Forward by word | w or W
|Backward by word | b or B
|To end of line | $
|To beginning of line | 0
[/table]
[table]
|Table 2.3. Other Operations
|Operations | Commands
|Place text from buffer | P or p
|Start vi, open file if specified | vi file
|Save edits, quit file | ZZ
|No saving of edits, quit file | :q!
[/table]
[table]
|Table 2.4. Text Creation and Manipulation Commands
|Editing Action | Command
|Insert text at current position | i
|Insert text at beginning of line | I
|Append text at current position | a
|Append text at beginning of line | A
|Open new line below cursor for new text | o
|Open new line above cursor for new text | O
|Delete line and substitute text | S
|Overstrike existing characters with new text | R
|Join current and next line | J
|Toggle case | ~
|Repeat last action | .
|Undo last change | u
|Restore line to original state | U
[/table]
[b]Chapter 3. Moving Around in a Hurry (快速移动命令) [/b]
[table]
|Table 3.1. Movement Commands
|Movement | Command
|Scroll forward one screen. | ^F
|Scroll backward one screen. | ^B
|Scroll forward half screen. | ^D
|Scroll backward half screen. | ^U
|Scroll forward one line. | ^E
|Scroll backward one line. | ^Y
|Move current line to top of screen and scroll. | z RETURN
|Move current line to center of screen and scroll. | z.
|Move current line to bottom of screen and scroll. | z-
|Redraw the screen. | ^L
|Move to home—top line of screen. | H
|Move to middle line of screen. | M
|Move to bottom line of screen. | L
|Move to first character of next line. | RETURN
|Move to first character of next line. | +
|Move to first character of previous line. | -
|Move to first non-blank character of current line. | ^
|Move to column n of current line. | n|
|Move to end of word. | e
|Move to end of word (ignore punctuation). | E
|Move to beginning of current sentence. | (
|Move to beginning of next sentence. | )
|Move to beginning of current paragraph. | {
|Move to beginning of next paragraph. | }
|Move to beginning of current section. | [[
|Move to beginning of next section. | ]]
|Search forward for pattern. | /pattern
|Search backward for pattern. | ?pattern
|Repeat last search. | n
|Repeat last search in opposite direction. | N
|Repeat last search forward. | /
|Repeat last search backward. | ?
|Move to next occurrence of x in current line. | fx
|Move to previous occurrence of x in current line. | Fx
|Move to just before next occurrence of x in current line. | tx
|Move to just after previous occurrence of x in current line. | Tx
|Repeat previous find command in same direction. | ;
|Repeat previous find command in opposite direction. | ,
|Go to given line n. | nG
|Go to end of file. | G
|Return to previous mark or context. | ` `
|Return to beginning of line containing previous mark. | ' '
|Show current line (not a movement command). | ^G
[/table]
[b]Chapter 4. Beyond the Basics [/b]
[table]
|Table 4.1. More Editing Commands
|Change | Delete | Copy | from Cursor to ...
|cH | dH | yH | top of screen
|cL | dL | yL | bottom of screen
|c+ | d+ | y+ | next line
|c5| | d5| | y5| | column 5 of current line
|2c) | 2d) | 2y) | second sentence following
|c{ | d{ | y{ | previous paragraph
|c/pattern | d/pattern | y/pattern | pattern
|cn | dn | yn | next pattern
|cG | dG | yG | end of file
|c13G | d13G | y13G | line number 13
[/table]
[table]
复制内容可以指定剪贴板
|Table 4.3. Buffer Names |
|Buffer Names | Buffer Use |
|1-9 | The last nine deletions, from most to least recent. |
|a-z | Named buffers for you to use as needed. Uppercase letters append to the buffer. |
[/table]
作标签
[table]
|Table 4.4. Buffer and Marking Commands |
|Command | Meaning |
|"bcommand | Do command with buffer b. |
|mx | Mark current position with x. |
|'x | Move cursor to first character of line marked by x. |
|`x | Move cursor to character marked by x. |
|`` | Return to exact position of previous mark or context. |
|'' | Return to beginning of the line of previous mark or context. |
[/table]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值