-
Notifications
You must be signed in to change notification settings - Fork 121
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
Improve the support of syntax highlighting groups #159
Comments
The rule works well because Unfortunately,
I'm not a Neovim user, and I don't know if it works or not. Please send a pull request if it doesn't work and you're interested in making it work. Thanks. |
Hm ... well, not in my case. For example, I have a file with zsh syntax highlighting, and the following block of code in it (note the different number of spaces in the beginning): # aaa
# bbb
# ccc The SynGroup function returns the following when the cursor is on I select those lines in visual mode, and then But then, again, I use neovim. Maybe there are some other differences at play here ... |
Added the lines to my .zshrc, and Like I said, I'm not a Neovim user and this is all I have in my init.vim. call plug#begin()
Plug 'junegunn/vim-easy-align'
call plug#end()
" Start interactive EasyAlign in visual mode
xmap ga <Plug>(EasyAlign)
" Start interactive EasyAlign with a Vim movement
nmap ga <Plug>(EasyAlign) |
The implementation of syntax group support in EasyAlign is not very advanced and does not work in some cases.
Here I must digress for a moment and recommend the SynGroup function, which may be very useful in debugging this issue.
One thing that is not supported is syntax group linking (
synIDtrans
vim function would help here). For example, in zsh syntax highlighting, the comments belong to a syntax groupzshComment
which is linked to theComment
group. So, while the group is coloured as comments, it has a different name and hence the default EasyAlign#
rules do not match it. I suspect this is the reason for most problems when using the#
shortcut, such as #96.And don't get me started on the case when the syntax highlighting is done by treesitter in neovim :) I don't thing that
synID*
functions work correctly at all in such case. OK, I understand that this is a vim plugin, but hey, it is year 2024 now !!!The text was updated successfully, but these errors were encountered: