假设我有以下代码:
<p>
Hello
</p>
我想把它做出来
<p>Hello</p>
我想在行1的结尾处以普通模式将光标置于“ > ”上,并有一个命令可删除所有空格直到下一个字符。我能想到的最接近的动作是
d/Hello
要删除从“Hello”开始的所有内容,但问题是它还会删除光标下方的字符('>'),因此最终结果是
<pHello
</p>
你会如何做到这一点?
一种方法,当您不需要重复此操作多次时使用。
JxJx
解释:
J # Join current line with next one but substitute end of line with a space.
x # Remove the space.
Jx # Repeat same process for last line.
Vim中有一个tag
文本对象:
:'<,'>
:'<,'>j
:help v_at
at "a tag block", select [count] tag blocks, from the
[count]'th unmatched "<aaa>" backwards to the matching
"</aaa>", including the "<aaa>" and "</aaa>".
See |tag-blocks| about the details.
When used in Visual mode it is made characterwise.
vatJ
会得到相同的结果。 - Kambus:join
添加了空格,所以这并没有实际回答问题。 - Randy Morris^d0vatgJ
。简单地解释一下:
H
H
开始,可以跳过^这一步。