vim tabular plugin question

青春壹個敷衍的年華 提交于 2019-12-11 02:24:42

问题


Before

@stallone = Factory :user, :name => 'Sylvester', :age => 64
@schwarzenegger = Factory :user, :name => 'Arnold', :age => 63

Some magic...

After

@stallone       = Factory :user, :name => 'Sylvester', :age => 64
@schwarzenegger = Factory :user, :name => 'Arnold',    :age => 63

How to make such alignment with tabular plugin for VIM?


回答1:


I don't know Tabular (looks pretty neat), but it seems cutalion has the solution.

Just map that to something:

map <Leader>a :Tab / = /l0<CR>:Tab / :/l0<CR>

If you needed to do some selectiong, add gv (reselect last selection) as appropriate.



来源:https://stackoverflow.com/questions/4742334/vim-tabular-plugin-question

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!