当我尝试在 vim 中使用块选择从行尾删除时出现异常行为。
所以假设我有一个这样的文本:
delete this char:x
and this:x
also this:x
and then this:x
lastly this:x
如果我想附加
y
我能做到的每一行:4j
的行$
转到行尾A
y
为了得到:
delete this char:xy
and this:xy
also this:xy
and then this:xy
lastly this:xy
但如果我尝试删除
x
在最后一步而不是追加我希望得到:delete this char:
and this:
also this:
and then this:
lastly this:
虽然我最终得到:
delete this char:
and this:x:
also this:x:
and then this:x:
lastly this:x:
据我了解,它将第一行中的最后一个字符附加到所有其他行(在本例中为
:
)而不是删除丢失的字符(在本例中为 x
)。我可以用宏或替代品来做到这一点,但我不太明白这种行为背后的基本原理。有没有办法通过块选择来做到这一点?
最佳答案
你试过了吗:{range}normal
?这应该有效:
:'<,'>normal $x
(
'<,'>
位是在您输入 : 时为您填写的。)
关于vim - 在 vim 中使用 block 选择从行尾删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14165566/