tabular icon indicating copy to clipboard operation
tabular copied to clipboard

Align to Nearest Tabstop

Open orbisvicis opened this issue 9 years ago • 1 comments

I don't think its possible to align to nearest tabstop without first counting characters of the longest line, manually. So I propose this:

  :Tabularize /,/r1tc1lt1

    abc     , d  , ghi
      a     , b
      a     , b  ,  c
    ---s....-s-.s-s---

Legend:

  • -: character
  • s: space
  • .: tab

Where tab is appropriate number of spaces if expandtab.

orbisvicis avatar Mar 09 '15 16:03 orbisvicis

Not sure which argument format is best:

" embed actual characters
" more powerful
/pattern/([lrc][^lrc]+)+/
" similar, with control-char delimiter
" most powerful
" more inconvenient to type
/pattern/([lrc][^<ctrl-x>]+<ctrl-x>)+/
" encode space/tab, plugin option to set default as space/tab
" backwards compatible
/pattern/([lrc](\d+[st]?|[st])+)+/

orbisvicis avatar Mar 10 '15 04:03 orbisvicis