" Define regions for ruby heredocs that tag the resulting string according to " another support vim syntax. " marker - pattern to match in heredoc delimiter " language - name of the vim language file (without .vim) function s:define_heredoc_syntax(marker,language) " Title-case the language name let l:caps_language = toupper(strpart(a:language,0,1)).strpart(a:language,1) " Load the other syntax definition let l:save_syntax = b:current_syntax unlet b:current_syntax execute 'syntax include @ruby'.l:caps_language.' syntax/'.a:language.'.vim' let b:current_syntax = l:save_syntax " Define additional heredoc definitions " First, those without the - (delimiter must be first thing on line) execute 'syn region ruby'.l:caps_language.'String matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@