In TSQL, we are using BEGIN END to embrace a block instead of {}. We can use % to go the beginning or ending of a block if using {}, but I want to go the beginning or ending of a block even if using BEGIN, END, how could that be done?
That's what the shipped matchit plugin is for! :)
:set filetype=sql
:runtime macros/matchit.vim
Afterwards I could use % on begin
/end
, too.
See :help sql-matchit
and :echo b:match_words
(after you set the filetype to sql) to get a list of all word pairs % is working on.
Thus, assuming b:match_words
woudn't include begin
/end
by default, you would add a new pair like this:
:let b:match_words .= ',\<begin\>:\<end\>'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With