int main() { // { }
vim --clean a.c%Vim should ignore characters inside comments and jump to the matching '}' of the next line.
I can't use % in ‘vim/src/cindent.c:2136‘ to jump, pressing % does nothing. I guess the reason is Vim doesn't ignore the '{' of line 2690.
VIM - Vi IMproved 9.2 (2026 Feb 14, compiled May 13 2026 21:13:30) Included patches: 1-357
N/A
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
Vims % matching is simplistic and does not consider comments. User the matchit plugin for more advanced % matching. Closing as duplicate
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
fun! s:HighlightOperators()
syntax match alabaster_Special1 "?\|+\|-\|\*\|:\|<\|>\|&\||\|!\|\~\|\^\|%\|)\|(\|\.\|/\(/\|*\)\@!"
syntax match alabaster_Special2 "\[\|\]\|{\|}\|,\|;"
syntax match alabaster_Assign "=\|+=\|-=\|\*=\|\/=\|%=\|&&=\|||=\|\~=\|\^=\|&=\||=\|:="
syntax match alabaster_CompOverride "==\|!=\|>=\|<=\|<=>"
syntax match alabaster_FatArrowOverride "=>"
syntax match alabaster_Glue "::"
hi alabaster_Special1 ctermfg=37 guifg=#009999
hi alabaster_Special2 ctermfg=34 guifg=#009900
hi alabaster_Assign ctermfg=83 guifg=#66FF33
hi alabaster_CompOverride ctermfg=37 guifg=#009999
hi alabaster_FatArrowOverride ctermfg=34 guifg=#009900
hi alabaster_Glue ctermfg=243 guifg=#999999 ctermbg=black guibg=#000000 cterm=bold
endfunction
augroup Alabaster
au Syntax * call s:HighlightOperators()
au ColorScheme * call s:HighlightOperators()
augroup END
packadd matchit
Thank you. But my theme has syntax match, it seems conflict with matchit. Do you know how to deal? I try to use matchadd to instead syntax match, but it will lead to highlight characters inside comments.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
And the question is what?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
After using the vimscript above, matchit also fails to bracket-match in the aforementioned C files.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()