开发者

Cut to beginning/end of line, paste over to end/beginning of line

开发者 https://www.devze.com 2023-04-13 05:42 出处:网络
If I am in the middle of a line, how to I cut to the beginning/end of a line? (is copy different) If I am i开发者_开发技巧n the middle of a line, how do I paste over to the beg/end of the line? (is p

If I am in the middle of a line, how to I cut to the beginning/end of a line? (is copy different)

If I am i开发者_开发技巧n the middle of a line, how do I paste over to the beg/end of the line? (is pasting w/o copying over the text much different?)

thanks allot!


As Yoda said:

  1. d$ cuts to the end of the line
  2. d0 cuts to the beginning
  3. d^ cuts to first non-whitespace character

To paste over the 'head' of the line:

v^p

or

v0p

To make it remember the default register, you could use the _ unnamed register:

v$"_p

Note that in that case, the overwritten text is 'forgotten' instead of yanked. (By default replacing a visual selection effectively yanks the overwritten text, so you can put it somewhere else)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号