Charles Campbell
unread,Jun 29, 2020, 1:25:20 PM6/29/20Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Christian Brabandt, vim...@googlegroups.com
Hello, Christian:
I see that you've picked up maintaining the matchit plugin. I've been
having problems with it recently -- problems that I didn't used to have.
* I used to be able to use the % key, in vimscript, to jump between if
.. elseif ..endif
* I used to be able to bypass {{{3 in comments and still matchit-jump
between matching {...}s.
To do these things I have in .vim/after/ftplugin, for vim:
" Custom MatchIt Support: {{{1
let b:match_words=
'\<fu\%[nction]\>:\<retu\%[rn]\>:\<endf\%[unction]\>,\<wh\%[ile]\>:\<brea\%[k]\>:\<con\%[tinue]\>:\<endw\%[hile]\>,\<if\>:\<el\%[seif]\>:\<en\%[dif]\>,\<try\>:\<cat\%[ch]\>:\<fina\%[lly]\>:\<endt\%[ry]\>,\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,(:),\<for\>:\<endfor\=\>'
In .vim/ftplugin/c I have, for c:
" Custom Matchit Support: {{{1
let b:match_words=
\ '\%(\<else\s\+\)\@<!\<if\>:\<else\s\+if\>:\<else\%(\s\+if\)\@!\>,' .
\ '\<switch\>:\<case\>:\<default\>,'.
\ &matchpairs
and in .vim/ftplugin/syntax/c I have, for c:
syn match cFolding "{{{\d\+" containedin=cComment
syn match cFolding "}}}\d\+" containedin=cComment
" modify matchit to exclude matching {}s and whatnot inside ChipDbg
strings
let b:match_skip='synIDattr(synID(line("."),col("."),1),"name") =~?
"cComment\\|character\\|special\\|ChipDbg\\|cFolding"'
I verified this by not seeing the desired behavior with the current
matchit and verifying that did work properly with the old matchit. For
now, I'm using the Benji F's matchit...
Regards,
Chip Campbell