Skip to content

Instantly share code, notes, and snippets.

@esdras
Created September 20, 2016 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esdras/e6a428d73d906b55606ad8be38a0324d to your computer and use it in GitHub Desktop.
Save esdras/e6a428d73d906b55606ad8be38a0324d to your computer and use it in GitHub Desktop.
SQL embedded in vim heredoc string
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Sql
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" use with vim-polyglot
" paste in vim-polyglot/after/syntax/ruby.vim
let s:bcs = b:current_syntax
unlet b:current_syntax
syn include @SQL syntax/pgsql.vim
let b:current_syntax = s:bcs
syntax region rubyHereDocSQL matchgroup=Statement start=+<<\z(SQL\)+ end=+^\z1$+ contains=@SQL
syntax region rubyHereDocDashSQL matchgroup=Statement start=+<<-\z(SQL\)+ end=+\s\+\z1$+ contains=@SQL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment