我在 DataMapper 文档中看到以下代码,Serial
、String
.. 全部对齐在一起,我可以在 Vim 中做同样的事情吗?
class Post
include DataMapper::Resource
property :id, Serial # An auto-increment integer key
property :title, String # A varchar type string, for short strings
property :body, Text # A text block, for longer string data.
property :created_at, DateTime # A DateTime, for any date you might like.
end
最佳答案
您可以尝试 Tabularize.vim
插件。运行此命令:
:Tabularize /:\w\+,\|#/
您需要的是匹配分隔符的模式。
:\w\+,
将匹配:id,
,:title,
, ...#
将匹配注释符号
关于vim - 如何在 Vim 中使所有制表符缩进对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13472498/