junegunn / junegunn/vim-easy-align
Improve the support of syntax highlighting groups
- Dominant language
- Vim Script
- Stars
- 4.2k
- Forks
- 122
- PR merge metrics
- No merged PRs in 30d
Description
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](https://stackoverflow.com/questions/9464844/how-to-get-group-name-of-highlighting-under-cursor-in-vim) 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 group `zshComment` which is _linked_ to the `Comment` 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 !!!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.