Skip to content

Commit

Permalink
Added basic syntax file for editing sls files (yaml + jinja)
Browse files Browse the repository at this point in the history
  • Loading branch information
whiteinge committed Mar 8, 2012
0 parents commit fd7368d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Vim files for working on Salt files.

syntax/sls.vim
A syntax file for editing yaml + jinja sls files.
34 changes: 34 additions & 0 deletions syntax/sls.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
" Vim syntax file
" Language: Salt States template
" Maintainer: Seth House <[email protected]>
" Last Change: 2011 Dec 05
"
" You probably want this in your .vimrc for now:
" au BufNewFile,BufRead *.sls set ft=sls

if exists("b:current_syntax")
finish
endif

if !exists("main_syntax")
let main_syntax = 'yaml'
endif

let b:current_syntax = ''
unlet b:current_syntax
runtime! syntax/yaml.vim

let b:current_syntax = ''
unlet b:current_syntax
syntax include @Yaml syntax/yaml.vim

let b:current_syntax = ''
unlet b:current_syntax
syntax include @Jinja syntax/django.vim

syn cluster djangoBlocks add=djangoTagBlock,djangoVarBlock,djangoComment,djangoComBlock
syn region djangoTagBlock start="{%" end="%}" contains=djangoStatement,djangoFilter,djangoArgument,djangoTagError display containedin=ALLBUT,@djangoBlocks
syn region djangoVarBlock start="{{" end="}}" contains=djangoFilter,djangoArgument,djangoVarError display containedin=ALLBUT,@djangoBlocks
syn region djangoComBlock start="{#" end="#}" contains=djangoTodo containedin=ALLBUT,@djangoBlocks

let b:current_syntax = "sls"

0 comments on commit fd7368d

Please sign in to comment.