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

I can not align by # #96

Closed
dlintw opened this issue Jan 25, 2017 · 4 comments
Closed

I can not align by # #96

dlintw opened this issue Jan 25, 2017 · 4 comments

Comments

@dlintw
Copy link

dlintw commented Jan 25, 2017

sample text

a # 1
bc # 2
def # 3
ghi # 4

I wish it could convert to

a   # 1
bc  # 2
def # 3
ghi # 4
@rderik
Copy link

rderik commented Jan 25, 2017

It works for me, have you tried:

:%EasyAlign /#/

@satishskamath
Copy link

Lines with # are not working for me as well.

@j-xella
Copy link
Contributor

j-xella commented Mar 7, 2024

The '#' mapping is tied to "Comment" syntax group by default. The support of syntax groups has all sorts of problems, which I put in a separate ticket #159. My guess would be that in the file types that you work with the highlighting of comments is different from what the plugin expects.

I would suggest the following:

  1. Check that in your files, the syntax is recognized correctly and syntax highlighting is on.
  2. For neovim, the syntax highlighting is based on the old vim regex method, not treesitter
  3. Try typing Ctrl-G before # . That would override the dependency on Comment syntax group
  4. Try overriding the align rules for # (via g:easy_align_delimiters), providing different ignore groups
    • specify empty ignore_group to not use this feature at all
    • add the comment group names specific to the file types you work with

@junegunn
Copy link
Owner

junegunn commented Mar 7, 2024

gaip# or gaip-<space> all work well in this case.

#114 (comment)

@junegunn junegunn closed this as completed Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants