如何在vi中从中间开始缩进多行? [英] How to indent multiple lines starting from the middle in vi?
本文介绍了如何在vi中从中间开始缩进多行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如转换这个
$example = array(
'First' => 'This,
'Second' => 'is',
'Third' => 'an',
'Fourth'=> 'example',
'Fifth' => '.',
);
进入这个
$example = array(
'First' => 'This',
'Second' => 'is',
'Third' => 'an',
'Fourth' => 'example',
'Fifth' => '.',
);
不必缩进每个 =>;'无论如何',
每次.
without having to indent each => 'whatever',
each time.
这可以在 vi 中实现吗?
Is this possible to do in vi?
推荐答案
There are two Vim plugins for that, Align and Tabular. With Align, select the lines and execute
:'<,'>Align =>
Tabular 是古老的 Align 的更新替代品,但两者都提供相似的功能.根据您的喜好选择.
Tabular is a more recent alternative to the venerable Align, but both offer similar functionality. Pick according to your preferences.
这篇关于如何在vi中从中间开始缩进多行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文