vim-easy-align
vim-easy-align copied to clipboard
how to align sprit character?
for example, how can I change
System.out.println("hello world 1"); // hello1
System.out.println("hello 2"); // hello2
to
System.out.println("hello world 1"); // hello1
System.out.println("hello 2"); // hello2
I struggled a bit with the same. The reason it doesn't take the pattern is that it is inside a comment.
I edited the s:easy_align_delimiters_default table in autoload/easy_align.vim and added the pattern there, where I could add 'ignore_groups':['!Comment'] at the end.
The below line worked for me, and it also checks for an optional ! flag
\ 'c': { 'pattern': '//[ !]\?', 'left_margin': 1, 'right_margin': 1, 'stick_to_left': 0, 'ignore_groups':['!Comment']},