Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: over/janus
base: 227cc17157
...
head fork: over/janus
compare: 1a65278add
  • 4 commits
  • 8 files changed
  • 0 commit comments
  • 1 contributor
View
1  backup/.gitignore
@@ -1 +0,0 @@
-*
View
2  ftdetect/jst.vim
@@ -0,0 +1,2 @@
+au BufNewFile,BufRead *.ejs set filetype=jst
+au BufNewFile,BufRead *.jst set filetype=jst
View
75 indent/jst.vim
@@ -0,0 +1,75 @@
+if exists("b:did_indent")
+ finish
+endif
+
+runtime! indent/javascript.vim
+unlet! b:did_indent
+setlocal indentexpr=
+
+if exists("b:jst_subtype")
+ exe "runtime! indent/".b:jst_subtype.".vim"
+else
+ runtime! indent/html.vim
+endif
+unlet! b:did_indent
+
+if &l:indentexpr == ''
+ if &l:cindent
+ let &l:indentexpr = 'cindent(v:lnum)'
+ else
+ let &l:indentexpr = 'indent(prevnonblank(v:lnum-1))'
+ endif
+endif
+let b:jst_subtype_indentexpr = &l:indentexpr
+
+let b:did_indent = 1
+
+setlocal indentexpr=GetJstIndent()
+setlocal indentkeys=o,O,*<Return>,<>>,{,},0),0],o,O,!^F,=end,=else,=elsif,=rescue,=ensure,=when
+
+" Only define the function once.
+if exists("*GetJstIndent")
+ finish
+endif
+
+function! GetJstIndent(...)
+ if a:0 && a:1 == '.'
+ let v:lnum = line('.')
+ elseif a:0 && a:1 =~ '^\d'
+ let v:lnum = a:1
+ endif
+ let vcol = col('.')
+ call cursor(v:lnum,1)
+ let injavascript = searchpair('<%','','%>','W')
+ call cursor(v:lnum,vcol)
+ if injavascript && getline(v:lnum) !~ '^<%\|^\s*[-=]\=%>'
+ let ind = GetJavascriptIndent()
+ else
+ exe "let ind = ".b:jst_subtype_indentexpr
+ endif
+ let lnum = prevnonblank(v:lnum-1)
+ let line = getline(lnum)
+ let cline = getline(v:lnum)
+ if cline =~# '^\s*<%[-=]\=\s*\%(}.\{-\}\)\s*\%([-=]\=%>\|$\)'
+ let ind = ind - &sw
+ endif
+ if line =~# '\S\s*<%[-=]\=\s*\%(}\).\{-\}\s*\%([-=]\=%>\|$\)'
+ let ind = ind - &sw
+ endif
+ if line =~# '\%({\|\<do\)\%(\s*|[^|]*|\)\=\s*[-=]\=%>'
+ let ind = ind + &sw
+ endif
+ if line =~# '^\s*<%[=#-]\=\s*$' && cline !~# '^\s*end\>'
+ let ind = ind + &sw
+ endif
+ if line !~# '^\s*<%' && line =~# '%>\s*$'
+ let ind = ind - &sw
+ endif
+ if cline =~# '^\s*[-=]\=%>\s*$'
+ let ind = ind - &sw
+ endif
+ return ind
+endfunction
+
+" vim:set sw=2 sts=2 ts=8 noet:
+
View
99 plugin/supertab.vim
@@ -2,7 +2,7 @@
" Original: Gergely Kontra <kgergely@mcl.hu>
" Current: Eric Van Dewoestine <ervandew@gmail.com> (as of version 0.4)
" Please direct all correspondence to Eric.
-" Version: 1.2
+" Version: 1.4
" GetLatestVimScripts: 1643 1 :AutoInstall: supertab.vim
"
" Description: {{{
@@ -14,7 +14,7 @@
" }}}
"
" License: {{{
-" Copyright (c) 2002 - 2010
+" Copyright (c) 2002 - 2011
" All rights reserved.
"
" Redistribution and use of this software in source and binary forms, with
@@ -82,12 +82,22 @@ set cpo&vim
let g:SuperTabRetainCompletionDuration = 'insert'
endif
- if !exists("g:SuperTabMidWordCompletion")
- let g:SuperTabMidWordCompletion = 1
+ if !exists("g:SuperTabNoCompleteBefore")
+ " retain backwards compatability
+ if exists("g:SuperTabMidWordCompletion") && !g:SuperTabMidWordCompletion
+ let g:SuperTabNoCompleteBefore = ['\k']
+ else
+ let g:SuperTabNoCompleteBefore = []
+ endif
endif
- if !exists("g:SuperTabLeadingSpaceCompletion")
- let g:SuperTabLeadingSpaceCompletion = 0
+ if !exists("g:SuperTabNoCompleteAfter")
+ " retain backwards compatability
+ if exists("g:SuperTabLeadingSpaceCompletion") && g:SuperTabLeadingSpaceCompletion
+ let g:SuperTabNoCompleteAfter = []
+ else
+ let g:SuperTabNoCompleteAfter = ['\s']
+ endif
endif
if !exists("g:SuperTabMappingForward")
@@ -172,6 +182,7 @@ endfunction " }}}
" restore SuperTab default:
" nmap <F6> :call SetSuperTabCompletionType("<c-p>")<cr>
function! SuperTabSetCompletionType(type)
+ call s:InitBuffer()
exec "let b:complType = \"" . escape(a:type, '<') . "\""
endfunction " }}}
@@ -204,18 +215,6 @@ endfunction " }}}
" s:Init {{{
" Global initilization when supertab is loaded.
function! s:Init()
- augroup supertab_init
- autocmd!
- autocmd BufEnter * call <SID>InitBuffer()
- augroup END
-
- " ensure InitBuffer gets called for the first buffer, after the ftplugins
- " have been called.
- augroup supertab_init_first
- autocmd!
- autocmd FileType <buffer> call <SID>InitBuffer()
- augroup END
-
" Setup mechanism to restore original completion type upon leaving insert
" mode if configured to do so
if g:SuperTabRetainCompletionDuration == 'insert'
@@ -229,7 +228,7 @@ endfunction " }}}
" s:InitBuffer {{{
" Per buffer initilization.
function! s:InitBuffer()
- if exists('b:complType')
+ if exists('b:SuperTabNoCompleteBefore')
return
endif
@@ -240,6 +239,13 @@ function! s:InitBuffer()
" init hack for <c-x><c-v> workaround.
let b:complCommandLine = 0
+ if !exists('b:SuperTabNoCompleteBefore')
+ let b:SuperTabNoCompleteBefore = g:SuperTabNoCompleteBefore
+ endif
+ if !exists('b:SuperTabNoCompleteAfter')
+ let b:SuperTabNoCompleteAfter = g:SuperTabNoCompleteAfter
+ endif
+
let b:SuperTabDefaultCompletionType = g:SuperTabDefaultCompletionType
" set the current completion type to the default
@@ -309,11 +315,9 @@ endfunction " }}}
" previous entry in a completion list, and determines whether or not to simply
" retain the normal usage of <tab> based on the cursor position.
function! s:SuperTab(command)
- if s:WillComplete()
- " rare case where no autocmds have fired for this buffer to initialize the
- " supertab vars.
- call s:InitBuffer()
+ call s:InitBuffer()
+ if s:WillComplete()
" optionally enable enhanced longest completion
if g:SuperTabLongestEnhanced && &completeopt =~ 'longest'
call s:EnableLongestEnhancement()
@@ -422,6 +426,10 @@ endfunction " }}}
" s:WillComplete() {{{
" Determines if completion should be kicked off at the current location.
function! s:WillComplete()
+ if pumvisible()
+ return 1
+ endif
+
let line = getline('.')
let cnum = col('.')
@@ -430,24 +438,22 @@ function! s:WillComplete()
return 0
endif
- " Leading space.
- if !g:SuperTabLeadingSpaceCompletion
- let prev_char = strpart(line, cnum - 2, 1)
- if prev_char =~ '^\s*$'
+ " honor SuperTabNoCompleteAfter
+ let pre = line[:cnum - 2]
+ for pattern in b:SuperTabNoCompleteAfter
+ if pre =~ pattern . '$'
return 0
endif
- endif
+ endfor
+ " honor SuperTabNoCompleteBefore
" Within a word, but user does not have mid word completion enabled.
- let next_char = strpart(line, cnum - 1, 1)
- if !g:SuperTabMidWordCompletion && next_char =~ '\k'
- return 0
- endif
-
- " In keyword completion mode and no preceding word characters.
- "if (b:complType == "\<c-n>" || b:complType == "\<c-p>") && prev_char !~ '\k'
- " return 0
- "endif
+ let post = line[cnum - 1:]
+ for pattern in b:SuperTabNoCompleteBefore
+ if post =~ '^' . pattern
+ return 0
+ endif
+ endfor
return 1
endfunction " }}}
@@ -626,14 +632,29 @@ endfunction " }}}
if g:SuperTabCrMapping
if maparg('<CR>','i') =~ '<CR>'
- exec "inoremap <script> <cr> " . maparg('<cr>', 'i') . "<c-r>=<SID>SelectCompletion(0)<cr>"
+ let map = maparg('<cr>', 'i')
+ let cr = (map =~? '\(^\|[^)]\)<cr>')
+ if map =~ '<Plug>'
+ let plug = substitute(map, '.\{-}\(<Plug>\w\+\).*', '\1', '')
+ let plug_map = maparg(plug, 'i')
+ let map = substitute(map, '.\{-}\(<Plug>\w\+\).*', plug_map, '')
+ endif
+ exec "inoremap <script> <cr> <c-r>=<SID>SelectCompletion(" . cr . ")<cr>" . map
else
inoremap <cr> <c-r>=<SID>SelectCompletion(1)<cr>
endif
function! s:SelectCompletion(cr)
" selecting a completion
if pumvisible()
- return "\<space>\<bs>"
+ " ugly hack to let other <cr> mappings for other plugins cooperate
+ " with supertab
+ let b:supertab_pumwasvisible = 1
+ return "\<c-y>"
+ endif
+
+ if exists('b:supertab_pumwasvisible')
+ unlet b:supertab_pumwasvisible
+ return ''
endif
" not so pleasant hack to keep <cr> working for abbreviations
View
17 syntax/ejs.vim
@@ -0,0 +1,17 @@
+if exists("b:current_syntax")
+ finish
+endif
+
+if !exists("main_syntax")
+ let main_syntax = 'ejs'
+endif
+
+runtime! syntax/html.vim
+syn include @jsTop syntax/javascript.vim
+
+exe 'syn region ejsInjection matchgroup=PreProc start="<%=" end="%>" contains=@jsTop'
+exe 'syn region ejsInjection matchgroup=PreProc start="<%" end="%>" contains=@jsTop'
+
+
+
+
View
293 syntax/html.vim
@@ -0,0 +1,293 @@
+" Vim syntax file
+" Language: HTML
+" Maintainer: Claudio Fleiner <claudio@fleiner.com>
+" URL: http://www.fleiner.com/vim/syntax/html.vim
+" Last Change: 2006 Jun 19
+
+" Please check :help html.vim for some comments and a description of the options
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if !exists("main_syntax")
+ if version < 600
+ syntax clear
+ elseif exists("b:current_syntax")
+ finish
+ endif
+ let main_syntax = 'html'
+endif
+
+" don't use standard HiLink, it will not work with included syntax files
+if version < 508
+ command! -nargs=+ HtmlHiLink hi link <args>
+else
+ command! -nargs=+ HtmlHiLink hi def link <args>
+endif
+
+syntax spell toplevel
+
+syn case ignore
+
+" mark illegal characters
+syn match htmlError "[<>&]"
+
+
+" tags
+syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
+syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
+syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=javaScriptExpression,@htmlPreproc
+syn region htmlEndTag start=+</+ end=+>+ contains=htmlTagN,htmlTagError
+syn region htmlTag start=+<[^/]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster
+syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
+syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
+syn match htmlTagError contained "[^>]<"ms=s+1
+
+
+" tag names
+syn keyword htmlTagName contained address applet area a base basefont
+syn keyword htmlTagName contained big blockquote br caption center
+syn keyword htmlTagName contained cite code dd dfn dir div dl dt font
+syn keyword htmlTagName contained form hr html img
+syn keyword htmlTagName contained input isindex kbd li link map menu
+syn keyword htmlTagName contained meta ol option param pre p samp span
+syn keyword htmlTagName contained select small strike sub sup
+syn keyword htmlTagName contained table td textarea th tr tt ul var xmp
+syn match htmlTagName contained "\<\(b\|i\|u\|h[1-6]\|em\|strong\|head\|body\|title\)\>"
+
+" new html 4.0 tags
+syn keyword htmlTagName contained abbr acronym bdo button col label
+syn keyword htmlTagName contained colgroup del fieldset iframe ins legend
+syn keyword htmlTagName contained object optgroup q s tbody tfoot thead
+
+" legal arg names
+syn keyword htmlArg contained action
+syn keyword htmlArg contained align alink alt archive background bgcolor
+syn keyword htmlArg contained border bordercolor cellpadding
+syn keyword htmlArg contained cellspacing checked class clear code codebase color
+syn keyword htmlArg contained cols colspan content coords enctype face
+syn keyword htmlArg contained gutter height hspace id
+syn keyword htmlArg contained link lowsrc marginheight
+syn keyword htmlArg contained marginwidth maxlength method name prompt
+syn keyword htmlArg contained rel rev rows rowspan scrolling selected shape
+syn keyword htmlArg contained size src start target text type url
+syn keyword htmlArg contained usemap ismap valign value vlink vspace width wrap
+syn match htmlArg contained "\<\(http-equiv\|href\|title\)="me=e-1
+
+" Netscape extensions
+syn keyword htmlTagName contained frame noframes frameset nobr blink
+syn keyword htmlTagName contained layer ilayer nolayer spacer
+syn keyword htmlArg contained frameborder noresize pagex pagey above below
+syn keyword htmlArg contained left top visibility clip id noshade
+syn match htmlArg contained "\<z-index\>"
+
+" Microsoft extensions
+syn keyword htmlTagName contained marquee
+
+" html 4.0 arg names
+syn match htmlArg contained "\<\(accept-charset\|label\)\>"
+syn keyword htmlArg contained abbr accept accesskey axis char charoff charset
+syn keyword htmlArg contained cite classid codetype compact data datetime
+syn keyword htmlArg contained declare defer dir disabled for frame
+syn keyword htmlArg contained headers hreflang lang language longdesc
+syn keyword htmlArg contained multiple nohref nowrap object profile readonly
+syn keyword htmlArg contained rules scheme scope span standby style
+syn keyword htmlArg contained summary tabindex valuetype version
+
+" special characters
+syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
+
+" Comments (the real ones or the old netscape ones)
+if exists("html_wrong_comments")
+ syn region htmlComment start=+<!--+ end=+--\s*>+
+else
+ syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentPart,htmlCommentError
+ syn match htmlCommentError contained "[^><!]"
+ syn region htmlCommentPart contained start=+--+ end=+--\s*+ contains=@htmlPreProc
+endif
+syn region htmlComment start=+<!DOCTYPE+ keepend end=+>+
+
+" server-parsed commands
+syn region htmlPreProc start=+<!--#+ end=+-->+ contains=htmlPreStmt,htmlPreError,htmlPreAttr
+syn match htmlPreStmt contained "<!--#\(config\|echo\|exec\|fsize\|flastmod\|include\|printenv\|set\|if\|elif\|else\|endif\|geoguide\)\>"
+syn match htmlPreError contained "<!--#\S*"ms=s+4
+syn match htmlPreAttr contained "\w\+=[^"]\S\+" contains=htmlPreProcAttrError,htmlPreProcAttrName
+syn region htmlPreAttr contained start=+\w\+="+ skip=+\\\\\|\\"+ end=+"+ contains=htmlPreProcAttrName keepend
+syn match htmlPreProcAttrError contained "\w\+="he=e-1
+syn match htmlPreProcAttrName contained "\(expr\|errmsg\|sizefmt\|timefmt\|var\|cgi\|cmd\|file\|virtual\|value\)="he=e-1
+
+if !exists("html_no_rendering")
+ " rendering
+ syn cluster htmlTop contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc
+
+ syn region htmlBold start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
+ syn region htmlBold start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
+ syn region htmlBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic
+ syn region htmlBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlBoldItalicUnderline
+ syn region htmlBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmlBoldItalicUnderline
+ syn region htmlBoldUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop
+ syn region htmlBoldUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop
+ syn region htmlBoldItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic
+
+ syn region htmlUnderline start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic
+ syn region htmlUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlUnderlineBoldItalic
+ syn region htmlUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlUnderlineBoldItalic
+ syn region htmlUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlUnderlineItalicBold
+ syn region htmlUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmlUnderlineItalicBold
+ syn region htmlUnderlineItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop
+ syn region htmlUnderlineItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop
+ syn region htmlUnderlineBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop
+ syn region htmlUnderlineBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop
+
+ syn region htmlItalic start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlItalicBold,htmlItalicUnderline
+ syn region htmlItalic start="<em\>" end="</em>"me=e-5 contains=@htmlTop
+ syn region htmlItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlItalicBoldUnderline
+ syn region htmlItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlItalicBoldUnderline
+ syn region htmlItalicBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop
+ syn region htmlItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlItalicUnderlineBold
+ syn region htmlItalicUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop
+ syn region htmlItalicUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop
+
+ syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
+ syn region htmlH1 start="<h1\>" end="</h1>"me=e-5 contains=@htmlTop
+ syn region htmlH2 start="<h2\>" end="</h2>"me=e-5 contains=@htmlTop
+ syn region htmlH3 start="<h3\>" end="</h3>"me=e-5 contains=@htmlTop
+ syn region htmlH4 start="<h4\>" end="</h4>"me=e-5 contains=@htmlTop
+ syn region htmlH5 start="<h5\>" end="</h5>"me=e-5 contains=@htmlTop
+ syn region htmlH6 start="<h6\>" end="</h6>"me=e-5 contains=@htmlTop
+ syn region htmlHead start="<head\>" end="</head>"me=e-7 end="<body\>"me=e-5 end="<h[1-6]\>"me=e-3 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,javaScript,cssStyle,@htmlPreproc
+ syn region htmlTitle start="<title\>" end="</title>"me=e-8 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
+endif
+
+syn keyword htmlTagName contained noscript
+syn keyword htmlSpecialTagName contained script style
+if main_syntax != 'java' || exists("java_javascript")
+ " JAVA SCRIPT
+ syn include @htmlJavaScript syntax/javascript.vim
+ unlet b:current_syntax
+ syn region javaScript start=+<script[^>]*>+ keepend end=+</script>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
+ syn region htmlScriptTag contained start=+<script+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
+ HtmlHiLink htmlScriptTag htmlTag
+
+ " html events (i.e. arguments that include javascript commands)
+ if exists("html_extended_events")
+ syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ contains=htmlEventSQ
+ syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ contains=htmlEventDQ
+ else
+ syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ keepend contains=htmlEventSQ
+ syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ keepend contains=htmlEventDQ
+ endif
+ syn region htmlEventSQ contained start=+'+ms=s+1 end=+'+me=s-1 contains=@htmlJavaScript
+ syn region htmlEventDQ contained start=+"+ms=s+1 end=+"+me=s-1 contains=@htmlJavaScript
+ HtmlHiLink htmlEventSQ htmlEvent
+ HtmlHiLink htmlEventDQ htmlEvent
+
+ " a javascript expression is used as an arg value
+ syn region javaScriptExpression contained start=+&{+ keepend end=+};+ contains=@htmlJavaScript,@htmlPreproc
+endif
+
+if main_syntax != 'java' || exists("java_vb")
+ " VB SCRIPT
+ syn include @htmlVbScript syntax/vb.vim
+ unlet b:current_syntax
+ syn region javaScript start=+<script [^>]*language *=[^>]*vbscript[^>]*>+ keepend end=+</script>+me=s-1 contains=@htmlVbScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
+endif
+
+syn cluster htmlJavaScript add=@htmlPreproc
+
+if main_syntax != 'java' || exists("java_css")
+ " embedded style sheets
+ syn keyword htmlArg contained media
+ syn include @htmlCss syntax/css.vim
+ unlet b:current_syntax
+ syn region cssStyle start=+<style+ keepend end=+</style>+ contains=@htmlCss,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc
+ syn match htmlCssStyleComment contained "\(<!--\|-->\)"
+ syn region htmlCssDefinition matchgroup=htmlArg start='style="' keepend matchgroup=htmlString end='"' contains=css.*Attr,css.*Prop,cssComment,cssLength,cssColor,cssURL,cssImportant,cssError,cssString,@htmlPreproc
+ HtmlHiLink htmlStyleArg htmlString
+endif
+
+if main_syntax == "html"
+ " synchronizing (does not always work if a comment includes legal
+ " html tags, but doing it right would mean to always start
+ " at the first line, which is too slow)
+ syn sync match htmlHighlight groupthere NONE "<[/a-zA-Z]"
+ syn sync match htmlHighlight groupthere javaScript "<script"
+ syn sync match htmlHighlightSkip "^.*['\"].*$"
+ syn sync minlines=10
+endif
+
+" The default highlighting.
+if version >= 508 || !exists("did_html_syn_inits")
+ if version < 508
+ let did_html_syn_inits = 1
+ endif
+ HtmlHiLink htmlTag Function
+ HtmlHiLink htmlEndTag Identifier
+ HtmlHiLink htmlArg Type
+ HtmlHiLink htmlTagName htmlStatement
+ HtmlHiLink htmlSpecialTagName Exception
+ HtmlHiLink htmlValue String
+ HtmlHiLink htmlSpecialChar Special
+
+ if !exists("html_no_rendering")
+ HtmlHiLink htmlH1 Title
+ HtmlHiLink htmlH2 htmlH1
+ HtmlHiLink htmlH3 htmlH2
+ HtmlHiLink htmlH4 htmlH3
+ HtmlHiLink htmlH5 htmlH4
+ HtmlHiLink htmlH6 htmlH5
+ HtmlHiLink htmlHead PreProc
+ HtmlHiLink htmlTitle Title
+ HtmlHiLink htmlBoldItalicUnderline htmlBoldUnderlineItalic
+ HtmlHiLink htmlUnderlineBold htmlBoldUnderline
+ HtmlHiLink htmlUnderlineItalicBold htmlBoldUnderlineItalic
+ HtmlHiLink htmlUnderlineBoldItalic htmlBoldUnderlineItalic
+ HtmlHiLink htmlItalicUnderline htmlUnderlineItalic
+ HtmlHiLink htmlItalicBold htmlBoldItalic
+ HtmlHiLink htmlItalicBoldUnderline htmlBoldUnderlineItalic
+ HtmlHiLink htmlItalicUnderlineBold htmlBoldUnderlineItalic
+ HtmlHiLink htmlLink Underlined
+ if !exists("html_my_rendering")
+ hi def htmlBold term=bold cterm=bold gui=bold
+ hi def htmlBoldUnderline term=bold,underline cterm=bold,underline gui=bold,underline
+ hi def htmlBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic
+ hi def htmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,italic,underline gui=bold,italic,underline
+ hi def htmlUnderline term=underline cterm=underline gui=underline
+ hi def htmlUnderlineItalic term=italic,underline cterm=italic,underline gui=italic,underline
+ hi def htmlItalic term=italic cterm=italic gui=italic
+ endif
+ endif
+
+ HtmlHiLink htmlPreStmt PreProc
+ HtmlHiLink htmlPreError Error
+ HtmlHiLink htmlPreProc PreProc
+ HtmlHiLink htmlPreAttr String
+ HtmlHiLink htmlPreProcAttrName PreProc
+ HtmlHiLink htmlPreProcAttrError Error
+ HtmlHiLink htmlSpecial Special
+ HtmlHiLink htmlSpecialChar Special
+ HtmlHiLink htmlString String
+ HtmlHiLink htmlStatement Statement
+ HtmlHiLink htmlComment Comment
+ HtmlHiLink htmlCommentPart Comment
+ HtmlHiLink htmlValue String
+ HtmlHiLink htmlCommentError htmlError
+ HtmlHiLink htmlTagError htmlError
+ HtmlHiLink htmlEvent javaScript
+ HtmlHiLink htmlError Error
+
+ HtmlHiLink javaScript Special
+ HtmlHiLink javaScriptExpression javaScript
+ HtmlHiLink htmlCssStyleComment Comment
+ HtmlHiLink htmlCssDefinition Special
+endif
+
+delcommand HtmlHiLink
+
+let b:current_syntax = "html"
+
+if main_syntax == 'html'
+ unlet main_syntax
+endif
+
+" vim: ts=8
+
View
7 tmp/example.ejs
@@ -0,0 +1,7 @@
+<div class="zhopa">
+ <% if (!this.view_options) this.view_options = {} %>
+ <% _.each(this.items, function(item, index) { %>
+ <%= tm.utils.render_template('grid_item_row', {item: item, index: index, opts: this.view_options}) %>
+ <% }.proxy(this)) %>
+</div>
+
View
2  vimrc
@@ -131,7 +131,7 @@ set guifont=Monaco:h12
let g:user_zen_expandabbr_key = '<c-e>'
let g:use_zen_complete_tag = 1
-au BufNewFile,BufRead *.ejs set filetype=html
+au BufNewFile,BufRead *.ejs set filetype=ejs
au BufNewFile,BufRead *.as set ft actionscript
autocmd FileType yml setlocal autoindent

No commit comments for this range

Something went wrong with that request. Please try again.