[英]vim: yank lines above the current line together with the current line
I find myself doing Nyy
very often to yank the current line and N-1
lines below. 我发现自己经常做
Nyy
以Nyy
当前线和下面的N-1
线。 So 3yy
would yank the current line and 2 more lines (so all together 3). 因此,
3yy
会3yy
当前行和另外2行(所以总共3行)。
I know how to yank N
lines above the current line ( yNk
), but this does not include the current line. 我知道如何在当前行(
yNk
)上方yNk
N
行,但这不包括当前行。 What I want is to yank the current line and N-1
lines above. 我想要的是猛拉当前线和上面的
N-1
线。 How do I do this (ideally also with the yy
command)? 我该怎么做(理想情况下还使用
yy
命令)?
Edit: Apparently yNk
includes the current line as well. 编辑:显然
yNk
包括当前行。 I must have missed it. 我一定错过了。 Thx for the comments.
感谢你的评论。
The following will yank the current line plus two above: 以下内容将使当前行加上以上两行:
2yk
Obviously changing the 2
will alter the number of lines yanked above. 显然,改变
2
会改变上面猛拉的线数。 No number is an implicit 1
, so yk
is equivalent to 1yk
. 没有数字是隐含
1
,因此yk
相当于1yk
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.