开发者

How to run a command on last edit in vim (i.e. indent)

开发者 https://www.devze.com 2023-04-10 21:36 出处:网络
I added some lines in i开发者_如何学Pythonnsert mode and now I would like to run some command only on these edit. How to perform it?Marks \'[ and \'] locate the start and end lines of newest inserted

I added some lines in i开发者_如何学Pythonnsert mode and now I would like to run some command only on these edit. How to perform it?


Marks '[ and '] locate the start and end lines of newest inserted or changed text. From this, you can simply run

 :'[,']>

to indent those lines once. See :help '[ for more examples. And for instance, formatting the code will happen with

'[=']

and formating a chunk of text with

'[gq']
0

精彩评论

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