vim easyalign - dcsan/godocs GitHub Wiki
:EasyAlign : " preset characters (\=:.,&#|)
:EasyAlign |
:EasyAlign \ " \ means space:EasyAlign /[:;]+/:EasyAlign | " align by 1st `|`
:EasyAlign 3 | " align by 3rd `|`
:EasyAlign * | " align by all `|`s:EasyAlign * | l4r1
l4 " lN - left_margin
r1 " rN - right_margin
" spaces to the left/right of `|`
ar " a[lrc] - align
" align left/right/center
dr " d[lrc] - delimiter_align
" alignment of the delimeter itself:EasyAlign * /[;:]+/ l3
:EasyAlign*/[;:]+/l3apple = 1
banana += apple
cake ||= banana
url: jdbc:mysql://localhost/test
database: test
| `<Enter>` | right align |
| `1` | on 1st occurence |
| `2` | on 2nd occurence (and so on) |
| {Visual} ⏎ | activate for selection |
| ga {motion} | activate for motion/text object |
{:.greycode}
Then press options (if available), then a delimiter.
| ⏎ | Set alignment |
| <ctrl-l> 4 ⏎ | Set left_margin (to the left of the delimeter) |
| <ctrl-r> 4 ⏎ | Set right_margin |
| ↓ | no margin |
{:.greycode}
-
gaip<ctrl-l>8⏎=- puts 8 spaces before the equal sign