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

I can not align by #

Open dlintw opened this issue 7 years ago • 2 comments

sample text

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

I wish it could convert to

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

dlintw avatar Jan 25 '17 01:01 dlintw

It works for me, have you tried:

:%EasyAlign /#/

rderik avatar Jan 25 '17 21:01 rderik

Lines with # are not working for me as well.

satishskamath avatar Mar 26 '21 21:03 satishskamath

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

j-xella avatar Mar 07 '24 12:03 j-xella

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

https://github.com/junegunn/vim-easy-align/issues/114#issuecomment-343356693

junegunn avatar Mar 07 '24 13:03 junegunn