简体   繁体   English

如何在Vim中的光标上方缩进多行?

[英]How to indent multiple lines above the cursor in Vim?

I know that 3>> will indent the current line and the two lines below the cursor. 我知道3>>将缩进当前行和光标下方的两行。 How do I indent the current line and the two lines above? 如何缩进当前行和上面的两行?

It should be working with 它应该与

:-2,.>

or 要么

>2k

Or, select the line and the two above in visual mode and then just type > . 或者,在可视模式下选择该行和上面的两条,然后键入>

:he shift-left-right has more information about shifting. :he shift-left-right了解有关移位的更多信息。
:he :ranges tells you more about specifying ranges for a command. :he :ranges告诉您更多有关指定命令范围的信息。

2>k (or >2k ) 2> k (或> 2k

Remember from the manual, 请记住,从手册中

  *>>* >> Shift [count] lines one 'shiftwidth' rightwards. 

But also, 但是也,

  *>* >{motion} Shift {motion} lines one 'shiftwidth' rightwards. 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM