Commits

Anonymous committed 88b1b63

add a bunch of new file types to vim

Comments (0)

Files changed (14)

.vim/ftdetect/haml.vim

+autocmd BufNewFile,BufRead *.haml setf haml
+autocmd BufNewFile,BufRead *.sass setf sass
+autocmd BufNewFile,BufRead *.scss setf scss

.vim/ftplugin/haml.vim

+" Vim filetype plugin
+" Language:	Haml
+" Maintainer:	Tim Pope <vimNOSPAM@tpope.org>
+" Last Change:	2010 May 21
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+  finish
+endif
+
+let s:save_cpo = &cpo
+set cpo-=C
+
+" Define some defaults in case the included ftplugins don't set them.
+let s:undo_ftplugin = ""
+let s:browsefilter = "All Files (*.*)\t*.*\n"
+let s:match_words = ""
+
+runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
+unlet! b:did_ftplugin
+
+" Override our defaults if these were set by an included ftplugin.
+if exists("b:undo_ftplugin")
+  let s:undo_ftplugin = b:undo_ftplugin
+  unlet b:undo_ftplugin
+endif
+if exists("b:browsefilter")
+  let s:browsefilter = b:browsefilter
+  unlet b:browsefilter
+endif
+if exists("b:match_words")
+  let s:match_words = b:match_words
+  unlet b:match_words
+endif
+
+runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim
+let b:did_ftplugin = 1
+
+" Combine the new set of values with those previously included.
+if exists("b:undo_ftplugin")
+  let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin
+endif
+if exists ("b:browsefilter")
+  let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter
+endif
+if exists("b:match_words")
+  let s:match_words = b:match_words . ',' . s:match_words
+endif
+
+" Change the browse dialog on Win32 to show mainly Haml-related files
+if has("gui_win32")
+  let b:browsefilter="Haml Files (*.haml)\t*.haml\nSass Files (*.sass)\t*.sass\n" . s:browsefilter
+endif
+
+" Load the combined list of match_words for matchit.vim
+if exists("loaded_matchit")
+  let b:match_words = s:match_words
+endif
+
+setlocal comments= commentstring=-#\ %s
+
+let b:undo_ftplugin = "setl cms< com< "
+      \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
+
+let &cpo = s:save_cpo
+
+" vim:set sw=2:

.vim/ftplugin/sass.vim

+" Vim filetype plugin
+" Language:	Sass
+" Maintainer:	Tim Pope <vimNOSPAM@tpope.org>
+" Last Change:	2010 Jul 26
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+  finish
+endif
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<"
+
+setlocal commentstring=//\ %s
+setlocal define=^\\s*\\%(@mixin\\\|=\\)
+setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','')
+setlocal omnifunc=csscomplete#CompleteCSS
+setlocal suffixesadd=.sass,.scss,.css
+
+let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
+
+" vim:set sw=2:

.vim/ftplugin/scss.vim

+" Vim filetype plugin
+" Language:	SCSS
+" Maintainer:	Tim Pope <vimNOSPAM@tpope.org>
+" Last Change:	2010 Jul 26
+
+if exists("b:did_ftplugin")
+  finish
+endif
+
+runtime! ftplugin/sass.vim
+
+" vim:set sw=2:

.vim/indent/haml.vim

+" Vim indent file
+" Language:	Haml
+" Maintainer:	Tim Pope <vimNOSPAM@tpope.org>
+" Last Change:	2010 May 21
+
+if exists("b:did_indent")
+  finish
+endif
+runtime! indent/ruby.vim
+unlet! b:did_indent
+let b:did_indent = 1
+
+setlocal autoindent sw=2 et
+setlocal indentexpr=GetHamlIndent()
+setlocal indentkeys=o,O,*<Return>,},],0),!^F,=end,=else,=elsif,=rescue,=ensure,=when
+
+" Only define the function once.
+if exists("*GetHamlIndent")
+  finish
+endif
+
+let s:attributes = '\%({.\{-\}}\|\[.\{-\}\]\)'
+let s:tag = '\%([%.#][[:alnum:]_-]\+\|'.s:attributes.'\)*[<>]*'
+
+if !exists('g:haml_self_closing_tags')
+  let g:haml_self_closing_tags = 'meta|link|img|hr|br'
+endif
+
+function! GetHamlIndent()
+  let lnum = prevnonblank(v:lnum-1)
+  if lnum == 0
+    return 0
+  endif
+  let line = substitute(getline(lnum),'\s\+$','','')
+  let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','')
+  let lastcol = strlen(line)
+  let line = substitute(line,'^\s\+','','')
+  let indent = indent(lnum)
+  let cindent = indent(v:lnum)
+  if cline =~# '\v^-\s*%(elsif|else|when)>'
+    let indent = cindent < indent ? cindent : indent - &sw
+  endif
+  let increase = indent + &sw
+  if indent == indent(lnum)
+    let indent = cindent <= indent ? -1 : increase
+  endif
+
+  let group = synIDattr(synID(lnum,lastcol,1),'name')
+
+  if line =~ '^!!!'
+    return indent
+  elseif line =~ '^/\%(\[[^]]*\]\)\=$'
+    return increase
+  elseif group == 'hamlFilter'
+    return increase
+  elseif line =~ '^'.s:tag.'[&!]\=[=~-]\s*\%(\%(if\|else\|elsif\|unless\|case\|when\|while\|until\|for\|begin\|module\|class\|def\)\>\%(.*\<end\>\)\@!\|.*do\%(\s*|[^|]*|\)\=\s*$\)'
+    return increase
+  elseif line =~ '^'.s:tag.'[&!]\=[=~-].*,\s*$'
+    return increase
+  elseif line == '-#'
+    return increase
+  elseif group =~? '\v^(hamlSelfCloser)$' || line =~? '^%\v%('.g:haml_self_closing_tags.')>'
+    return indent
+  elseif group =~? '\v^%(hamlTag|hamlAttributesDelimiter|hamlObjectDelimiter|hamlClass|hamlId|htmlTagName|htmlSpecialTagName)$'
+    return increase
+  elseif synIDattr(synID(v:lnum,1,1),'name') ==? 'hamlRubyFilter'
+    return GetRubyIndent()
+  else
+    return indent
+  endif
+endfunction
+
+" vim:set sw=2:

.vim/indent/html.vim

+" Description:	html indenter
+" Author:	Johannes Zellner <johannes@zellner.org>
+" Last Change:	Tue, 27 Apr 2004 10:28:39 CEST
+" 		Restoring 'cpo' and 'ic' added by Bram 2006 May 5
+" Globals:	g:html_indent_tags	   -- indenting tags
+"		g:html_indent_strict       -- inhibit 'O O' elements
+"		g:html_indent_strict_table -- inhibit 'O -' elements
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+    finish
+endif
+let b:did_indent = 1
+
+
+" [-- local settings (must come before aborting the script) --]
+setlocal indentexpr=HtmlIndentGet(v:lnum)
+setlocal indentkeys=o,O,*<Return>,<>>,{,}
+
+
+if exists('g:html_indent_tags')
+    unlet g:html_indent_tags
+endif
+
+" [-- helper function to assemble tag list --]
+fun! <SID>HtmlIndentPush(tag)
+    if exists('g:html_indent_tags')
+	let g:html_indent_tags = g:html_indent_tags.'\|'.a:tag
+    else
+	let g:html_indent_tags = a:tag
+    endif
+endfun
+
+
+" [-- <ELEMENT ? - - ...> --]
+call <SID>HtmlIndentPush('a')
+call <SID>HtmlIndentPush('abbr')
+call <SID>HtmlIndentPush('acronym')
+call <SID>HtmlIndentPush('address')
+call <SID>HtmlIndentPush('b')
+call <SID>HtmlIndentPush('bdo')
+call <SID>HtmlIndentPush('big')
+call <SID>HtmlIndentPush('blockquote')
+call <SID>HtmlIndentPush('button')
+call <SID>HtmlIndentPush('caption')
+call <SID>HtmlIndentPush('center')
+call <SID>HtmlIndentPush('cite')
+call <SID>HtmlIndentPush('code')
+call <SID>HtmlIndentPush('colgroup')
+call <SID>HtmlIndentPush('del')
+call <SID>HtmlIndentPush('dfn')
+call <SID>HtmlIndentPush('dir')
+call <SID>HtmlIndentPush('div')
+call <SID>HtmlIndentPush('dl')
+call <SID>HtmlIndentPush('em')
+call <SID>HtmlIndentPush('fieldset')
+call <SID>HtmlIndentPush('font')
+call <SID>HtmlIndentPush('form')
+call <SID>HtmlIndentPush('frameset')
+call <SID>HtmlIndentPush('h1')
+call <SID>HtmlIndentPush('h2')
+call <SID>HtmlIndentPush('h3')
+call <SID>HtmlIndentPush('h4')
+call <SID>HtmlIndentPush('h5')
+call <SID>HtmlIndentPush('h6')
+call <SID>HtmlIndentPush('i')
+call <SID>HtmlIndentPush('iframe')
+call <SID>HtmlIndentPush('ins')
+call <SID>HtmlIndentPush('kbd')
+call <SID>HtmlIndentPush('label')
+call <SID>HtmlIndentPush('legend')
+call <SID>HtmlIndentPush('map')
+call <SID>HtmlIndentPush('menu')
+call <SID>HtmlIndentPush('noframes')
+call <SID>HtmlIndentPush('noscript')
+call <SID>HtmlIndentPush('object')
+call <SID>HtmlIndentPush('ol')
+call <SID>HtmlIndentPush('optgroup')
+" call <SID>HtmlIndentPush('pre')
+call <SID>HtmlIndentPush('q')
+call <SID>HtmlIndentPush('s')
+call <SID>HtmlIndentPush('samp')
+call <SID>HtmlIndentPush('script')
+call <SID>HtmlIndentPush('select')
+call <SID>HtmlIndentPush('small')
+call <SID>HtmlIndentPush('span')
+call <SID>HtmlIndentPush('strong')
+call <SID>HtmlIndentPush('style')
+call <SID>HtmlIndentPush('sub')
+call <SID>HtmlIndentPush('sup')
+call <SID>HtmlIndentPush('table')
+call <SID>HtmlIndentPush('textarea')
+call <SID>HtmlIndentPush('title')
+call <SID>HtmlIndentPush('tt')
+call <SID>HtmlIndentPush('u')
+call <SID>HtmlIndentPush('ul')
+call <SID>HtmlIndentPush('var')
+
+
+" [-- <ELEMENT ? O O ...> --]
+if !exists('g:html_indent_strict')
+    call <SID>HtmlIndentPush('body')
+    call <SID>HtmlIndentPush('head')
+    call <SID>HtmlIndentPush('html')
+    call <SID>HtmlIndentPush('tbody')
+endif
+
+
+" [-- <ELEMENT ? O - ...> --]
+if !exists('g:html_indent_strict_table')
+    call <SID>HtmlIndentPush('th')
+    call <SID>HtmlIndentPush('td')
+    call <SID>HtmlIndentPush('tr')
+    call <SID>HtmlIndentPush('tfoot')
+    call <SID>HtmlIndentPush('thead')
+endif
+
+delfun <SID>HtmlIndentPush
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+" [-- count indent-increasing tags of line a:lnum --]
+fun! <SID>HtmlIndentOpen(lnum, pattern)
+    let s = substitute('x'.getline(a:lnum),
+    \ '.\{-}\(\(<\)\('.a:pattern.'\)\>\)', "\1", 'g')
+    let s = substitute(s, "[^\1].*$", '', '')
+    return strlen(s)
+endfun
+
+" [-- count indent-decreasing tags of line a:lnum --]
+fun! <SID>HtmlIndentClose(lnum, pattern)
+    let s = substitute('x'.getline(a:lnum),
+    \ '.\{-}\(\(<\)/\('.a:pattern.'\)\>>\)', "\1", 'g')
+    let s = substitute(s, "[^\1].*$", '', '')
+    return strlen(s)
+endfun
+
+" [-- count indent-increasing '{' of (java|css) line a:lnum --]
+fun! <SID>HtmlIndentOpenAlt(lnum)
+    return strlen(substitute(getline(a:lnum), '[^{]\+', '', 'g'))
+endfun
+
+" [-- count indent-decreasing '}' of (java|css) line a:lnum --]
+fun! <SID>HtmlIndentCloseAlt(lnum)
+    return strlen(substitute(getline(a:lnum), '[^}]\+', '', 'g'))
+endfun
+
+" [-- return the sum of indents respecting the syntax of a:lnum --]
+fun! <SID>HtmlIndentSum(lnum, style)
+    if a:style == match(getline(a:lnum), '^\s*</')
+	if a:style == match(getline(a:lnum), '^\s*</\<\('.g:html_indent_tags.'\)\>')
+	    let open = <SID>HtmlIndentOpen(a:lnum, g:html_indent_tags)
+	    let close = <SID>HtmlIndentClose(a:lnum, g:html_indent_tags)
+	    if 0 != open || 0 != close
+		return open - close
+	    endif
+	endif
+    endif
+    if '' != &syntax &&
+	\ synIDattr(synID(a:lnum, 1, 1), 'name') =~ '\(css\|java\).*' &&
+	\ synIDattr(synID(a:lnum, strlen(getline(a:lnum)), 1), 'name')
+	\ =~ '\(css\|java\).*'
+	if a:style == match(getline(a:lnum), '^\s*}')
+	    return <SID>HtmlIndentOpenAlt(a:lnum) - <SID>HtmlIndentCloseAlt(a:lnum)
+	endif
+    endif
+    return 0
+endfun
+
+fun! s:getSyntaxName(lnum, re)
+	return synIDattr(synID(a:lnum, match(getline(a:lnum), a:re) + 1, 0), "name")
+endfun
+
+fun! s:isSyntaxElem(lnum, re, elem)
+	if getline(a:lnum) =~ a:re && s:getSyntaxName(a:lnum, a:re) == a:elem
+		return 1
+	endif
+	return 0
+endfun
+
+fun! HtmlIndentGet(lnum)
+    " Find a non-empty line above the current line.
+    let lnum = prevnonblank(a:lnum - 1)
+
+    " Hit the start of the file, use zero indent.
+    if lnum == 0
+	return 0
+    endif
+
+    let restore_ic = &ic
+    setlocal ic " ignore case
+
+    " [-- special handling for <pre>: no indenting --]
+    if getline(a:lnum) =~ '\c</pre>'
+		\ || 0 < searchpair('\c<pre>', '', '\c</pre>', 'nWb')
+		\ || 0 < searchpair('\c<pre>', '', '\c</pre>', 'nW')
+	" we're in a line with </pre> or inside <pre> ... </pre>
+	if restore_ic == 0
+	  setlocal noic
+	endif
+	return -1
+    endif
+
+    " [-- special handling for <javascript>: use cindent --]
+    let js = '<script.*type\s*=\s*.*java'
+    if   0 < searchpair(js, '', '</script>', 'nWb')
+    \ || 0 < searchpair(js, '', '</script>', 'nW')
+	" we're inside javascript
+	if getline(lnum) !~ js && getline(a:lnum) !~ js
+	    if restore_ic == 0
+	      setlocal noic
+	    endif
+		" Open and close bracket:
+		if s:isSyntaxElem(lnum, '{', "javaScriptBraces") && s:isSyntaxElem(a:lnum, '}', "javaScriptBraces")
+			return indent(lnum)
+		elseif s:isSyntaxElem(lnum, '{', "javaScriptBraces")
+			return indent(lnum) + &sw
+		elseif s:isSyntaxElem(a:lnum, '}', "javaScriptBraces")
+			if s:isSyntaxElem(lnum, 'break', 'javaScriptBranch') && ! s:isSyntaxElem(lnum, '\(case\|default\)', "javaScriptLabel")
+				return indent(lnum) - 2 * &sw
+			endif
+			return indent(lnum) - &sw
+		endif
+
+		" cases:
+		if s:isSyntaxElem(lnum, '\(case\|default\)', "javaScriptLabel") && s:isSyntaxElem(a:lnum, '\(case\|default\)', "javaScriptLabel")
+			return indent(lnum)
+		elseif s:isSyntaxElem(lnum, '\(case\|default\)', "javaScriptLabel")
+			return indent(lnum) + &sw
+		elseif s:isSyntaxElem(a:lnum, '\(case\|default\)', "javaScriptLabel")
+			return indent(lnum) - &sw
+		endif
+
+		if getline(a:lnum) =~ '\c</script>'
+			let scriptline = prevnonblank(search(js, 'bW'))
+			if scriptline > 0
+				return indent(scriptline)
+			endif
+		endif
+		return indent(lnum)
+	endif
+    endif
+
+    if getline(a:lnum) =~ '\c</\?body' || getline(a:lnum) =~ '\c</\?html' || getline(a:lnum) =~ '\c</\?head'
+		return 0
+	endif
+    if getline(lnum) =~ '\c</\?body' || getline(lnum) =~ '\c</\?html' || getline(lnum) =~ '\c</\?head'
+		return 0
+	endif
+
+    if getline(lnum) =~ '\c</pre>'
+	" line before the current line a:lnum contains
+	" a closing </pre>. --> search for line before
+	" starting <pre> to restore the indent.
+	let preline = prevnonblank(search('\c<pre>', 'bW') - 1)
+	if preline > 0
+	    if restore_ic == 0
+	      setlocal noic
+	    endif
+	    return indent(preline)
+	endif
+    endif
+
+    let ind = <SID>HtmlIndentSum(lnum, -1)
+    let ind = ind + <SID>HtmlIndentSum(a:lnum, 0)
+
+    if restore_ic == 0
+	setlocal noic
+    endif
+
+    return indent(lnum) + (&sw * ind)
+endfun
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" [-- EOF <runtime>/indent/html.vim --]

.vim/indent/javascript.vim

+" Vim indent file
+" Language:	JavaScript
+" Author:	Ryan (ryanthe) Fabella <ryanthe at gmail dot com>
+" URL:		-
+" Last Change:  2007 september 25
+
+if exists('b:did_indent')
+  finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=GetJsIndent()
+setlocal indentkeys=0{,0},0),:,!^F,o,O,e,*<Return>,=*/
+" Clean CR when the file is in Unix format
+if &fileformat == "unix" 
+    silent! %s/\r$//g
+endif
+" Only define the functions once per Vim session.
+if exists("*GetJsIndent")
+    finish 
+endif
+function! GetJsIndent()
+    let pnum = prevnonblank(v:lnum - 1)
+    if pnum == 0
+       return 0
+    endif
+    let line = getline(v:lnum)
+    let pline = getline(pnum)
+    let ind = indent(pnum)
+    
+    if pline =~ '{\s*$\|[\s*$\|(\s*$'
+	let ind = ind + &sw
+    endif
+    
+    if pline =~ ';\s*$' && line =~ '^\s*}'
+        let ind = ind - &sw
+    endif
+    
+    if pline =~ '\s*]\s*$' && line =~ '^\s*),\s*$'
+      let ind = ind - &sw
+    endif
+
+    if pline =~ '\s*]\s*$' && line =~ '^\s*}\s*$'
+      let ind = ind - &sw
+    endif
+    
+    if line =~ '^\s*});\s*$\|^\s*);\s*$' && pline !~ ';\s*$'
+      let ind = ind - &sw
+    endif
+    
+    if line =~ '^\s*})' && pline =~ '\s*,\s*$'
+      let ind = ind - &sw
+    endif
+    
+    if line =~ '^\s*}();\s*$' && pline =~ '^\s*}\s*$'
+      let ind = ind - &sw
+    endif
+
+    if line =~ '^\s*}),\s*$' 
+      let ind = ind - &sw
+    endif
+
+    if pline =~ '^\s*}\s*$' && line =~ '),\s*$'
+       let ind = ind - &sw
+    endif
+   
+    if pline =~ '^\s*for\s*' && line =~ ')\s*$'
+       let ind = ind + &sw
+    endif
+
+    if line =~ '^\s*}\s*$\|^\s*]\s*$\|\s*},\|\s*]);\s*\|\s*}]\s*$\|\s*};\s*$\|\s*})$\|\s*}).el$' && pline !~ '\s*;\s*$\|\s*]\s*$' && line !~ '^\s*{' && line !~ '\s*{\s*}\s*'
+          let ind = ind - &sw
+    endif
+
+    if pline =~ '^\s*/\*'
+      let ind = ind + 1
+    endif
+
+    if pline =~ '\*/$'
+      let ind = ind - 1
+    endif
+    return ind
+endfunction

.vim/indent/sass.vim

+" Vim indent file
+" Language:	Sass
+" Maintainer:	Tim Pope <vimNOSPAM@tpope.org>
+" Last Change:	2010 May 21
+
+if exists("b:did_indent")
+  finish
+endif
+let b:did_indent = 1
+
+setlocal autoindent sw=2 et
+setlocal indentexpr=GetSassIndent()
+setlocal indentkeys=o,O,*<Return>,<:>,!^F
+
+" Only define the function once.
+if exists("*GetSassIndent")
+  finish
+endif
+
+let s:property = '^\s*:\|^\s*[[:alnum:]-]\+\%(:\|\s*=\)'
+
+function! GetSassIndent()
+  let lnum = prevnonblank(v:lnum-1)
+  let line = substitute(getline(lnum),'\s\+$','','')
+  let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','')
+  let lastcol = strlen(line)
+  let line = substitute(line,'^\s\+','','')
+  let indent = indent(lnum)
+  let cindent = indent(v:lnum)
+  if line !~ s:property && cline =~ s:property
+    return indent + &sw
+  "elseif line =~ s:property && cline !~ s:property
+    "return indent - &sw
+  else
+    return -1
+  endif
+endfunction
+
+" vim:set sw=2:

.vim/indent/scss.vim

+" Vim indent file
+" Language:	SCSS
+" Maintainer:	Tim Pope <vimNOSPAM@tpope.org>
+" Last Change:	2010 Jul 26
+
+if exists("b:did_indent")
+  finish
+endif
+
+runtime! indent/css.vim
+
+" vim:set sw=2:

.vim/syntax/haml.vim

+" Vim syntax file
+" Language:	Haml
+" Maintainer:	Tim Pope <vimNOSPAM@tpope.org>
+" Filenames:	*.haml
+" Last Change:	2010 Aug 09
+
+if exists("b:current_syntax")
+  finish
+endif
+
+if !exists("main_syntax")
+  let main_syntax = 'haml'
+endif
+let b:ruby_no_expensive = 1
+
+runtime! syntax/html.vim
+unlet! b:current_syntax
+silent! syn include @hamlSassTop syntax/sass.vim
+unlet! b:current_syntax
+syn include @hamlRubyTop syntax/ruby.vim
+
+syn case match
+
+syn region  rubyCurlyBlock   start="{" end="}" contains=@hamlRubyTop contained
+syn cluster hamlRubyTop add=rubyCurlyBlock
+
+syn cluster hamlComponent    contains=hamlAttributes,hamlAttributesHash,hamlClassChar,hamlIdChar,hamlObject,hamlDespacer,hamlSelfCloser,hamlRuby,hamlPlainChar,hamlInterpolatable
+syn cluster hamlEmbeddedRuby contains=hamlAttributesHash,hamlObject,hamlRuby,hamlRubyFilter
+syn cluster hamlTop          contains=hamlBegin,hamlPlainFilter,hamlRubyFilter,hamlSassFilter,hamlComment,hamlHtmlComment
+
+syn match   hamlBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=hamlTag,hamlClassChar,hamlIdChar,hamlRuby,hamlPlainChar,hamlInterpolatable
+
+syn match   hamlTag        "%\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@hamlComponent
+syn region  hamlAttributes     matchgroup=hamlAttributesDelimiter start="(" end=")" contained contains=htmlArg,hamlAttributeString,hamlAttributeVariable,htmlEvent,htmlCssDefinition nextgroup=@hamlComponent
+syn region  hamlAttributesHash matchgroup=hamlAttributesDelimiter start="{" end="}" contained contains=@hamlRubyTop nextgroup=@hamlComponent
+syn region  hamlObject         matchgroup=hamlObjectDelimiter     start="\[" end="\]" contained contains=@hamlRubyTop nextgroup=@hamlComponent
+syn match   hamlDespacer "[<>]" contained nextgroup=hamlDespacer,hamlSelfCloser,hamlRuby,hamlPlainChar,hamlInterpolatable
+syn match   hamlSelfCloser "/" contained
+syn match   hamlClassChar "\." contained nextgroup=hamlClass
+syn match   hamlIdChar "#{\@!" contained nextgroup=hamlId
+syn match   hamlClass "\%(\w\|-\)\+" contained nextgroup=@hamlComponent
+syn match   hamlId    "\%(\w\|-\)\+" contained nextgroup=@hamlComponent
+syn region  hamlDocType start="^\s*!!!" end="$"
+
+syn region  hamlRuby   matchgroup=hamlRubyOutputChar start="[!&]\==\|\~" skip=",\s*$" end="$" contained contains=@hamlRubyTop keepend
+syn region  hamlRuby   matchgroup=hamlRubyChar       start="-"           skip=",\s*$" end="$" contained contains=@hamlRubyTop keepend
+syn match   hamlPlainChar "\\" contained
+syn region hamlInterpolatable matchgroup=hamlInterpolatableChar start="!\===\|!=\@!" end="$" keepend contained contains=hamlInterpolation,hamlInterpolationEscape,@hamlHtmlTop
+syn region hamlInterpolatable matchgroup=hamlInterpolatableChar start="&==\|&=\@!"   end="$" keepend contained contains=hamlInterpolation,hamlInterpolationEscape
+syn region hamlInterpolation matchgroup=hamlInterpolationDelimiter start="#{" end="}" contains=@hamlRubyTop containedin=javascriptStringS,javascriptStringD
+syn match  hamlInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)"
+syn region hamlErbInterpolation matchgroup=hamlInterpolationDelimiter start="<%[=-]\=" end="-\=%>" contained contains=@hamlRubyTop
+
+syn region  hamlAttributeString start=+\%(=\s*\)\@<='+ skip=+\%(\\\\\)*\\'+ end=+'+ contains=hamlInterpolation,hamlInterpolationEscape
+syn region  hamlAttributeString start=+\%(=\s*\)\@<="+ skip=+\%(\\\\\)*\\"+ end=+"+ contains=hamlInterpolation,hamlInterpolationEscape
+syn match   hamlAttributeVariable "\%(=\s*\)\@<=\%(@@\=\|\$\)\=\w\+" contained
+
+syn match   hamlHelper  "\<action_view?\|\<block_is_haml?\|\<is_haml?\|\.\@<!\<flatten" contained containedin=@hamlEmbeddedRuby,@hamlRubyTop
+syn keyword hamlHelper   capture_haml escape_once find_and_preserve haml_concat haml_indent haml_tag html_attrs html_esape init_haml_helpers list_of non_haml precede preserve succeed surround tab_down tab_up page_class contained containedin=@hamlEmbeddedRuby,@hamlRubyTop
+
+syn cluster hamlHtmlTop contains=@htmlTop,htmlBold,htmlItalic,htmlUnderline
+syn region  hamlPlainFilter      matchgroup=hamlFilter start="^\z(\s*\):\%(plain\|preserve\|redcloth\|textile\|markdown\|maruku\)\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlHtmlTop,hamlInterpolation
+syn region  hamlEscapedFilter    matchgroup=hamlFilter start="^\z(\s*\):\%(escaped\|cdata\)\s*$"    end="^\%(\z1 \| *$\)\@!" contains=hamlInterpolation
+syn region  hamlErbFilter        matchgroup=hamlFilter start="^\z(\s*\):erb\s*$"        end="^\%(\z1 \| *$\)\@!" contains=@hamlHtmlTop,hamlErbInterpolation
+syn region  hamlRubyFilter       matchgroup=hamlFilter start="^\z(\s*\):ruby\s*$"       end="^\%(\z1 \| *$\)\@!" contains=@hamlRubyTop
+syn region  hamlJavascriptFilter matchgroup=hamlFilter start="^\z(\s*\):javascript\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlJavaScript,hamlInterpolation keepend
+syn region  hamlCSSFilter        matchgroup=hamlFilter start="^\z(\s*\):css\s*$"        end="^\%(\z1 \| *$\)\@!" contains=@htmlCss,hamlInterpolation keepend
+syn region  hamlSassFilter       matchgroup=hamlFilter start="^\z(\s*\):sass\s*$"       end="^\%(\z1 \| *$\)\@!" contains=@hamlSassTop
+
+syn region  hamlJavascriptBlock start="^\z(\s*\)%script" nextgroup=@hamlComponent,hamlError end="^\%(\z1 \| *$\)\@!" contains=@hamlTop,@htmlJavaScript keepend
+syn region  hamlCssBlock        start="^\z(\s*\)%style" nextgroup=@hamlComponent,hamlError  end="^\%(\z1 \| *$\)\@!" contains=@hamlTop,@htmlCss keepend
+syn match   hamlError "\$" contained
+
+syn region  hamlComment     start="^\z(\s*\)-#" end="^\%(\z1 \| *$\)\@!" contains=rubyTodo
+syn region  hamlHtmlComment start="^\z(\s*\)/"  end="^\%(\z1 \| *$\)\@!" contains=@hamlTop,rubyTodo
+syn match   hamlIEConditional "\%(^\s*/\)\@<=\[if\>[^]]*]" contained containedin=hamlHtmlComment
+
+hi def link hamlSelfCloser             Special
+hi def link hamlDespacer               Special
+hi def link hamlClassChar              Special
+hi def link hamlIdChar                 Special
+hi def link hamlTag                    Special
+hi def link hamlClass                  Type
+hi def link hamlId                     Identifier
+hi def link hamlPlainChar              Special
+hi def link hamlInterpolatableChar     hamlRubyChar
+hi def link hamlRubyOutputChar         hamlRubyChar
+hi def link hamlRubyChar               Special
+hi def link hamlInterpolationDelimiter Delimiter
+hi def link hamlInterpolationEscape    Special
+hi def link hamlAttributeString        String
+hi def link hamlAttributeVariable      Identifier
+hi def link hamlDocType                PreProc
+hi def link hamlFilter                 PreProc
+hi def link hamlAttributesDelimiter    Delimiter
+hi def link hamlObjectDelimiter        Delimiter
+hi def link hamlHelper                 Function
+hi def link hamlHtmlComment            hamlComment
+hi def link hamlComment                Comment
+hi def link hamlIEConditional          SpecialComment
+hi def link hamlError                  Error
+
+let b:current_syntax = "haml"
+
+if main_syntax == "haml"
+  unlet main_syntax
+endif
+
+" vim:set sw=2:

