Created
August 10, 2016 22:21
-
-
Save hersha/a9781cf6df1b8678313db3c2b847b4f1 to your computer and use it in GitHub Desktop.
Ruby HEREDOC highlighting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let s:bcs = b:current_syntax | |
unlet b:current_syntax | |
syntax include @SQL syntax/sql.vim | |
" this unlet instruction is needed | |
" before we load each new syntax | |
unlet b:current_syntax | |
syntax include @SHELL syntax/sh.vim | |
let b:current_syntax = s:bcs | |
syntax region hereDocText matchgroup=Statement start=+<<[-~.]*\z([A-Z]\+\)+ end=+^\s*\z1+ contains=NONE | |
syntax region hereDocDashSQL matchgroup=Statement start=+<<[-~.]*\z(SQLDOC\)+ end=+^\s*\z1+ contains=@SQL | |
syntax region hereDocDashShell matchgroup=Statement start=+<<[-~.]*\z(SHELLDOC\)+ end=+^\s*\z1+ contains=@SHELL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment