vim-easy-align icon indicating copy to clipboard operation
vim-easy-align copied to clipboard

how to align sprit character?

Open wuqingze opened this issue 5 years ago • 1 comments

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

wuqingze avatar Jul 20 '20 20:07 wuqingze

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']},

hberge avatar Sep 18 '24 11:09 hberge