I am trying to use the vim plugin, Tabular , to align some invalid CSS code. Unfortunately, I can’t understand how to start a match at the beginning of the visual selection in Vim. Here is a sample code:
color: #a8a8a8;font-family: Helvetica; color: #d0d0d0; font-weight: normal; background-color: inherit; font-size: 13px !important; background-color: inherit; width: 16px; min-width: 16px; display: inline-block; margin-right: 2ex; margin-left: 2px; text-align: center; height: 0; line-height: .5ex; padding-top: 1ex; background: transparent;
My attempt to try left-justifying the beginning of the selection of the visual block has failed, and I wonder where exactly I made a mistake:
'<,'>Tabularize /\%V\s\+\zs\%V/
That is, in the visual selection, match any gaps and then start the match. This should go as far as the first word character and left alignment, but I don't think Tabularize recognizes the choice of the visual block. In addition, \%V has no clue ^ and breaks the regular expression each time. The combination ^\%V also failed me.
Any suggestions on how to quickly format and align the start of selecting a visual block in vim?
source share