Skip to content

Instantly share code, notes, and snippets.

@petdance
Created March 14, 2017 16:36
Show Gist options
  • Save petdance/8ec0c42289b149de3e5bda8bddca6c30 to your computer and use it in GitHub Desktop.
Save petdance/8ec0c42289b149de3e5bda8bddca6c30 to your computer and use it in GitHub Desktop.
$ cat ~/.vim/after/syntax/perl.vim
" ~/.vim/after/syntax/perl.vim
let s:bcs = b:current_syntax
unlet b:current_syntax
syntax include @SQL syntax/sql.vim
let b:current_syntax = s:bcs
syntax region perlHereDocSQL start=+<<['"]SQL['"].*;\s*$+ end=+^SQL$+ contains=@SQL
syntax region perlHereDocSQL start=+<<['"]SQL_TEXT['"].*;\s*$+ end=+^SQL_TEXT$+ contains=@SQL
syntax region perlHereDocSQL start=+<<['"]__SQL__['"].*;\s*$+ end=+^__SQL__$+ contains=@SQL
" Turn off the SQL folding that causes problems with Perl.
:syntax clear sqlFold
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment