簡體   English   中英

如何拉扯相對線?

[英]How to yank relative line?

我打開了相對的行號。

我可以使用:10y猛拉第10行。

但是如何我說下當前線下面的第5行沒有跳到所述線, 5jY5k和跳回(即5jY5k )。

如果我有這個文件:

2   describe 'foobar' do
1     it 'should be cool' do
46      # do stuff
1     end
2  end

我在第46行,我想要在相對的第1或第2行,無論是上方還是下方。

您可以使用+n-n作為相對地址:

:+2y    " Two lines after the current line
:-2y    " Two lines before the current line

你也可以結合這個:

:-2,+2y   "  Two lines before the cursor and two lines after

另請參閱此答案以獲取更多示例和:help [range]獲取Vim文檔。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM