Skip to content

Instantly share code, notes, and snippets.

@trak3r
Forked from reinh/README.md
Created April 24, 2013 12:37
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 trak3r/5451812 to your computer and use it in GitHub Desktop.
Save trak3r/5451812 to your computer and use it in GitHub Desktop.
" ~/.vim/after/syntax/ruby.vim
" Save buffer's current syntax
let s:bcs = b:current_syntax
unlet b:current_syntax
" Magic happens here.
syntax include @SQL syntax/sql.vim
" Restore buffer's current syntax
let b:current_syntax = s:bcs
" Match Ruby heredoc format (`<<` or `<<-` start tag, whitespace before end tag)
syntax region rubyHereDocSQL matchgroup=Statement start=+<<-\?SQL+ end=+^\s*SQL$+ contains=@SQL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment