开发者

vim tabular plugin question

开发者 https://www.devze.com 2023-02-05 09:26 出处:网络
Before @stallone = Factory :user, :name => \'Sylvester\', :age => 64 @schwarzenegger = Factory :user, :name => \'Arnold\', :age => 63

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
@schwarzenegg开发者_开发知识库er = Factory :user, :name => 'Arnold',    :age => 63

How to make such alignment with tabular plugin for VIM?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消