Skip to content

Instantly share code, notes, and snippets.

@rmartinho
Last active December 13, 2015 19:59
Show Gist options
  • Save rmartinho/4966779 to your computer and use it in GitHub Desktop.
Save rmartinho/4966779 to your computer and use it in GitHub Desktop.
" Sets up multi-language syntax for Jekyll blog posts
fun! SetJekyllPostSyntax()
" Bring in YAML syntax for front matter
unlet b:current_syntax
syntax include @Yaml syntax/yaml.vim
syntax region yamlFrontmatter start=/\%^---$/ end=/^---$/ keepend contains=@Yaml
" Bring in C++11 syntax for code snippets
unlet b:current_syntax
syntax include @Cpp syntax/cpp11.vim
syntax region cppCodeSnippet matchgroup=Comment start=/^{% highlight cpp %}$/ end=/^{% endhighlight %}$/ keepend contains=@Cpp
" Re-enable Markdown syntax
let b:current_syntax='markdown'
" Limit text width
set textwidth=80
endfun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment