在Vim中,为什么V在yanking之后选择更多的线?

前端之家收集整理的这篇文章主要介绍了在Vim中,为什么V在yanking之后选择更多的线?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
第一次使用2V时,Vim会在视觉模块中选择2行,正如我所料.当我清除选择并再次执行2V时,它再次选择2行.凉.

但是当我做2V,然后用y猛拉时,接下来的2V将选择4行.如果我保持在2V和y之间交替,则2V将使每次选择的行数加倍.

为什么会这样?我假设它与寄存器有关,但我找不到直接的答案…为什么寄存器的内容会影响V?

这是 vim中的特殊行为.它在帮助中记录:

If Visual mode is not active and the “v”,“V” or CTRL-V is preceded with a
count,the size of the prevIoUsly highlighted area is used for a start. You
can then move the end of the highlighted area and give an operator. The type
of the old area is used (character,line or blockwise).

  • Linewise Visual mode: The number of lines is multiplied with the count.

猜你在找的Bash相关文章