Do% work on the β€œstart” or β€œend” in the SQL block

In TSQL, we use BEGIN END to span a block instead of {}. We can use% to start or end a block if you use {}, but I want to go to the beginning or end of a block, even if you use BEGIN, END, how can this be done?

+4
source share
1 answer

This is what the paid plugin matches! :)

:set filetype=sql :runtime macros/matchit.vim 

Subsequently, I could use % in begin / end too.

See :help sql-matchit and :echo b:match_words (after you set the file type to sql) for a list of all% word pairs working.

Thus, assuming b:match_words does not include begin / end by default, you should add a new pair as follows:

 :let b:match_words .= ',\<begin\>:\<end\>' 
+7
source

Source: https://habr.com/ru/post/1501984/


All Articles