Align text on an equals sign in vim

后端 未结 9 2449
一生所求
一生所求 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:51

    The best plugin I found so far is Tabular.vim.

    Easiest way to install it is by using the Pathogen plugin, and then cloning the Tabular git repository to ~/.vim/bundle/tabular. Full instructions in the Pathogen README.

    After it's installed, using it is just a matter of putting your cursor somewhere in the paragraph you want to align and running:

    :Tab /=
    

提交回复
热议问题