Add delimiter_align option

This commit is contained in:
Junegunn Choi
2013-08-12 20:33:04 +09:00
parent 712bab8c72
commit 5e6e60d620
6 changed files with 258 additions and 55 deletions

View File

@@ -1,3 +1,5 @@
*easy_align.txt* A simple, easy-to-use Vim alignment plugin
vim-easy-align *vim-easy-align* *easy-align*
=========================================================================
@@ -117,6 +119,7 @@ Available options are as follows.
| left_margin | number or string | 0 |
| right_margin | number or string | 0 |
| stick_to_left | boolean | 0 |
| delimiter_align | string | 'r' |
| ignore_unmatched | boolean | 1 |
| ignores | array | `['String', 'Comment']` |
@@ -235,6 +238,36 @@ Then we get,
}
Aligning delimiters of different lengths *g:easy_align_delimiter_align*
-------------------------------------------------------------------------
Global `g:easy_align_delimiter_align` option and rule-wise/command-wise
`delimiter_align` option determines how matched delimiters of different
lengths are aligned.
apple = 1
banana += apple
cake ||= banana
By default, delimiters are right-aligned as follows.
apple = 1
banana += apple
cake ||= banana
However, with `:EasyAlign={'da':l}`, delimiters are left-aligned.
apple = 1
banana += apple
cake ||= banana
And on `:EasyAlign={'da':c}`, center-aligned.
apple = 1
banana += apple
cake ||= banana
Extending alignment rules *g:easy_align_delimiters*
-------------------------------------------------------------------------