开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