Align End Of Line Comments in Vim?

前端 未结 3 870
春和景丽
春和景丽 2020-12-15 22:30

Inside Vim, is there a formatting command that would align a block of end of line comments?

For example in C++, it would turn this:

m_varName1;   //          


        
相关标签:
3条回答
  • 2020-12-15 22:42

    The tabular.vim plugin should be able to do this. Select them visually, and align them with

    :Tabularize /\/\/
    
    0 讨论(0)
  • 2020-12-15 22:44

    Use the Align plugin for Vim to align based on whatever separator(s) you choose.

    0 讨论(0)
  • 2020-12-15 22:53

    I have had a similar problem today where I wanted to align on a whitespace in a certain position. Just wrote a blog post about how I did it with the Align plugin.

    0 讨论(0)
提交回复
热议问题