Align text on an equals sign in vim

后端 未结 9 2447
一生所求
一生所求 2020-12-12 22:48

I tend to align code on equal signs for better readability. From this:

$ = jQuery.sub()
Survey = App.Survey
Sidebar = App.Sidebar
Main = App.Main
         


        
9条回答
  •  醉酒成梦
    2020-12-12 22:49

    I believe this is easily done with the Tabular plugin. Here it is in action.

    Select the range in Visual mode (not actually necessary), and do:

    :Tabularize /=
    

    The plugin can actually find the correct range on its own often, without needing to select it visually or specify a range to the ex command.

提交回复
热议问题