假设我有以下选项哈希作为Ruby 1.9.x中方法的参数:
my_method :arg1,
some_option: "value 1"
some_other_option:true
option_three: 123
使用Tabular VIM插件,正则表达式将是什么,以使Hash对齐,如下所示:
my_method :arg1,
some_option: "value 1"
some_other_option: true
option_three: 123
[C0必须与密钥保持连接,与JSON不同,]。>
也许是一种更具视觉吸引力的样式,看起来更加对齐:
:
任何人都有机会知道如何使用Tabular完成这两种对齐方式吗?
谢谢!
假设我有以下选项哈希作为Ruby 1.9.x中方法的参数:my_method:arg1,some_option:“ value 1” some_other_option:true option_three:123使用表格VIM ...
为了获得第一个对齐,可以使用命令
我经常使用Tabular,但是我从来没有找到尝试其“高级”功能的机会。 :Tab/\w:\zs/r0l1l0
中出现了与您的示例类似的情况: