简体   繁体   中英

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. 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 :ranges tells you more about specifying ranges for a command.

2>k (or >2k )

Remember from the manual,

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

But also,

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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