tabular icon indicating copy to clipboard operation
tabular copied to clipboard

Option to not count lines which do not have the delimiter into the first field length

Open jan-matejka opened this issue 11 years ago • 1 comments

Consider file contents:

bundle edit_line append_groups_starting(v) {
vars:
  "index"        slist => getindices("$(v)");

classes:
  "add_$(index)"     not => groupexists("$(index)"),
                 comment => "Class created if group does not exist";

insert_lines:
  "$($(v)[$(index)])",
         comment => "Append users into a group file format",
      ifvarclass => "add_$(index)";
}

If you want to :Tabularize all the content's on delimiter '=>' it will count eg. the whole first line as first column and format all the rest accordingly.

It would be very usefull to say 'Tabularize by => but completely omit/ignore lines which does not contain the delimiter'

jan-matejka avatar Apr 19 '13 21:04 jan-matejka

You're looking for the (not yet documented) command :GTabularize - see the discussion at issue #10

You should be able to do what you want by doing :GTabularize /=> - it will work on all lines in the buffer by default, but it takes a range if you wanted to apply it to only the visual selection or some such.

godlygeek avatar Apr 22 '13 04:04 godlygeek