如何在vim中排列HAML属性?

时间:2016-02-25 22:16:52

标签: vim haml

我对将vim配置为缩进haml属性感兴趣。现在他们自动缩进到两个空格,但我希望它们像这样排列:

.some-div{ id: something, 
           data: { key: 'value' }, 
           title: 'etc' }
  .the-content
    = whatever

这是我目前的悲惨状况:

enter image description here

enter image description here

我希望它的行为更像是缩进红宝石的方式:

enter image description here

1 个答案:

答案 0 :(得分:1)

使用表格形成vim:

https://github.com/godlygeek/tabular

有一个很好的vimcast:

https://www.youtube.com/watch?v=S33w7rcxbOk