Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to align sprit character? #142

Open
wuqingze opened this issue Jul 20, 2020 · 1 comment
Open

how to align sprit character? #142

wuqingze opened this issue Jul 20, 2020 · 1 comment

Comments

@wuqingze
Copy link

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
@hberge
Copy link

hberge commented Sep 18, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants