This commit implements filter option which can be used to filter lines within
the range based on the given pattern. The value of filter option should be
either `g/pattern/` or `v/pattern/`. The former aligns lines that match the
pattern, the latter aligns lines that do not match the pattern.
This commit adds LiveEasyAlign command. (The name was chosen not to introduce
ambiguity when typing in only the prefix of the command: e.g. `:EasyA*|`)
In live interactive mode, the selected text is aligned on-the-fly as the user
type in. In order to finalize the alignment, the user has to type in the
same delimiter key again. (Or CTRL-X on regular expressions)
By default, unmatched trailing token from each line is also aligned in
right and center alignment modes unlike in left alignment mode. If
ignore_unmatched option is explicitly set to 1 by user, they will be ignored
even in right/center modes.
With this commit, we can now change option values in interactive mode with the
folowing special keys
- CTRL-L left_margin
- CTRL-R right_margin
- CTRL-D delimiter_align
- CTRL-I indentation
- CTRL-U ignore_unmatched
- CTRL-G ignore_groups
('ignores' option has been renamed to 'ignore_groups', but backward-compatible)
With this commit you can right-align the last token with * or ** field number.
For example, the following lines
a = 1
bb = 22
ccc = 333
are aligned as follows on `:EasyAlign**=`
a = 1
bb = 22
ccc = 333
And even if we don't have the second =, we can do `:EasyAlign!2=` to get
a = 1
bb = 22
ccc = 333
Unmatched line is NOT ignored on right-justification mode. However this
commit makes such a line ignored when the end of the line is highlighted
as one of the ignored syntax groups (e.g. Comments or Strings)
- Preserve indentation when a line starts with a delimiter
- Useful for aligning multi-line method chains
- Renamed `margin_{left,right}` to `{left,right}_margin
- Makes it easier to type in (`l`, `r`)
- `margin_{left,right}` is still supported
- Margins can be specified as the number of spaces, or as an arbitrary string