要从光标所在位置删除到句子末尾,请使用字母,使用“d)”。“d”是删除命令对象,后面跟着一个运动对象“)”,它将光标(和删除过程)前进到句子的末尾。
要删除句子“周围”,包括所有多余的空格,请使用“das”(删除句子周围)。或者要删除句子内部,而不是所有空格,则使用“dis”(删除句子内部)。
一旦你理解了VIM语言,那么你就可以轻松记住大量的操作。使用此表来了解 VIM 的词汇:
计数数字 + 文本对象命令 + 动作(或操作员)“3das”将执行“删除句子周围 3 次”
因此,如果可行的话,您可以在后面放置一个数字...命令:
d=delete
y=yank (into memory buffer to "put" later)
c=change (delete then insert new text)
Run Code Online (Sandbox Code Playgroud)
然后是一个动议:
) = move cursor to end of sentence
( = move cursor to beginning of prior sentence
} = move cursor to the next paragraph
{ = move cursor to the beginning of the prior paragraph
w = move cursor to next word
b = move cursor back a word
$ = move cursor to the end of the logical line
0 = (zero) move cursor to the beginning of the logical line
G = move cursor to the end of the file
gg = move cursor to the beginning of the file
h, j, k, or l (you might have to look those up)
Run Code Online (Sandbox Code Playgroud)
或者使用以下命令定义面积场,而不是运动:
a = around
i = inside
Run Code Online (Sandbox Code Playgroud)
后跟光标周围区域的名称:
s = sentence
p = paragraph
w = word
t = xml-tag <tag example> lots of text between tags </tag example>
< or > = inside or around a tag, frequently found in xml documents
{ [ ( ) ] } = inside or around any type of bracket ...
... {a large area [some more (a little stuff) things] of a great many things }
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4880 次 |
| 最近记录: |