.vim/syntax/javascript.vim

+" Vim syntax file
+" Language:     JavaScript
+" Maintainer:   Yi Zhao (ZHAOYI) <zzlinux AT hotmail DOT com>
+" Last Change:  June 4, 2009
+" Version:      0.7.7
+" Changes:      Add "undefined" as a type keyword
+"
+" TODO:
+"  - Add the HTML syntax inside the JSDoc
+
+if !exists("main_syntax")
+  if version < 600
+    syntax clear
+  elseif exists("b:current_syntax")
+    finish
+  endif
+  let main_syntax = 'javascript'
+endif
+
+"" Drop fold if it set but VIM doesn't support it.
+let b:javascript_fold='true'
+if version < 600    " Don't support the old version
+  unlet! b:javascript_fold
+endif
+
+"" dollar sigh is permittd anywhere in an identifier
+setlocal iskeyword+=$
+
+syntax sync fromstart
+
+"" JavaScript comments
+syntax keyword javaScriptCommentTodo    TODO FIXME XXX TBD contained
+syntax region  javaScriptLineComment    start=+\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell
+syntax region  javaScriptLineComment    start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell fold
+syntax region  javaScriptCvsTag         start="\$\cid:" end="\$" oneline contained
+syntax region  javaScriptComment        start="/\*"  end="\*/" contains=javaScriptCommentTodo,javaScriptCvsTag,@Spell fold
+
+"" JSDoc support start
+if !exists("javascript_ignore_javaScriptdoc")
+  syntax case ignore
+
+  "" syntax coloring for javadoc comments (HTML)
+  "syntax include @javaHtml <sfile>:p:h/html.vim
+  "unlet b:current_syntax
+
+  syntax region javaScriptDocComment    matchgroup=javaScriptComment start="/\*\*\s*$"  end="\*/" contains=javaScriptDocTags,javaScriptCommentTodo,javaScriptCvsTag,@javaScriptHtml,@Spell fold
+  syntax match  javaScriptDocTags       contained "@\(param\|argument\|requires\|exception\|throws\|type\|class\|extends\|see\|link\|member\|module\|method\|title\|namespace\|optional\|default\|base\|file\)\>" nextgroup=javaScriptDocParam,javaScriptDocSeeTag skipwhite
+  syntax match  javaScriptDocTags       contained "@\(beta\|deprecated\|description\|fileoverview\|author\|license\|version\|returns\=\|constructor\|private\|protected\|final\|ignore\|addon\|exec\)\>"
+  syntax match  javaScriptDocParam      contained "\%(#\|\w\|\.\|:\|\/\)\+"
+  syntax region javaScriptDocSeeTag     contained matchgroup=javaScriptDocSeeTag start="{" end="}" contains=javaScriptDocTags
+
+  syntax case match
+endif   "" JSDoc end
+
+syntax case match
+
+"" Syntax in the JavaScript code
+syntax match   javaScriptSpecial        "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\."
+syntax region  javaScriptStringD        start=+"+  skip=+\\\\\|\\$"+  end=+"+  contains=javaScriptSpecial,@htmlPreproc
+syntax region  javaScriptStringS        start=+'+  skip=+\\\\\|\\$'+  end=+'+  contains=javaScriptSpecial,@htmlPreproc
+syntax region  javaScriptRegexpString   start=+/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gim]\{,3}+ contains=javaScriptSpecial,@htmlPreproc oneline
+syntax match   javaScriptNumber         /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
+syntax match   javaScriptFloat          /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
+syntax match   javaScriptLabel          /\(?\s*\)\@<!\<\w\+\(\s*:\)\@=/
+
+"" JavaScript Prototype
+syntax keyword javaScriptPrototype      prototype
+
+"" Programm Keywords
+syntax keyword javaScriptSource         import export
+syntax keyword javaScriptType           const this undefined var void yield 
+syntax keyword javaScriptOperator       delete new in instanceof let typeof
+syntax keyword javaScriptBoolean        true false
+syntax keyword javaScriptNull           null
+
+"" Statement Keywords
+syntax keyword javaScriptConditional    if else
+syntax keyword javaScriptRepeat         do while for
+syntax keyword javaScriptBranch         break continue switch case default return
+syntax keyword javaScriptStatement      try catch throw with finally
+
+syntax keyword javaScriptGlobalObjects  Array Boolean Date Function Infinity JavaArray JavaClass JavaObject JavaPackage Math Number NaN Object Packages RegExp String Undefined java netscape sun
+
+syntax keyword javaScriptExceptions     Error EvalError RangeError ReferenceError SyntaxError TypeError URIError
+
+syntax keyword javaScriptFutureKeys     abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public
+
+"" DOM/HTML/CSS specified things
+
+  " DOM2 Objects
+  syntax keyword javaScriptGlobalObjects  DOMImplementation DocumentFragment Document Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction
+  syntax keyword javaScriptExceptions     DOMException
+
+  " DOM2 CONSTANT
+  syntax keyword javaScriptDomErrNo       INDEX_SIZE_ERR DOMSTRING_SIZE_ERR HIERARCHY_REQUEST_ERR WRONG_DOCUMENT_ERR INVALID_CHARACTER_ERR NO_DATA_ALLOWED_ERR NO_MODIFICATION_ALLOWED_ERR NOT_FOUND_ERR NOT_SUPPORTED_ERR INUSE_ATTRIBUTE_ERR INVALID_STATE_ERR SYNTAX_ERR INVALID_MODIFICATION_ERR NAMESPACE_ERR INVALID_ACCESS_ERR
+  syntax keyword javaScriptDomNodeConsts  ELEMENT_NODE ATTRIBUTE_NODE TEXT_NODE CDATA_SECTION_NODE ENTITY_REFERENCE_NODE ENTITY_NODE PROCESSING_INSTRUCTION_NODE COMMENT_NODE DOCUMENT_NODE DOCUMENT_TYPE_NODE DOCUMENT_FRAGMENT_NODE NOTATION_NODE
+
+  " HTML events and internal variables
+  syntax case ignore
+  syntax keyword javaScriptHtmlEvents     onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize
+  syntax case match
+
+" Follow stuff should be highligh within a special context
+" While it can't be handled with context depended with Regex based highlight
+" So, turn it off by default
+if exists("javascript_enable_domhtmlcss")
+
+    " DOM2 things
+    syntax match javaScriptDomElemAttrs     contained /\%(nodeName\|nodeValue\|nodeType\|parentNode\|childNodes\|firstChild\|lastChild\|previousSibling\|nextSibling\|attributes\|ownerDocument\|namespaceURI\|prefix\|localName\|tagName\)\>/
+    syntax match javaScriptDomElemFuncs     contained /\%(insertBefore\|replaceChild\|removeChild\|appendChild\|hasChildNodes\|cloneNode\|normalize\|isSupported\|hasAttributes\|getAttribute\|setAttribute\|removeAttribute\|getAttributeNode\|setAttributeNode\|removeAttributeNode\|getElementsByTagName\|getAttributeNS\|setAttributeNS\|removeAttributeNS\|getAttributeNodeNS\|setAttributeNodeNS\|getElementsByTagNameNS\|hasAttribute\|hasAttributeNS\)\>/ nextgroup=javaScriptParen skipwhite
+    " HTML things
+    syntax match javaScriptHtmlElemAttrs    contained /\%(className\|clientHeight\|clientLeft\|clientTop\|clientWidth\|dir\|id\|innerHTML\|lang\|length\|offsetHeight\|offsetLeft\|offsetParent\|offsetTop\|offsetWidth\|scrollHeight\|scrollLeft\|scrollTop\|scrollWidth\|style\|tabIndex\|title\)\>/
+    syntax match javaScriptHtmlElemFuncs    contained /\%(blur\|click\|focus\|scrollIntoView\|addEventListener\|dispatchEvent\|removeEventListener\|item\)\>/ nextgroup=javaScriptParen skipwhite
+
+    " CSS Styles in JavaScript
+    syntax keyword javaScriptCssStyles      contained color font fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight letterSpacing lineBreak lineHeight quotes rubyAlign rubyOverhang rubyPosition
+    syntax keyword javaScriptCssStyles      contained textAlign textAlignLast textAutospace textDecoration textIndent textJustify textJustifyTrim textKashidaSpace textOverflowW6 textShadow textTransform textUnderlinePosition
+    syntax keyword javaScriptCssStyles      contained unicodeBidi whiteSpace wordBreak wordSpacing wordWrap writingMode
+    syntax keyword javaScriptCssStyles      contained bottom height left position right top width zIndex
+    syntax keyword javaScriptCssStyles      contained border borderBottom borderLeft borderRight borderTop borderBottomColor borderLeftColor borderTopColor borderBottomStyle borderLeftStyle borderRightStyle borderTopStyle borderBottomWidth borderLeftWidth borderRightWidth borderTopWidth borderColor borderStyle borderWidth borderCollapse borderSpacing captionSide emptyCells tableLayout
+    syntax keyword javaScriptCssStyles      contained margin marginBottom marginLeft marginRight marginTop outline outlineColor outlineStyle outlineWidth padding paddingBottom paddingLeft paddingRight paddingTop
+    syntax keyword javaScriptCssStyles      contained listStyle listStyleImage listStylePosition listStyleType
+    syntax keyword javaScriptCssStyles      contained background backgroundAttachment backgroundColor backgroundImage gackgroundPosition backgroundPositionX backgroundPositionY backgroundRepeat
+    syntax keyword javaScriptCssStyles      contained clear clip clipBottom clipLeft clipRight clipTop content counterIncrement counterReset cssFloat cursor direction display filter layoutGrid layoutGridChar layoutGridLine layoutGridMode layoutGridType
+    syntax keyword javaScriptCssStyles      contained marks maxHeight maxWidth minHeight minWidth opacity MozOpacity overflow overflowX overflowY verticalAlign visibility zoom cssText
+    syntax keyword javaScriptCssStyles      contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor
+
+    " Highlight ways
+    syntax match javaScriptDotNotation      "\." nextgroup=javaScriptPrototype,javaScriptDomElemAttrs,javaScriptDomElemFuncs,javaScriptHtmlElemAttrs,javaScriptHtmlElemFuncs
+    syntax match javaScriptDotNotation      "\.style\." nextgroup=javaScriptCssStyles
+
+endif "DOM/HTML/CSS
+
+"" end DOM/HTML/CSS specified things
+
+
+"" Code blocks
+syntax cluster javaScriptAll       contains=javaScriptComment,javaScriptLineComment,javaScriptDocComment,javaScriptStringD,javaScriptStringS,javaScriptRegexpString,javaScriptNumber,javaScriptFloat,javaScriptLabel,javaScriptSource,javaScriptType,javaScriptOperator,javaScriptBoolean,javaScriptNull,javaScriptFunction,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptStatement,javaScriptGlobalObjects,javaScriptExceptions,javaScriptFutureKeys,javaScriptDomErrNo,javaScriptDomNodeConsts,javaScriptHtmlEvents,javaScriptDotNotation
+syntax region  javaScriptBracket   matchgroup=javaScriptBracket transparent start="\[" end="\]" contains=@javaScriptAll,javaScriptParensErrB,javaScriptParensErrC,javaScriptBracket,javaScriptParen,javaScriptBlock,@htmlPreproc
+syntax region  javaScriptParen     matchgroup=javaScriptParen   transparent start="("  end=")"  contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrC,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc
+syntax region  javaScriptBlock     matchgroup=javaScriptBlock   transparent start="{"  end="}"  contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc 
+
+"" catch errors caused by wrong parenthesis
+syntax match   javaScriptParensError    ")\|}\|\]"
+syntax match   javaScriptParensErrA     contained "\]"
+syntax match   javaScriptParensErrB     contained ")"
+syntax match   javaScriptParensErrC     contained "}"
+
+if main_syntax == "javascript"
+  syntax sync clear
+  syntax sync ccomment javaScriptComment minlines=200
+  syntax sync match javaScriptHighlight grouphere javaScriptBlock /{/
+endif
+
+"" Fold control
+if exists("b:javascript_fold")
+    syntax match   javaScriptFunction       /\<function\>/ nextgroup=javaScriptFuncName skipwhite
+    syntax match   javaScriptOpAssign       /=\@<!=/ nextgroup=javaScriptFuncBlock skipwhite skipempty
+    syntax region  javaScriptFuncName       contained matchgroup=javaScriptFuncName start=/\%(\$\|\w\)*\s*(/ end=/)/ contains=javaScriptLineComment,javaScriptComment nextgroup=javaScriptFuncBlock skipwhite skipempty
+    syntax region  javaScriptFuncBlock      contained matchgroup=javaScriptFuncBlock start="{" end="}" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock fold
+
+    if &l:filetype=='javascript' && !&diff
+      " Fold setting
+      " Redefine the foldtext (to show a JS function outline) and foldlevel
+      " only if the entire buffer is JavaScript, but not if JavaScript syntax
+      " is embedded in another syntax (e.g. HTML).
+      setlocal foldmethod=syntax
+      setlocal foldlevel=4
+    endif
+else
+    syntax keyword javaScriptFunction       function
+    setlocal foldmethod<
+    setlocal foldlevel<
+endif
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_javascript_syn_inits")
+  if version < 508
+    let did_javascript_syn_inits = 1
+    command -nargs=+ HiLink hi link <args>
+  else
+    command -nargs=+ HiLink hi def link <args>
+  endif
+  HiLink javaScriptComment              Comment
+  HiLink javaScriptLineComment          Comment
+  HiLink javaScriptDocComment           Comment
+  HiLink javaScriptCommentTodo          Todo
+  HiLink javaScriptCvsTag               Function
+  HiLink javaScriptDocTags              Special
+  HiLink javaScriptDocSeeTag            Function
+  HiLink javaScriptDocParam             Function
+  HiLink javaScriptStringS              String
+  HiLink javaScriptStringD              String
+  HiLink javaScriptRegexpString         String
+  HiLink javaScriptCharacter            Character
+  HiLink javaScriptPrototype            Type
+  HiLink javaScriptConditional          Conditional
+  HiLink javaScriptBranch               Conditional
+  HiLink javaScriptRepeat               Repeat
+  HiLink javaScriptStatement            Statement
+  HiLink javaScriptFunction             Function
+  HiLink javaScriptError                Error
+  HiLink javaScriptParensError          Error
+  HiLink javaScriptParensErrA           Error
+  HiLink javaScriptParensErrB           Error
+  HiLink javaScriptParensErrC           Error
+  HiLink javaScriptOperator             Operator
+  HiLink javaScriptType                 Type
+  HiLink javaScriptNull                 Type
+  HiLink javaScriptNumber               Number
+  HiLink javaScriptFloat                Number
+  HiLink javaScriptBoolean              Boolean
+  HiLink javaScriptLabel                Label
+  HiLink javaScriptSpecial              Special
+  HiLink javaScriptSource               Special
+  HiLink javaScriptGlobalObjects        Special
+  HiLink javaScriptExceptions           Special
+
+  HiLink javaScriptDomErrNo             Constant
+  HiLink javaScriptDomNodeConsts        Constant
+  HiLink javaScriptDomElemAttrs         Label
+  HiLink javaScriptDomElemFuncs         PreProc
+
+  HiLink javaScriptHtmlEvents           Special
+  HiLink javaScriptHtmlElemAttrs        Label
+  HiLink javaScriptHtmlElemFuncs        PreProc
+
+  HiLink javaScriptCssStyles            Label
+
+  delcommand HiLink
+endif
+
+" Define the htmlJavaScript for HTML syntax html.vim
+"syntax clear htmlJavaScript
+"syntax clear javaScriptExpression
+syntax cluster  htmlJavaScript contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError
+syntax cluster  javaScriptExpression contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError,@htmlPreproc
+
+let b:current_syntax = "javascript"
+if main_syntax == 'javascript'
+  unlet main_syntax
+endif
+
+" vim: ts=4

.vim/syntax/sass.vim

+" Vim syntax file
+" Language:	Sass
+" Maintainer:	Tim Pope <vimNOSPAM@tpope.org>
+" Filenames:	*.sass
+" Last Change:	2010 Aug 09
+
+if exists("b:current_syntax")
+  finish
+endif
+
+runtime! syntax/css.vim
+
+syn case ignore
+
+syn cluster sassCssProperties contains=cssFontProp,cssFontDescriptorProp,cssColorProp,cssTextProp,cssBoxProp,cssGeneratedContentProp,cssPagingProp,cssUIProp,cssRenderProp,cssAuralProp,cssTableProp
+syn cluster sassCssAttributes contains=css.*Attr,scssComment,cssValue.*,cssColor,cssURL,sassDefault,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp
+
+syn region sassDefinition matchgroup=cssBraces start="{" end="}" contains=TOP
+
+syn match sassProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+:" contains=css.*Prop skipwhite nextgroup=sassCssAttribute contained containedin=sassDefinition
+syn match sassProperty "^\s*\zs\s\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute
+syn match sassProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute
+syn match sassCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|#{[^{}]*}\|[^{};]\)*+ contained contains=@sassCssAttributes,sassVariable,sassFunction,sassInterpolation
+syn match sassDefault "!default\>" contained
+syn match sassVariable "!\%(important\>\|default\>\)\@![[:alnum:]_-]\+"
+syn match sassVariable "$[[:alnum:]_-]\+"
+syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=\%(||\)\==" nextgroup=sassCssAttribute skipwhite
+syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=:" nextgroup=sassCssAttribute skipwhite
+
+syn match sassFunction "\<\%(rgb\|rgba\|red\|green\|blue\|mix\)\>(\@=" contained
+syn match sassFunction "\<\%(hsl\|hsla\|hue\|saturation\|lightness\|adjust-hue\|lighten\|darken\|saturate\|desaturate\|grayscale\|complement\)\>(\@=" contained
+syn match sassFunction "\<\%(alpha\|opacity\|rgba\|opacify\|fade-in\|transparentize\|fade-out\)\>(\@=" contained
+syn match sassFunction "\<\%(unquote\|quote\)\>(\@=" contained
+syn match sassFunction "\<\%(percentage\|round\|ceil\|floor\|abs\)\>(\@=" contained
+syn match sassFunction "\<\%(type-of\|unit\|unitless\|comparable\)\>(\@=" contained
+
+syn region sassInterpolation matchgroup=sassInterpolationDelimiter start="#{" end="}" contains=@sassCssAttributes,sassVariable,sassFunction containedin=cssStringQ,cssStringQQ,sassProperty
+
+syn match sassMixinName "[[:alnum:]_-]\+" contained nextgroup=sassCssAttribute
+syn match sassMixin  "^="               nextgroup=sassMixinName
+syn match sassMixin  "\%([{};]\s*\|^\s*\)\@<=@mixin"   nextgroup=sassMixinName skipwhite
+syn match sassMixing "^\s\+\zs+"        nextgroup=sassMixinName
+syn match sassMixing "\%([{};]\s*\|^\s*\)\@<=@include" nextgroup=sassMixinName skipwhite
+syn match sassExtend "\%([{};]\s*\|^\s*\)\@<=@extend"
+
+syn match sassEscape     "^\s*\zs\\"
+syn match sassIdChar     "#[[:alnum:]_-]\@=" nextgroup=sassId
+syn match sassId         "[[:alnum:]_-]\+" contained
+syn match sassClassChar  "\.[[:alnum:]_-]\@=" nextgroup=sassClass
+syn match sassClass      "[[:alnum:]_-]\+" contained
+syn match sassAmpersand  "&"
+
+" TODO: Attribute namespaces
+" TODO: Arithmetic (including strings and concatenation)
+
+syn region sassInclude start="@import" end=";\|$" contains=scssComment,cssURL,cssUnicodeEscape,cssMediaType
+syn region sassDebugLine end=";\|$" matchgroup=sassDebug start="@debug\>" contains=@sassCssAttributes,sassVariable,sassFunction
+syn region sassWarnLine end=";\|$" matchgroup=sassWarn start="@warn\>" contains=@sassCssAttributes,sassVariable,sassFunction
+syn region sassControlLine matchgroup=sassControl start="@\%(if\|else\%(\s\+if\)\=\|while\|for\)\>" end="[{};]\@=\|$" contains=sassFor,@sassCssAttributes,sassVariable,sassFunction
+syn keyword sassFor from to through contained
+
+syn keyword sassTodo        FIXME NOTE TODO OPTIMIZE XXX contained
+syn region  sassComment     start="^\z(\s*\)//"  end="^\%(\z1 \)\@!" contains=sassTodo,@Spell
+syn region  sassCssComment  start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=sassTodo,@Spell
+
+hi def link sassCssComment              sassComment
+hi def link sassComment                 Comment
+hi def link sassDefault                 cssImportant
+hi def link sassVariable                Identifier
+hi def link sassFunction                Function
+hi def link sassMixing                  PreProc
+hi def link sassMixin                   PreProc
+hi def link sassExtend                  PreProc
+hi def link sassTodo                    Todo
+hi def link sassInclude                 Include
+hi def link sassDebug                   sassControl
+hi def link sassWarn                    sassControl
+hi def link sassControl                 PreProc
+hi def link sassFor                     PreProc
+hi def link sassEscape                  Special
+hi def link sassIdChar                  Special
+hi def link sassClassChar               Special
+hi def link sassInterpolationDelimiter  Delimiter
+hi def link sassAmpersand               Character
+hi def link sassId                      Identifier
+hi def link sassClass                   Type
+
+let b:current_syntax = "sass"
+
+" vim:set sw=2:

.vim/syntax/scss.vim

+" Vim syntax file
+" Language:	SCSS
+" Maintainer:	Tim Pope <vimNOSPAM@tpope.org>
+" Filenames:	*.scss
+" Last Change:	2010 Jul 26
+
+if exists("b:current_syntax")
+  finish
+endif
+
+runtime! syntax/sass.vim
+
+syn match scssComment "//.*" contains=sassTodo,@Spell
+syn region scssComment start="/\*" end="\*/" contains=sassTodo,@Spell
+
+hi def link scssComment sassComment
+
+let b:current_syntax = "scss"
+
+" vim:set sw=2:
   "clear old autocmds in group
   autocmd!
   "for ruby, autoindent with two spaces, always expand tabs
-  autocmd FileType ruby,haml,eruby,yaml set ai sw=2 sts=2 et
+  autocmd FileType ruby,haml,eruby,yaml,html,javascript,sass set ai sw=2 sts=2 et
   autocmd FileType python set sw=4 sts=4 et
 augroup END
 
 
 autocmd BufRead,BufNewFile *.html source ~/.vim/indent/html_grb.vim
 autocmd FileType htmldjango source ~/.vim/indent/html_grb.vim
+autocmd! BufRead,BufNewFile *.sass setfiletype sass 
 
 " Map ,e to open files in the same directory as the current file
 map <leader>e :e <C-R>=expand("%:h")<cr>/
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.