Compare commits

...

9 Commits

Author SHA1 Message Date
Adam Stankiewicz
bd35da8e9c Update 2014-08-27 18:16:33 +02:00
Adam Stankiewicz
91da1ec2a5 Update README with new languages 2014-08-13 01:07:14 +02:00
Adam Stankiewicz
964107c604 Switch to official go package, closes #28 2014-08-13 00:55:50 +02:00
Adam Stankiewicz
c0560d6199 Add swift support 😄, closes #32 2014-08-13 00:17:51 +02:00
Adam Stankiewicz
15db2d7120 Use upstream CSS syntax, closes #33 2014-08-13 00:17:28 +02:00
Adam Stankiewicz
4935f02217 Add blade support, closes #34 2014-08-13 00:10:32 +02:00
Adam Stankiewicz
438d222b95 Add emblem support, closes #36 2014-08-13 00:03:22 +02:00
Adam Stankiewicz
90b24287de Update 2014-08-12 23:45:36 +02:00
Adam Stankiewicz
5f1223fbc5 Major update 2014-07-29 13:03:49 +02:00
72 changed files with 2318 additions and 912 deletions

View File

@@ -26,19 +26,22 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
## Language packs ## Language packs
- [arduino](https://github.com/sudar/vim-arduino-syntax) (syntax, indent, ftdetect) - [arduino](https://github.com/sudar/vim-arduino-syntax) (syntax, indent, ftdetect)
- [blade](https://github.com/xsbeats/vim-blade) (syntax, indent, ftdetect)
- [c++11](https://github.com/octol/vim-cpp-enhanced-highlight) (syntax) - [c++11](https://github.com/octol/vim-cpp-enhanced-highlight) (syntax)
- [c/c++](https://github.com/vim-jp/cpp-vim) (syntax) - [c/c++](https://github.com/vim-jp/cpp-vim) (syntax)
- [c-extensions](https://github.com/kergoth/aftersyntaxc.vim) (syntax) - [c-extensions](https://github.com/kergoth/aftersyntaxc.vim) (syntax)
- [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, autoload, ftplugin, ftdetect) - [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, autoload, ftplugin, ftdetect)
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin, ftdetect) - [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
- [css](https://github.com/JulesWang/css.vim) (syntax)
- [csv](https://github.com/chrisbra/csv.vim) (syntax, ftplugin, ftdetect) - [csv](https://github.com/chrisbra/csv.vim) (syntax, ftplugin, ftdetect)
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect) - [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect)
- [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect) - [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect)
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect) - [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect)
- [emberscript](https://github.com/heartsentwined/vim-ember-script) (syntax, indent, ftplugin, ftdetect) - [emberscript](https://github.com/heartsentwined/vim-ember-script) (syntax, indent, ftplugin, ftdetect)
- [emblem](https://github.com/heartsentwined/vim-emblem) (syntax, indent, ftplugin, ftdetect)
- [erlang](https://github.com/oscarh/vimerl) (syntax, indent, compiler, autoload, ftplugin) - [erlang](https://github.com/oscarh/vimerl) (syntax, indent, compiler, autoload, ftplugin)
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect) - [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect)
- [go](https://github.com/jnwhiteh/vim-golang) (syntax, indent, compiler, autoload, ftplugin, ftdetect) - [go](https://github.com/fatih/vim-go) (syntax, indent, ftdetect)
- [haml](https://github.com/tpope/vim-haml) (syntax, indent, compiler, ftplugin, ftdetect) - [haml](https://github.com/tpope/vim-haml) (syntax, indent, compiler, ftplugin, ftdetect)
- [handlebars](https://github.com/mustache/vim-mustache-handlebars) (syntax, ftplugin, ftdetect) - [handlebars](https://github.com/mustache/vim-mustache-handlebars) (syntax, ftplugin, ftdetect)
- [haskell](https://github.com/travitch/hasksyn) (syntax, indent, ftplugin) - [haskell](https://github.com/travitch/hasksyn) (syntax, indent, ftplugin)
@@ -65,12 +68,13 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
- [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin) - [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin)
- [rspec](https://github.com/sheerun/rspec.vim) (syntax, ftdetect) - [rspec](https://github.com/sheerun/rspec.vim) (syntax, ftdetect)
- [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin, ftdetect) - [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
- [rust](https://github.com/wting/rust.vim) (syntax, indent, compiler, ftplugin, ftdetect) - [rust](https://github.com/wting/rust.vim) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax, ftdetect) - [sbt](https://github.com/derekwyatt/vim-sbt) (syntax, ftdetect)
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, ftplugin, ftdetect) - [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, ftplugin, ftdetect)
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftdetect) - [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftdetect)
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin, ftdetect) - [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin, ftdetect)
- [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax, ftdetect) - [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax, ftdetect)
- [swift](https://github.com/toyamarinyon/vim-swift) (syntax, indent, ftdetect)
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect) - [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect)
- [tmux](https://github.com/acustodioo/vim-tmux) (syntax, ftdetect) - [tmux](https://github.com/acustodioo/vim-tmux) (syntax, ftdetect)
- [tomdoc](https://github.com/duwanis/tomdoc.vim) (syntax) - [tomdoc](https://github.com/duwanis/tomdoc.vim) (syntax)

View File

@@ -1,11 +1,16 @@
inoremap <buffer> <silent> > ><Esc>:call <SID>puppetalign()<CR>A if !exists('g:puppet_align_hashes')
function! s:puppetalign() let g:puppet_align_hashes = 1
let p = '^\s*\w+\s*[=+]>.*$' endif
let lineContainsHashrocket = getline('.') =~# '^\s*\w+\s*[=+]>'
let hashrocketOnPrevLine = getline(line('.') - 1) =~# p if g:puppet_align_hashes && exists(':Tabularize')
let hashrocketOnNextLine = getline(line('.') + 1) =~# p inoremap <buffer> <silent> > ><Esc>:call <SID>puppetalign()<CR>a
if exists(':Tabularize') " && lineContainsHashrocket && (hashrocketOnPrevLine || hashrocketOnNextLine) function! s:puppetalign()
let p = '^\s*\w+\s*[=+]>.*$'
let column = strlen(substitute(getline('.')[0:col('.')],'\([^=]\|=[^>]\)','','g'))
let position = strlen(matchstr(getline('.')[0:col('.')],'.*=>\s*\zs.*'))
Tabularize /=>/l1 Tabularize /=>/l1
normal! 0 normal! 0
endif echo repeat('\([^=]\|=[^>]\)*=>',column).'\s\{-\}'.repeat('.',position)
endfunction call search(repeat('\([^=]\|=[^>]\)*=>',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
endfunction
endif

View File

@@ -1,3 +1,27 @@
" Vim syntax file
" Language: C Additions
" Maintainer: Jon Haggblad <jon@haeggblad.com>
" URL: http://www.haeggblad.com
" Last Change: 9 Aug 2014
" Version: 0.1
" Changelog:
" 0.1 - initial version.
"
" Syntax highlighting for functions in C.
"
" Based on:
" http://stackoverflow.com/questions/736701/class-function-names-highlighting-in-vim
" -----------------------------------------------------------------------------
" Highlight Class and Function names.
" -----------------------------------------------------------------------------
syn match cCustomParen "(" contains=cParen contains=cCppParen
syn match cCustomFunc "\w\+\s*(\@=" contains=cCustomParen
syn match cCustomScope "::"
syn match cCustomClass "\w\+\s*::" contains=cCustomScope
hi def link cCustomFunc Function
" Vim syntax file " Vim syntax file
" Language: C Additions " Language: C Additions
" Maintainer: Mikhail Wolfson <mywolfson@gmail.com> " Maintainer: Mikhail Wolfson <mywolfson@gmail.com>

View File

@@ -9,6 +9,28 @@ syn region coffeeScript start=#<script [^>]*type="text/coffeescript"[^>]*>#
\ end=#</script>#me=s-1 keepend \ end=#</script>#me=s-1 keepend
\ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc \ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc
\ containedin=htmlHead \ containedin=htmlHead
if !exists("g:less_html_style_tags")
let g:less_html_style_tags = 1
endif
if !g:less_html_style_tags
finish
endif
" Unset (but preserve) so that less will run.
let s:pre_less_cur_syn = b:current_syntax
unlet b:current_syntax
" Inspired by code from github.com/kchmck/vim-coffee-script
" and the html syntax file included with vim 7.4.
syn include @htmlLess syntax/less.vim
" We have to explicitly add to htmlHead (containedin) as that region specifies 'contains'.
syn region lessStyle start=+<style [^>]*type *=[^>]*text/less[^>]*>+ keepend end=+</style>+ contains=@htmlLess,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc containedin=htmlHead
" Reset since 'less' isn't really the current_syntax.
let b:current_syntax = s:pre_less_cur_syn
" Language: Colorful CSS Color Preview " Language: Colorful CSS Color Preview
" Author: Aristotle Pagaltzis <pagaltzis@gmx.de> " Author: Aristotle Pagaltzis <pagaltzis@gmx.de>

View File

@@ -3,4 +3,4 @@
if !( has('gui_running') || &t_Co==256 ) | finish | endif if !( has('gui_running') || &t_Co==256 ) | finish | endif
call css_color#init('css', 'lessVariableValue') call css_color#init('css', 'lessVariableValue,lessDefinition,lessComment')

View File

@@ -29,5 +29,3 @@ hi link rustNiceOperator Operator
if !exists('g:rust_conceal_mod_path') if !exists('g:rust_conceal_mod_path')
hi! link Conceal Operator hi! link Conceal Operator
endif endif
setlocal conceallevel=2

View File

@@ -1,103 +0,0 @@
" Copyright 2011 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" This file provides a utility function that performs auto-completion of
" package names, for use by other commands.
let s:goos = $GOOS
let s:goarch = $GOARCH
if len(s:goos) == 0
if exists('g:golang_goos')
let s:goos = g:golang_goos
elseif has('win32') || has('win64')
let s:goos = 'windows'
elseif has('macunix')
let s:goos = 'darwin'
else
let s:goos = '*'
endif
endif
if len(s:goarch) == 0
if exists('g:golang_goarch')
let s:goarch = g:golang_goarch
else
let s:goarch = '*'
endif
endif
function! go#complete#PackageMembers(package, member)
silent! let content = system('godoc ' . a:package)
if v:shell_error || !len(content)
return []
endif
let lines = filter(split(content, "\n"),"v:val !~ '^\\s\\+$'")
try
let mx1 = '^\s\+\(\S+\)\s\+=\s\+.*'
let mx2 = '^\%(const\|var\|type\|func\) \([A-Z][^ (]\+\).*'
let candidates =
\ map(filter(copy(lines), 'v:val =~ mx1'), 'substitute(v:val, mx1, "\\1", "")')
\ + map(filter(copy(lines), 'v:val =~ mx2'), 'substitute(v:val, mx2, "\\1", "")')
return filter(candidates, '!stridx(v:val, a:member)')
catch
return []
endtry
endfunction
function! go#complete#Package(ArgLead, CmdLine, CursorPos)
let dirs = []
let words = split(a:CmdLine, '\s\+', 1)
if len(words) > 2
" Complete package members
return go#complete#PackageMembers(words[1], words[2])
endif
if executable('go')
let goroot = substitute(system('go env GOROOT'), '\n', '', 'g')
if v:shell_error
echomsg '''go env GOROOT'' failed'
endif
else
let goroot = $GOROOT
endif
if len(goroot) != 0 && isdirectory(goroot)
let dirs += [goroot]
endif
let pathsep = ':'
if s:goos == 'windows'
let pathsep = ';'
endif
let workspaces = split($GOPATH, pathsep)
if workspaces != []
let dirs += workspaces
endif
if len(dirs) == 0
" should not happen
return []
endif
let ret = {}
for dir in dirs
" this may expand to multiple lines
let root = split(expand(dir . '/pkg/' . s:goos . '_' . s:goarch), "\n")
call add(root, expand(dir . '/src'))
for r in root
for i in split(globpath(r, a:ArgLead.'*'), "\n")
if isdirectory(i)
let i .= '/'
elseif i !~ '\.a$'
continue
endif
let i = substitute(substitute(i[len(r)+1:], '[\\]', '/', 'g'), '\.a$', '', 'g')
let ret[i] = i
endfor
endfor
endfor
return sort(keys(ret))
endfunction

View File

@@ -10,7 +10,47 @@ if !exists('g:aria_attributes_complete')
let g:aria_attributes_complete = 1 let g:aria_attributes_complete = 1
endif endif
let b:html_omni_flavor = 'html5' " Distinguish between HTML versions.
" To use with other HTML versions add another "elseif" condition to match
" proper DOCTYPE.
function! htmlcomplete#DetectOmniFlavor()
if &filetype == 'xhtml'
let b:html_omni_flavor = 'xhtml10s'
else
let b:html_omni_flavor = 'html5'
endif
let i = 1
let line = ""
while i < 10 && i < line("$")
let line = getline(i)
if line =~ '<!DOCTYPE.*\<DTD '
break
endif
let i += 1
endwhile
if line =~ '<!DOCTYPE.*\<DTD ' " doctype line found above
if line =~ ' HTML 3\.2'
let b:html_omni_flavor = 'html32'
elseif line =~ ' XHTML 1\.1'
let b:html_omni_flavor = 'xhtml11'
else " two-step detection with strict/frameset/transitional
if line =~ ' XHTML 1\.0'
let b:html_omni_flavor = 'xhtml10'
elseif line =~ ' HTML 4\.01'
let b:html_omni_flavor = 'html401'
elseif line =~ ' HTML 4.0\>'
let b:html_omni_flavor = 'html40'
endif
if line =~ '\<Transitional\>'
let b:html_omni_flavor .= 't'
elseif line =~ '\<Frameset\>'
let b:html_omni_flavor .= 'f'
else
let b:html_omni_flavor .= 's'
endif
endif
endif
endfunction
function! htmlcomplete#CompleteTags(findstart, base) function! htmlcomplete#CompleteTags(findstart, base)
if a:findstart if a:findstart
@@ -162,11 +202,8 @@ function! htmlcomplete#CompleteTags(findstart, base)
if exists("b:entitiescompl") if exists("b:entitiescompl")
unlet! b:entitiescompl unlet! b:entitiescompl
if !exists("b:html_doctype")
call htmlcomplete#CheckDoctype()
endif
if !exists("b:html_omni") if !exists("b:html_omni")
"runtime! autoload/xml/xhtml10s.vim call htmlcomplete#CheckDoctype()
call htmlcomplete#LoadData() call htmlcomplete#LoadData()
endif endif
if g:aria_attributes_complete == 1 && !exists("b:aria_omni") if g:aria_attributes_complete == 1 && !exists("b:aria_omni")
@@ -464,11 +501,8 @@ function! htmlcomplete#CompleteTags(findstart, base)
let entered_value = matchstr(attr, ".*=\\s*[\"']\\?\\zs.*") let entered_value = matchstr(attr, ".*=\\s*[\"']\\?\\zs.*")
let values = [] let values = []
" Load data {{{ " Load data {{{
if !exists("b:html_doctype")
call htmlcomplete#CheckDoctype()
endif
if !exists("b:html_omni") if !exists("b:html_omni")
"runtime! autoload/xml/xhtml10s.vim call htmlcomplete#CheckDoctype()
call htmlcomplete#LoadData() call htmlcomplete#LoadData()
endif endif
if g:aria_attributes_complete == 1 && !exists("b:aria_omni") if g:aria_attributes_complete == 1 && !exists("b:aria_omni")
@@ -547,10 +581,8 @@ function! htmlcomplete#CompleteTags(findstart, base)
let sbase = matchstr(context, '.*\ze\s.*') let sbase = matchstr(context, '.*\ze\s.*')
" Load data {{{ " Load data {{{
if !exists("b:html_doctype")
call htmlcomplete#CheckDoctype()
endif
if !exists("b:html_omni") if !exists("b:html_omni")
call htmlcomplete#CheckDoctype()
call htmlcomplete#LoadData() call htmlcomplete#LoadData()
endif endif
if g:aria_attributes_complete == 1 && !exists("b:aria_omni") if g:aria_attributes_complete == 1 && !exists("b:aria_omni")
@@ -653,11 +685,8 @@ function! htmlcomplete#CompleteTags(findstart, base)
endif endif
" }}} " }}}
" Load data {{{ " Load data {{{
if !exists("b:html_doctype")
call htmlcomplete#CheckDoctype()
endif
if !exists("b:html_omni") if !exists("b:html_omni")
"runtime! autoload/xml/xhtml10s.vim call htmlcomplete#CheckDoctype()
call htmlcomplete#LoadData() call htmlcomplete#LoadData()
endif endif
if g:aria_attributes_complete == 1 && !exists("b:aria_omni") if g:aria_attributes_complete == 1 && !exists("b:aria_omni")
@@ -787,61 +816,8 @@ function! htmlcomplete#CheckDoctype() " {{{
else else
let old_flavor = '' let old_flavor = ''
endif endif
let i = 1 call htmlcomplete#DetectOmniFlavor()
while i < 10 && i < line("$") if !exists('b:html_omni_flavor')
let line = getline(i)
if line =~ '<!DOCTYPE.*\<DTD HTML 3\.2'
let b:html_omni_flavor = 'html32'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.0 Transitional'
let b:html_omni_flavor = 'html40t'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.0 Frameset'
let b:html_omni_flavor = 'html40f'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.0'
let b:html_omni_flavor = 'html40s'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.01 Transitional'
let b:html_omni_flavor = 'html401t'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.01 Frameset'
let b:html_omni_flavor = 'html401f'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD HTML 4\.01'
let b:html_omni_flavor = 'html401s'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD XHTML 1\.0 Transitional'
let b:html_omni_flavor = 'xhtml10t'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD XHTML 1\.0 Frameset'
let b:html_omni_flavor = 'xhtml10f'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD XHTML 1\.0 Strict'
let b:html_omni_flavor = 'xhtml10s'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE.*\<DTD XHTML 1\.1'
let b:html_omni_flavor = 'xhtml11'
let b:html_doctype = 1
break
elseif line =~ '<!DOCTYPE html'
let b:html_omni_flavor = 'html5'
let b:html_doctype = 1
break
endif
let i += 1
endwhile
if !exists("b:html_doctype")
return return
else else
" Tie g:xmldata with b:html_omni this way we need to sourca data file only " Tie g:xmldata with b:html_omni this way we need to sourca data file only

225
autoload/rust.vim Normal file
View File

@@ -0,0 +1,225 @@
" Author: Kevin Ballard
" Description: Helper functions for Rust commands/mappings
" Last Modified: May 27, 2014
" Jump {{{1
function! rust#Jump(mode, function) range
let cnt = v:count1
normal! m'
if a:mode ==# 'v'
norm! gv
endif
let foldenable = &foldenable
set nofoldenable
while cnt > 0
execute "call <SID>Jump_" . a:function . "()"
let cnt = cnt - 1
endwhile
let &foldenable = foldenable
endfunction
function! s:Jump_Back()
call search('{', 'b')
keepjumps normal! w99[{
endfunction
function! s:Jump_Forward()
normal! j0
call search('{', 'b')
keepjumps normal! w99[{%
call search('{')
endfunction
" Run {{{1
function! rust#Run(bang, args)
if a:bang
let idx = index(a:args, '--')
if idx != -1
let rustc_args = idx == 0 ? [] : a:args[:idx-1]
let args = a:args[idx+1:]
else
let rustc_args = a:args
let args = []
endif
else
let rustc_args = []
let args = a:args
endif
let b:rust_last_rustc_args = rustc_args
let b:rust_last_args = args
call s:WithPath(function("s:Run"), rustc_args, args)
endfunction
function! s:Run(path, rustc_args, args)
try
let exepath = tempname()
if has('win32')
let exepath .= '.exe'
endif
let rustc_args = [a:path, '-o', exepath] + a:rustc_args
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
let output = system(shellescape(rustc) . " " . join(map(rustc_args, 'shellescape(v:val)')))
if output != ''
echohl WarningMsg
echo output
echohl None
endif
if !v:shell_error
exe '!' . shellescape(exepath) . " " . join(map(a:args, 'shellescape(v:val)'))
endif
finally
if exists("exepath")
silent! call delete(exepath)
endif
endtry
endfunction
" Expand {{{1
function! rust#Expand(bang, args)
if a:bang && !empty(a:args)
let pretty = a:args[0]
let args = a:args[1:]
else
let pretty = "expanded"
let args = a:args
endif
call s:WithPath(function("s:Expand"), pretty, args)
endfunction
function! s:Expand(path, pretty, args)
try
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
let args = [a:path, '--pretty', a:pretty] + a:args
let output = system(shellescape(rustc) . " " . join(map(args, "shellescape(v:val)")))
if v:shell_error
echohl WarningMsg
echo output
echohl None
else
new
silent put =output
1
d
setl filetype=rust
setl buftype=nofile
setl bufhidden=hide
setl noswapfile
endif
endtry
endfunction
function! rust#CompleteExpand(lead, line, pos)
if a:line[: a:pos-1] =~ '^RustExpand!\s*\S*$'
" first argument and it has a !
let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph="]
if !empty(a:lead)
call filter(list, "v:val[:len(a:lead)-1] == a:lead")
endif
return list
endif
return glob(escape(a:lead, "*?[") . '*', 0, 1)
endfunction
" Emit {{{1
function! rust#Emit(type, args)
call s:WithPath(function("s:Emit"), a:type, a:args)
endfunction
function! s:Emit(path, type, args)
try
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
let args = [a:path, '--emit', a:type, '-o', '-'] + a:args
let output = system(shellescape(rustc) . " " . join(map(args, "shellescape(v:val)")))
if v:shell_error
echohl WarningMsg
echo output
echohl None
else
new
silent put =output
1
d
if a:type == "ir"
setl filetype=llvm
elseif a:type == "asm"
setl filetype=asm
endif
setl buftype=nofile
setl bufhidden=hide
setl noswapfile
endif
endtry
endfunction
" Utility functions {{{1
function! s:WithPath(func, ...)
try
let save_write = &write
set write
let path = expand('%')
let pathisempty = empty(path)
if pathisempty || !save_write
" use a temporary file named 'unnamed.rs' inside a temporary
" directory. This produces better error messages
let tmpdir = tempname()
call mkdir(tmpdir)
let save_cwd = getcwd()
silent exe 'lcd' tmpdir
let path = 'unnamed.rs'
let save_mod = &mod
set nomod
silent exe 'keepalt write! ' . path
if pathisempty
silent keepalt 0file
endif
else
update
endif
call call(a:func, [path] + a:000)
finally
if exists("save_mod") | let &mod = save_mod | endif
if exists("save_write") | let &write = save_write | endif
if exists("save_cwd") | silent exe 'lcd' save_cwd | endif
if exists("tmpdir") | silent call s:RmDir(tmpdir) | endif
endtry
endfunction
function! rust#AppendCmdLine(text)
call setcmdpos(getcmdpos())
let cmd = getcmdline() . a:text
return cmd
endfunction
function! s:RmDir(path)
" sanity check; make sure it's not empty, /, or $HOME
if empty(a:path)
echoerr 'Attempted to delete empty path'
return 0
elseif a:path == '/' || a:path == $HOME
echoerr 'Attempted to delete protected path: ' . a:path
return 0
endif
silent exe "!rm -rf " . shellescape(a:path)
endfunction
" }}}1
" vim: set noet sw=4 ts=4:

View File

@@ -553,7 +553,7 @@ let g:xmldata_html5 = {
\ ], \ ],
\ 'input': [ \ 'input': [
\ [], \ [],
\ extend(copy(global_attributes), {'type': ['text', 'password', 'checkbox', 'radio', 'button', 'submit', 'reset', 'file', 'hidden', 'image', 'datetime', 'datetime-local', 'date', 'month', 'time', 'week', 'number', 'range', 'email', 'url', 'search', 'tel', 'coloe'], 'name': [], 'disabled': ['disabled', ''], 'form': [], 'maxlength': [], 'readonly': ['readonly', ''], 'size': [], 'value': [], 'autocomplete': ['on', 'off'], 'autofocus': ['autofocus', ''], 'list': [], 'pattern': [], 'required': ['required', ''], 'placeholder': [], 'checked': ['checked'], 'accept': [], 'multiple': ['multiple', ''], 'alt': [], 'src': [], 'height': [], 'width': [], 'min': [], 'max': [], 'step': [], 'formenctype': ['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain'], 'formmethod': ['get', 'post', 'put', 'delete'], 'formtarget': [], 'formnovalidate': ['formnovalidate', '']}) \ extend(copy(global_attributes), {'type': ['text', 'password', 'checkbox', 'radio', 'button', 'submit', 'reset', 'file', 'hidden', 'image', 'datetime', 'datetime-local', 'date', 'month', 'time', 'week', 'number', 'range', 'email', 'url', 'search', 'tel', 'color'], 'name': [], 'disabled': ['disabled', ''], 'form': [], 'maxlength': [], 'readonly': ['readonly', ''], 'size': [], 'value': [], 'autocomplete': ['on', 'off'], 'autofocus': ['autofocus', ''], 'list': [], 'pattern': [], 'required': ['required', ''], 'placeholder': [], 'checked': ['checked'], 'accept': [], 'multiple': ['multiple', ''], 'alt': [], 'src': [], 'height': [], 'width': [], 'min': [], 'max': [], 'step': [], 'formenctype': ['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain'], 'formmethod': ['get', 'post', 'put', 'delete'], 'formtarget': [], 'formnovalidate': ['formnovalidate', '']})
\ ], \ ],
\ 'ins': [ \ 'ins': [
\ flow_elements, \ flow_elements,

10
build
View File

@@ -3,6 +3,7 @@
set -E set -E
DIRS="syntax indent compiler autoload ftplugin ftdetect after/syntax after/indent after/ftplugin after/ftdetect" DIRS="syntax indent compiler autoload ftplugin ftdetect after/syntax after/indent after/ftplugin after/ftdetect"
DIRS_BASIC="syntax indent ftdetect after/syntax after/indent after/ftdetect"
download() { download() {
for pack in $1; do for pack in $1; do
@@ -21,10 +22,11 @@ extract() {
name="$(printf "$pack" | cut -d ':' -f 1)" name="$(printf "$pack" | cut -d ':' -f 1)"
path="$(printf "$pack" | cut -d ':' -f 2)" path="$(printf "$pack" | cut -d ':' -f 2)"
dir="tmp/$(printf "$path" | cut -d '/' -f 2)" dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
directories="DIRS$(printf "$pack" | cut -d ':' -f 3)"
printf -- "- [$name](https://github.com/$path) (" printf -- "- [$name](https://github.com/$path) ("
subdirs="" subdirs=""
for subdir in $DIRS; do for subdir in ${!directories}; do
if [ -d "$dir/$subdir" ]; then if [ -d "$dir/$subdir" ]; then
base="$(basename "$subdir")" base="$(basename "$subdir")"
if [[ "$subdirs" != *"$base"* ]]; then if [[ "$subdirs" != *"$base"* ]]; then
@@ -67,19 +69,22 @@ concat_ftdetect() {
PACKS=" PACKS="
arduino:sudar/vim-arduino-syntax arduino:sudar/vim-arduino-syntax
blade:xsbeats/vim-blade
c++11:octol/vim-cpp-enhanced-highlight c++11:octol/vim-cpp-enhanced-highlight
c/c++:vim-jp/cpp-vim c/c++:vim-jp/cpp-vim
c-extensions:kergoth/aftersyntaxc.vim c-extensions:kergoth/aftersyntaxc.vim
clojure:guns/vim-clojure-static clojure:guns/vim-clojure-static
coffee-script:kchmck/vim-coffee-script coffee-script:kchmck/vim-coffee-script
css:JulesWang/css.vim
csv:chrisbra/csv.vim csv:chrisbra/csv.vim
cucumber:tpope/vim-cucumber cucumber:tpope/vim-cucumber
dockerfile:honza/dockerfile.vim dockerfile:honza/dockerfile.vim
elixir:elixir-lang/vim-elixir elixir:elixir-lang/vim-elixir
emberscript:heartsentwined/vim-ember-script emberscript:heartsentwined/vim-ember-script
emblem:heartsentwined/vim-emblem
erlang:oscarh/vimerl erlang:oscarh/vimerl
git:tpope/vim-git git:tpope/vim-git
go:jnwhiteh/vim-golang go:fatih/vim-go:_BASIC
haml:tpope/vim-haml haml:tpope/vim-haml
handlebars:mustache/vim-mustache-handlebars handlebars:mustache/vim-mustache-handlebars
haskell:travitch/hasksyn haskell:travitch/hasksyn
@@ -112,6 +117,7 @@ PACKS="
slim:slim-template/vim-slim slim:slim-template/vim-slim
stylus:wavded/vim-stylus stylus:wavded/vim-stylus
systemd:kurayama/systemd-vim-syntax systemd:kurayama/systemd-vim-syntax
swift:toyamarinyon/vim-swift
textile:timcharper/textile.vim textile:timcharper/textile.vim
tmux:acustodioo/vim-tmux tmux:acustodioo/vim-tmux
tomdoc:duwanis/tomdoc.vim tomdoc:duwanis/tomdoc.vim

View File

@@ -1,30 +0,0 @@
" Copyright 2013 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" compiler/go.vim: Vim compiler file for Go.
if exists("current_compiler")
finish
endif
let current_compiler = "go"
if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args>
endif
let s:save_cpo = &cpo
set cpo-=C
CompilerSet makeprg=go\ build
CompilerSet errorformat=
\%-G#\ %.%#,
\%A%f:%l:%c:\ %m,
\%A%f:%l:\ %m,
\%C%*\\s%m,
\%-G%.%#
let &cpo = s:save_cpo
unlet s:save_cpo
" vim:ts=4:sw=4:et

View File

@@ -27,7 +27,11 @@ CompilerSet errorformat=
\%\\s%#[%f:%l:\ %#%m, \%\\s%#[%f:%l:\ %#%m,
\%\\s%#%f:%l:\ %#%m, \%\\s%#%f:%l:\ %#%m,
\%\\s%#%f:%l:, \%\\s%#%f:%l:,
\%m\ [%f:%l]: \%m\ [%f:%l]:,
\%+Erake\ aborted!,
\%+EDon't\ know\ how\ to\ build\ task\ %.%#,
\%+Einvalid\ option:%.%#,
\%+Irake\ %\\S%\\+%\\s%\\+#\ %.%#
let &cpo = s:cpo_save let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save

View File

@@ -1,4 +1,5 @@
au BufRead,BufNewFile *.ino,*.pde set filetype=arduino au BufRead,BufNewFile *.ino,*.pde set filetype=arduino
autocmd BufRead,BufNewFile *.blade.php set filetype=blade
autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn setlocal filetype=clojure autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn setlocal filetype=clojure
autocmd BufNewFile,BufRead *.coffee set filetype=coffee autocmd BufNewFile,BufRead *.coffee set filetype=coffee
autocmd BufNewFile,BufRead *Cakefile set filetype=coffee autocmd BufNewFile,BufRead *Cakefile set filetype=coffee
@@ -13,10 +14,14 @@ autocmd BufNewFile,BufRead * call s:DetectCoffee()
au BufRead,BufNewFile *.csv,*.dat,*.tsv,*.tab set filetype=csv au BufRead,BufNewFile *.csv,*.dat,*.tsv,*.tab set filetype=csv
autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber
au BufNewFile,BufRead Dockerfile set filetype=dockerfile au BufNewFile,BufRead Dockerfile set filetype=dockerfile
au BufRead,BufNewFile *.eex set filetype=eelixir
au FileType eelixir setl sw=2 sts=2 et iskeyword+=!,?
au BufRead,BufNewFile *.ex,*.exs set filetype=elixir au BufRead,BufNewFile *.ex,*.exs set filetype=elixir
au FileType elixir setl sw=2 sts=2 et iskeyword+=!,? au FileType elixir setl sw=2 sts=2 et iskeyword+=!,?
autocmd BufNewFile,BufRead *.em set filetype=ember-script autocmd BufNewFile,BufRead *.em set filetype=ember-script
autocmd FileType ember-script set tabstop=2|set shiftwidth=2|set expandtab autocmd FileType ember-script set tabstop=2|set shiftwidth=2|set expandtab
autocmd BufNewFile,BufRead *.emblem set filetype=emblem
autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab
autocmd BufNewFile,BufRead *.git/{,modules/**/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit autocmd BufNewFile,BufRead *.git/{,modules/**/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit
autocmd BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules set ft=gitconfig autocmd BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules set ft=gitconfig
autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig
@@ -31,6 +36,10 @@ autocmd BufNewFile,BufRead,StdinReadPost *
\ if getline(1) =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$' | \ if getline(1) =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$' |
\ set ft=git | \ set ft=git |
\ endif \ endif
autocmd BufNewFile,BufRead *
\ if getline(1) =~ '^From \x\{40\} Mon Sep 17 00:00:00 2001$' |
\ set filetype=gitsendemail |
\ endif
let s:current_fileformats = '' let s:current_fileformats = ''
let s:current_fileencodings = '' let s:current_fileencodings = ''
function! s:gofiletype_pre() function! s:gofiletype_pre()
@@ -99,8 +108,37 @@ if has("autocmd")
endif endif
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/*,*/nginx/vhosts.d/*,nginx.conf if &ft == '' | setfiletype nginx | endif au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/*,*/nginx/vhosts.d/*,nginx.conf if &ft == '' | setfiletype nginx | endif
au BufRead,BufNewFile *.cl set filetype=opencl au BufRead,BufNewFile *.cl set filetype=opencl
function! s:DetectPerl6()
let line_no = 1
let eof = line('$')
let in_pod = 0
while line_no <= eof
let line = getline(line_no)
let line_no = line_no + 1
if line =~ '^=\w'
let in_pod = 1
elseif line =~ '^=\%(end\|cut\)'
let in_pod = 0
elseif !in_pod
let line = substitute(line, '#.*', '', '')
if line =~ '^\s*$'
continue
endif
if line =~ '^\s*\%(use\s\+\)\=v6\%(\.\d\%(\.\d\)\=\)\=;'
set filetype=perl6 " we matched a 'use v6' declaration
elseif line =~ '^\s*\%(\%(my\|our\)\s\+\)\=\(module\|class\|role\|enum\|grammar\)'
set filetype=perl6 " we found a class, role, module, enum, or grammar declaration
endif
break " we either found what we needed, or we found a non-POD, non-comment,
" non-Perl 6 indicating line, so bail out
endif
endwhile
endfunction
autocmd BufReadPost *.pl,*.pm,*.t call s:DetectPerl6()
autocmd BufNew,BufRead *.nqp setf perl6
autocmd BufNewFile,BufRead *.proto setfiletype proto autocmd BufNewFile,BufRead *.proto setfiletype proto
au! BufRead,BufNewFile *.pp setfiletype puppet au! BufRead,BufNewFile *.pp setfiletype puppet
au! BufRead,BufNewFile Puppetfile setfiletype ruby
function! s:setf(filetype) abort function! s:setf(filetype) abort
if &filetype !=# a:filetype if &filetype !=# a:filetype
let &filetype = a:filetype let &filetype = a:filetype
@@ -113,7 +151,7 @@ au BufNewFile,BufRead [rR]antfile,*.rant call s:setf('ruby')
au BufNewFile,BufRead .irbrc,irbrc call s:setf('ruby') au BufNewFile,BufRead .irbrc,irbrc call s:setf('ruby')
au BufNewFile,BufRead .pryrc call s:setf('ruby') au BufNewFile,BufRead .pryrc call s:setf('ruby')
au BufNewFile,BufRead *.ru call s:setf('ruby') au BufNewFile,BufRead *.ru call s:setf('ruby')
au BufNewFile,BufRead Capfile call s:setf('ruby') au BufNewFile,BufRead Capfile,*.cap call s:setf('ruby')
au BufNewFile,BufRead Gemfile call s:setf('ruby') au BufNewFile,BufRead Gemfile call s:setf('ruby')
au BufNewFile,BufRead Guardfile,.Guardfile call s:setf('ruby') au BufNewFile,BufRead Guardfile,.Guardfile call s:setf('ruby')
au BufNewFile,BufRead Cheffile call s:setf('ruby') au BufNewFile,BufRead Cheffile call s:setf('ruby')
@@ -140,6 +178,7 @@ au BufRead,BufNewFile * call s:DetectScala()
autocmd BufNewFile,BufRead *.slim set filetype=slim autocmd BufNewFile,BufRead *.slim set filetype=slim
autocmd BufNewFile,BufReadPost *.styl set filetype=stylus autocmd BufNewFile,BufReadPost *.styl set filetype=stylus
autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus
autocmd BufNewFile,BufRead *.swift set filetype=swift
au BufNewFile,BufRead *.automount set filetype=systemd au BufNewFile,BufRead *.automount set filetype=systemd
au BufNewFile,BufRead *.mount set filetype=systemd au BufNewFile,BufRead *.mount set filetype=systemd
au BufNewFile,BufRead *.path set filetype=systemd au BufNewFile,BufRead *.path set filetype=systemd

View File

@@ -160,7 +160,7 @@ fu! <sid>Init(startline, endline) "{{{3
" \ delf <sid>PrepareFolding | delf <sid>OutputFilters | " \ delf <sid>PrepareFolding | delf <sid>OutputFilters |
" \ delf <sid>SortFilter | delf <sid>GetColumn | " \ delf <sid>SortFilter | delf <sid>GetColumn |
" \ delf <sid>RemoveLastItem | delf <sid>DisableFolding | " \ delf <sid>RemoveLastItem | delf <sid>DisableFolding |
" \ delf <sid>GetSID | delf <sid>CheckHeaderLine | " \ delf <sid>CheckHeaderLine |
" \ delf <sid>AnalyzeColumn | delf <sid>Vertfold | " \ delf <sid>AnalyzeColumn | delf <sid>Vertfold |
" \ delf <sid>InitCSVFixedWidth | delf <sid>LocalCmd | " \ delf <sid>InitCSVFixedWidth | delf <sid>LocalCmd |
" \ delf <sid>CommandDefinitions | delf <sid>NumberFormat | " \ delf <sid>CommandDefinitions | delf <sid>NumberFormat |
@@ -806,18 +806,18 @@ fu! <sid>GetColPat(colnr, zs_flag) "{{{3
else else
if a:colnr >= len(b:csv_fixed_width_cols) if a:colnr >= len(b:csv_fixed_width_cols)
" Get last column " Get last column
let pat='\%' . b:csv_fixed_width_cols[-1] . 'c.*' let pat='\%' . b:csv_fixed_width_cols[-1] . 'v.*'
else else
let pat='\%' . b:csv_fixed_width_cols[(a:colnr - 1)] . let pat='\%' . b:csv_fixed_width_cols[(a:colnr - 1)] .
\ 'c.\{-}\%' . b:csv_fixed_width_cols[a:colnr] . 'c' \ 'c.\{-}\%' . b:csv_fixed_width_cols[a:colnr] . 'v'
endif endif
endif endif
elseif !exists("b:csv_fixed_width_cols") elseif !exists("b:csv_fixed_width_cols")
let pat=b:col let pat=b:col
else else
let pat='\%' . b:csv_fixed_width_cols[0] . 'c.\{-}' . let pat='\%' . b:csv_fixed_width_cols[0] . 'v.\{-}' .
\ (len(b:csv_fixed_width_cols) > 1 ? \ (len(b:csv_fixed_width_cols) > 1 ?
\ '\%' . b:csv_fixed_width_cols[1] . 'c' : \ '\%' . b:csv_fixed_width_cols[1] . 'v' :
\ '') \ '')
endif endif
return pat . (a:zs_flag ? '\zs' : '') return pat . (a:zs_flag ? '\zs' : '')
@@ -1078,12 +1078,12 @@ fu! <sid>Sort(bang, line1, line2, colnr) range "{{{3
if !exists("b:csv_fixed_width_cols") if !exists("b:csv_fixed_width_cols")
let pat= '^' . <SID>GetColPat(col-1,1) . b:col let pat= '^' . <SID>GetColPat(col-1,1) . b:col
else else
let pat= '^' . <SID>GetColPat(col,0) let pat= <SID>GetColPat(col,0)
endif endif
else else
let pat= '^' . <SID>GetColPat(col,0) let pat= '^' . <SID>GetColPat(col,0)
endif endif
exe a:line1 ',' a:line2 . "sort" . (a:bang ? '!' : '') . exe a:line1. ','. a:line2. "sort". (a:bang ? '!' : '') .
\' r ' . (numeric ? 'n' : '') . ' /' . pat . '/' \' r ' . (numeric ? 'n' : '') . ' /' . pat . '/'
call winrestview(wsv) call winrestview(wsv)
endfun endfun
@@ -1488,12 +1488,11 @@ fu! <sid>PrepareFolding(add, match) "{{{3
" for val in sort(values(b:csv_filter), '<sid>SortFilter') " for val in sort(values(b:csv_filter), '<sid>SortFilter')
" let @/ .= val.pat . (val.id == s:filter_count ? '' : '\&') " let @/ .= val.pat . (val.id == s:filter_count ? '' : '\&')
" endfor " endfor
let sid = <sid>GetSID()
" Fold settings: " Fold settings:
call <sid>LocalSettings('fold') call <sid>LocalSettings('fold')
" Don't put spaces between the arguments! " Don't put spaces between the arguments!
exe 'setl foldexpr=<snr>' . sid . '_FoldValue(v:lnum,b:csv_filter)' exe 'setl foldexpr=<snr>' . s:SID . '_FoldValue(v:lnum,b:csv_filter)'
" Move folded area to the bottom, so there is only on consecutive " Move folded area to the bottom, so there is only on consecutive
" non-folded area " non-folded area
@@ -1541,8 +1540,7 @@ fu! <sid>OutputFilters(bang) "{{{3
call <sid>Warn("No filters defined currently!") call <sid>Warn("No filters defined currently!")
return return
else else
let sid = <sid>GetSID() exe 'setl foldexpr=<snr>' . s:SID . '_FoldValue(v:lnum,b:csv_filter)'
exe 'setl foldexpr=<snr>' . sid . '_FoldValue(v:lnum,b:csv_filter)'
endif endif
endif endif
endfu endfu
@@ -1588,14 +1586,11 @@ fu! <sid>DisableFolding() "{{{3
endif endif
endfu endfu
fu! <sid>GetSID() "{{{3 fu! <sid>DetermineSID()
if v:version > 703 || v:version == 703 && has("patch032") let s:SID = matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_DetermineSID$')
return maparg('W', "", "", 1).sid
else
"return substitute(maparg('W'), '\(<SNR>\d\+\)_', '\1', '')
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_GetSID$')
endif
endfu endfu
call s:DetermineSID()
delf s:DetermineSID
fu! <sid>NumberFormat() "{{{3 fu! <sid>NumberFormat() "{{{3
let s:nr_format = [',', '.'] let s:nr_format = [',', '.']

View File

@@ -21,12 +21,13 @@ let b:undo_ftplugin = "setl fo< com< cms< ofu<"
let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??') let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??')
if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps") if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps")
nnoremap <silent><buffer> [<C-D> :<C-U>exe <SID>jump('edit',v:count)<CR> cnoremap <SID>foldopen <Bar>if &foldopen =~# 'tag'<Bar>exe 'norm! zv'<Bar>endif
nnoremap <silent><buffer> ]<C-D> :<C-U>exe <SID>jump('edit',v:count)<CR> nnoremap <silent> <script> <buffer> [<C-D> :<C-U>exe <SID>jump('edit',v:count)<SID>foldopen<CR>
nnoremap <silent><buffer> <C-W>d :<C-U>exe <SID>jump('split',v:count)<CR> nnoremap <silent> <script> <buffer> ]<C-D> :<C-U>exe <SID>jump('edit',v:count)<SID>foldopen<CR>
nnoremap <silent><buffer> <C-W><C-D> :<C-U>exe <SID>jump('split',v:count)<CR> nnoremap <silent> <script> <buffer> <C-W>d :<C-U>exe <SID>jump('split',v:count)<SID>foldopen<CR>
nnoremap <silent><buffer> [d :<C-U>exe <SID>jump('pedit',v:count)<CR> nnoremap <silent> <script> <buffer> <C-W><C-D> :<C-U>exe <SID>jump('split',v:count)<SID>foldopen<CR>
nnoremap <silent><buffer> ]d :<C-U>exe <SID>jump('pedit',v:count)<CR> nnoremap <silent> <script> <buffer> [d :<C-U>exe <SID>jump('pedit',v:count)<CR>
nnoremap <silent> <script> <buffer> ]d :<C-U>exe <SID>jump('pedit',v:count)<CR>
let b:undo_ftplugin .= let b:undo_ftplugin .=
\ "|sil! nunmap <buffer> [<C-D>" . \ "|sil! nunmap <buffer> [<C-D>" .
\ "|sil! nunmap <buffer> ]<C-D>" . \ "|sil! nunmap <buffer> ]<C-D>" .

91
ftplugin/eelixir.vim Normal file
View File

@@ -0,0 +1,91 @@
" Vim filetype plugin
" Language: Embedded Elixir
" URL: https://github.com/elixir-lang/vim-elixir
if exists("b:did_ftplugin")
finish
endif
let s:save_cpo = &cpo
set cpo-=C
let s:undo_ftplugin = ""
let s:browsefilter = "All Files (*.*)\t*.*\n"
let s:match_words = ""
if !exists("g:eelixir_default_subtype")
let g:eelixir_default_subtype = "html"
endif
if !exists("b:eelixir_subtype")
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
let b:eelixir_subtype = matchstr(s:lines,'eelixir_subtype=\zs\w\+')
if b:eelixir_subtype == ''
let b:eelixir_subtype = matchstr(&filetype,'^eex\.\zs\w\+')
endif
if b:eelixir_subtype == ''
let b:eelixir_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.eex\|\.eelixir\)\+$','',''),'\.\zs\w\+$')
endif
if b:eelixir_subtype == 'ex'
let b:eelixir_subtype = 'elixir'
elseif b:eelixir_subtype == 'exs'
let b:eelixir_subtype = 'elixir'
elseif b:eelixir_subtype == 'yml'
let b:eelixir_subtype = 'yaml'
elseif b:eelixir_subtype == 'js'
let b:eelixir_subtype = 'javascript'
elseif b:eelixir_subtype == 'txt'
" Conventional; not a real file type
let b:eelixir_subtype = 'text'
elseif b:eelixir_subtype == ''
let b:eelixir_subtype = g:eelixir_default_subtype
endif
endif
if exists("b:eelixir_subtype") && b:eelixir_subtype != ''
exe "runtime! ftplugin/".b:eelixir_subtype.".vim ftplugin/".b:eelixir_subtype."_*.vim ftplugin/".b:eelixir_subtype."/*.vim"
else
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
endif
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/elixir.vim ftplugin/elixir_*.vim ftplugin/elixir/*.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
" Load the combined list of match_words for matchit.vim
if exists("loaded_matchit")
let b:match_words = s:match_words
endif
setlocal comments=:<%#
setlocal commentstring=<%#\ %s\ %>
let b:undo_ftplugin = "setl cms< "
\ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
let &cpo = s:save_cpo

17
ftplugin/emblem.vim Normal file
View File

@@ -0,0 +1,17 @@
" Language: emblem
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
" URL: http://github.com/heartsentwined/vim-emblem
" Version: 1.2.0
" Last Change: 2013 Apr 22
" License: GPL-3.0
setlocal tabstop=2
setlocal softtabstop=2
setlocal shiftwidth=2
setlocal smarttab
setlocal expandtab
setlocal smartindent
setlocal formatoptions=q
setlocal comments=:/
setlocal commentstring=/\ %s

View File

@@ -11,15 +11,8 @@ endif
runtime! ftplugin/git.vim runtime! ftplugin/git.vim
let b:did_ftplugin = 1 let b:did_ftplugin = 1
setlocal nomodeline tabstop=8 formatoptions-=croq formatoptions+=tl setlocal nomodeline tabstop=8 formatoptions-=croq formatoptions+=tl textwidth=72
let b:undo_ftplugin = 'setl modeline< tabstop< formatoptions< tw<'
let b:undo_ftplugin = 'setl modeline< tabstop< formatoptions<'
if &textwidth == 0
" make sure that log messages play nice with git-log on standard terminals
setlocal textwidth=72
let b:undo_ftplugin .= "|setl tw<"
endif
if exists("g:no_gitcommit_commands") || v:version < 700 if exists("g:no_gitcommit_commands") || v:version < 700
finish finish

View File

@@ -1,19 +0,0 @@
" Copyright 2013 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" go.vim: Vim filetype plugin for Go.
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal formatoptions-=t
setlocal comments=s1:/*,mb:*,ex:*/,://
setlocal commentstring=//\ %s
let b:undo_ftplugin = "setl fo< com< cms<"
" vim:ts=4:sw=4:et

View File

@@ -1,69 +0,0 @@
" Copyright 2011 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" fmt.vim: Vim command to format Go files with gofmt.
"
" This filetype plugin add a new commands for go buffers:
"
" :Fmt
"
" Filter the current Go buffer through gofmt.
" It tries to preserve cursor position and avoids
" replacing the buffer with stderr output.
"
" Options:
"
" g:go_fmt_commands [default=1]
"
" Flag to indicate whether to enable the commands listed above.
"
" g:gofmt_command [default="gofmt"]
"
" Flag naming the gofmt executable to use.
"
if exists("b:did_ftplugin_go_fmt")
finish
endif
if !exists("g:go_fmt_commands")
let g:go_fmt_commands = 1
endif
if !exists("g:gofmt_command")
let g:gofmt_command = "gofmt"
endif
if g:go_fmt_commands
command! -buffer Fmt call s:GoFormat()
endif
function! s:GoFormat()
let view = winsaveview()
silent execute "%!" . g:gofmt_command
if v:shell_error
let errors = []
for line in getline(1, line('$'))
let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\)\s*\(.*\)')
if !empty(tokens)
call add(errors, {"filename": @%,
\"lnum": tokens[2],
\"col": tokens[3],
\"text": tokens[4]})
endif
endfor
if empty(errors)
% | " Couldn't detect gofmt error format, output errors
endif
undo
if !empty(errors)
call setqflist(errors, 'r')
endif
echohl Error | echomsg "Gofmt returned error" | echohl None
endif
call winrestview(view)
endfunction
let b:did_ftplugin_go_fmt = 1
" vim:ts=4:sw=4:et

View File

@@ -1,250 +0,0 @@
" Copyright 2011 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" import.vim: Vim commands to import/drop Go packages.
"
" This filetype plugin adds three new commands for go buffers:
"
" :Import {path}
"
" Import ensures that the provided package {path} is imported
" in the current Go buffer, using proper style and ordering.
" If {path} is already being imported, an error will be
" displayed and the buffer will be untouched.
"
" :ImportAs {localname} {path}
"
" Same as Import, but uses a custom local name for the package.
"
" :Drop {path}
"
" Remove the import line for the provided package {path}, if
" present in the current Go buffer. If {path} is not being
" imported, an error will be displayed and the buffer will be
" untouched.
"
" If you would like to add shortcuts, you can do so by doing the following:
"
" Import fmt
" au Filetype go nnoremap <buffer> <LocalLeader>f :Import fmt<CR>
"
" Drop fmt
" au Filetype go nnoremap <buffer> <LocalLeader>F :Drop fmt<CR>
"
" Import the word under your cursor
" au Filetype go nnoremap <buffer> <LocalLeader>k
" \ :exe 'Import ' . expand('<cword>')<CR>
"
" The backslash '\' is the default maplocalleader, so it is possible that
" your vim is set to use a different character (:help maplocalleader).
"
" Options:
"
" g:go_import_commands [default=1]
"
" Flag to indicate whether to enable the commands listed above.
"
if exists("b:did_ftplugin_go_import")
finish
endif
if !exists("g:go_import_commands")
let g:go_import_commands = 1
endif
if g:go_import_commands
command! -buffer -nargs=? -complete=customlist,go#complete#Package Drop call s:SwitchImport(0, '', <f-args>)
command! -buffer -nargs=1 -complete=customlist,go#complete#Package Import call s:SwitchImport(1, '', <f-args>)
command! -buffer -nargs=* -complete=customlist,go#complete#Package ImportAs call s:SwitchImport(1, <f-args>)
endif
function! s:SwitchImport(enabled, localname, path)
let view = winsaveview()
let path = a:path
" Quotes are not necessary, so remove them if provided.
if path[0] == '"'
let path = strpart(path, 1)
endif
if path[len(path)-1] == '"'
let path = strpart(path, 0, len(path) - 1)
endif
if path == ''
call s:Error('Import path not provided')
return
endif
" Extract any site prefix (e.g. github.com/).
" If other imports with the same prefix are grouped separately,
" we will add this new import with them.
" Only up to and including the first slash is used.
let siteprefix = matchstr(path, "^[^/]*/")
let qpath = '"' . path . '"'
if a:localname != ''
let qlocalpath = a:localname . ' ' . qpath
else
let qlocalpath = qpath
endif
let indentstr = 0
let packageline = -1 " Position of package name statement
let appendline = -1 " Position to introduce new import
let deleteline = -1 " Position of line with existing import
let linesdelta = 0 " Lines added/removed
" Find proper place to add/remove import.
let line = 0
while line <= line('$')
let linestr = getline(line)
if linestr =~# '^package\s'
let packageline = line
let appendline = line
elseif linestr =~# '^import\s\+('
let appendstr = qlocalpath
let indentstr = 1
let appendline = line
let firstblank = -1
let lastprefix = ""
while line <= line("$")
let line = line + 1
let linestr = getline(line)
let m = matchlist(getline(line), '^\()\|\(\s\+\)\(\S*\s*\)"\(.\+\)"\)')
if empty(m)
if siteprefix == "" && a:enabled
" must be in the first group
break
endif
" record this position, but keep looking
if firstblank < 0
let firstblank = line
endif
continue
endif
if m[1] == ')'
" if there's no match, add it to the first group
if appendline < 0 && firstblank >= 0
let appendline = firstblank
endif
break
endif
let lastprefix = matchstr(m[4], "^[^/]*/")
if a:localname != '' && m[3] != ''
let qlocalpath = printf('%-' . (len(m[3])-1) . 's %s', a:localname, qpath)
endif
let appendstr = m[2] . qlocalpath
let indentstr = 0
if m[4] == path
let appendline = -1
let deleteline = line
break
elseif m[4] < path
" don't set candidate position if we have a site prefix,
" we've passed a blank line, and this doesn't share the same
" site prefix.
if siteprefix == "" || firstblank < 0 || match(m[4], "^" . siteprefix) >= 0
let appendline = line
endif
elseif siteprefix != "" && match(m[4], "^" . siteprefix) >= 0
" first entry of site group
let appendline = line - 1
break
endif
endwhile
break
elseif linestr =~# '^import '
if appendline == packageline
let appendstr = 'import ' . qlocalpath
let appendline = line - 1
endif
let m = matchlist(linestr, '^import\(\s\+\)\(\S*\s*\)"\(.\+\)"')
if !empty(m)
if m[3] == path
let appendline = -1
let deleteline = line
break
endif
if m[3] < path
let appendline = line
endif
if a:localname != '' && m[2] != ''
let qlocalpath = printf("%s %" . len(m[2])-1 . "s", a:localname, qpath)
endif
let appendstr = 'import' . m[1] . qlocalpath
endif
elseif linestr =~# '^\(var\|const\|type\|func\)\>'
break
endif
let line = line + 1
endwhile
" Append or remove the package import, as requested.
if a:enabled
if deleteline != -1
call s:Error(qpath . ' already being imported')
elseif appendline == -1
call s:Error('No package line found')
else
if appendline == packageline
call append(appendline + 0, '')
call append(appendline + 1, 'import (')
call append(appendline + 2, ')')
let appendline += 2
let linesdelta += 3
let appendstr = qlocalpath
let indentstr = 1
endif
call append(appendline, appendstr)
execute appendline + 1
if indentstr
execute 'normal >>'
endif
let linesdelta += 1
endif
else
if deleteline == -1
call s:Error(qpath . ' not being imported')
else
execute deleteline . 'd'
let linesdelta -= 1
if getline(deleteline-1) =~# '^import\s\+(' && getline(deleteline) =~# '^)'
" Delete empty import block
let deleteline -= 1
execute deleteline . "d"
execute deleteline . "d"
let linesdelta -= 2
endif
if getline(deleteline) == '' && getline(deleteline - 1) == ''
" Delete spacing for removed line too.
execute deleteline . "d"
let linesdelta -= 1
endif
endif
endif
" Adjust view for any changes.
let view.lnum += linesdelta
let view.topline += linesdelta
if view.topline < 0
let view.topline = 0
endif
" Put buffer back where it was.
call winrestview(view)
endfunction
function! s:Error(s)
echohl Error | echo a:s | echohl None
endfunction
let b:did_ftplugin_go_import = 1
" vim:ts=4:sw=4:et

View File

@@ -25,8 +25,20 @@ setlocal efm+=%E!\ %m
" More info for undefined control sequences " More info for undefined control sequences
setlocal efm+=%Z<argument>\ %m setlocal efm+=%Z<argument>\ %m
" More info for some errors
setlocal efm+=%Cl.%l\ %m
" Show or ignore warnings " Show or ignore warnings
if g:LatexBox_show_warnings if g:LatexBox_show_warnings
" Parse biblatex warnings
setlocal efm+=%-C(biblatex)%.%#in\ t%.%#
setlocal efm+=%-C(biblatex)%.%#Please\ v%.%#
setlocal efm+=%-C(biblatex)%.%#LaTeX\ a%.%#
setlocal efm+=%-Z(biblatex)%m
" Parse hyperref warnings
setlocal efm+=%-C(hyperref)%.%#on\ input\ line\ %l.
for w in g:LatexBox_ignore_warnings for w in g:LatexBox_ignore_warnings
let warning = escape(substitute(w, '[\,]', '%\\\\&', 'g'), ' ') let warning = escape(substitute(w, '[\,]', '%\\\\&', 'g'), ' ')
exe 'setlocal efm+=%-G%.%#'. warning .'%.%#' exe 'setlocal efm+=%-G%.%#'. warning .'%.%#'
@@ -44,6 +56,7 @@ endif
" Push file to file stack " Push file to file stack
setlocal efm+=%+P**%f setlocal efm+=%+P**%f
setlocal efm+=%+P**\"%f\"
" Ignore unmatched lines " Ignore unmatched lines
setlocal efm+=%-G%.%# setlocal efm+=%-G%.%#
@@ -114,8 +127,8 @@ function! LatexBox_GetMainTexFile()
endif endif
" 5. borrow the Vim-Latex-Suite method of finding it " 5. borrow the Vim-Latex-Suite method of finding it
if Tex_GetMainFileName() != expand('%:p') if LatexBox_GetMainFileName() != expand('%:p')
let b:main_tex_file = Tex_GetMainFileName() let b:main_tex_file = LatexBox_GetMainFileName()
return b:main_tex_file return b:main_tex_file
endif endif
@@ -127,6 +140,8 @@ endfunction
function! s:PromptForMainFile() function! s:PromptForMainFile()
let saved_dir = getcwd() let saved_dir = getcwd()
execute 'cd ' . fnameescape(expand('%:p:h')) execute 'cd ' . fnameescape(expand('%:p:h'))
" Prompt for file
let l:file = '' let l:file = ''
while !filereadable(l:file) while !filereadable(l:file)
let l:file = input('main LaTeX file: ', '', 'file') let l:file = input('main LaTeX file: ', '', 'file')
@@ -135,6 +150,16 @@ function! s:PromptForMainFile()
endif endif
endwhile endwhile
let l:file = fnamemodify(l:file, ':p') let l:file = fnamemodify(l:file, ':p')
" Make persistent
let l:persistent = ''
while l:persistent !~ '\v^(y|n)'
let l:persistent = input('make choice persistent? (y, n) ')
if l:persistent == 'y'
call writefile([], l:file . '.latexmain')
endif
endwhile
execute 'cd ' . fnameescape(saved_dir) execute 'cd ' . fnameescape(saved_dir)
return l:file return l:file
endfunction endfunction
@@ -212,15 +237,16 @@ if !exists('g:LatexBox_viewer')
endif endif
endif endif
function! LatexBox_View() function! LatexBox_View(...)
let lvargs = join(a:000, ' ')
let outfile = LatexBox_GetOutputFile() let outfile = LatexBox_GetOutputFile()
if !filereadable(outfile) if !filereadable(outfile)
echomsg fnamemodify(outfile, ':.') . ' is not readable' echomsg fnamemodify(outfile, ':.') . ' is not readable'
return return
endif endif
let cmd = g:LatexBox_viewer . ' ' . shellescape(outfile) let cmd = g:LatexBox_viewer . ' ' . lvargs . ' ' . shellescape(outfile)
if has('win32') if has('win32')
let cmd = '!start /b' . cmd . ' >nul' let cmd = '!start /b ' . cmd . ' >nul'
else else
let cmd = '!' . cmd . ' &>/dev/null &' let cmd = '!' . cmd . ' &>/dev/null &'
endif endif
@@ -230,7 +256,7 @@ function! LatexBox_View()
endif endif
endfunction endfunction
command! LatexView call LatexBox_View() command! -nargs=* LatexView call LatexBox_View('<args>')
" }}} " }}}
" In Comment {{{ " In Comment {{{

View File

@@ -328,6 +328,7 @@ function! LatexBox_BibComplete(regexp)
let type = printf('%-' . s:type_length . 's', type) let type = printf('%-' . s:type_length . 's', type)
let auth = m['author'] == '' ? '' : m['author'][:20] . ' ' let auth = m['author'] == '' ? '' : m['author'][:20] . ' '
let auth = substitute(auth, '\~', ' ', 'g') let auth = substitute(auth, '\~', ' ', 'g')
let auth = substitute(auth, ',.*\ze', ' et al. ', '')
let year = m['year'] == '' ? '' : '(' . m['year'] . ')' let year = m['year'] == '' ? '' : '(' . m['year'] . ')'
let w = { 'word': m['key'], let w = { 'word': m['key'],
\ 'abbr': type . auth . year, \ 'abbr': type . auth . year,
@@ -365,7 +366,7 @@ function! s:ExtractLabels()
let curname = strpart( getline( lblline ), lblbegin, nameend - lblbegin - 1 ) let curname = strpart( getline( lblline ), lblbegin, nameend - lblbegin - 1 )
" Ignore cref entries (because they are duplicates) " Ignore cref entries (because they are duplicates)
if curname =~ "\@cref\|cref\@" if curname =~# "@cref$"
continue continue
endif endif

View File

@@ -1,4 +1,4 @@
" Tex_GetMainFileName: gets the name of the main file being compiled. {{{ " LatexBox_GetMainFileName: gets the name of the main file being compiled. {{{
" Description: returns the full path name of the main file. " Description: returns the full path name of the main file.
" This function checks for the existence of a .latexmain file " This function checks for the existence of a .latexmain file
" which might point to the location of a "main" latex file. " which might point to the location of a "main" latex file.
@@ -13,7 +13,8 @@
" NOTE: From version 1.6 onwards, this function always trims " NOTE: From version 1.6 onwards, this function always trims
" away the .latexmain part of the file name before applying the " away the .latexmain part of the file name before applying the
" modifier argument. " modifier argument.
function! Tex_GetMainFileName(...) " NOTE: This function is copied from the Latex-Suite project!
function! LatexBox_GetMainFileName(...)
if a:0 > 0 if a:0 > 0
let modifier = a:1 let modifier = a:1
else else
@@ -51,10 +52,7 @@ function! Tex_GetMainFileName(...)
let lheadfile = expand('%'.modifier) let lheadfile = expand('%'.modifier)
endif endif
if lheadfile !~ '\.tex$' exe 'cd '.s:origdir
let lheadfile .= '.tex'
endif
exe 'cd '.s:origdir
" NOTE: The caller of this function needs to escape the file name with " NOTE: The caller of this function needs to escape the file name with
" fnameescape() . The reason its not done here is that escaping is not " fnameescape() . The reason its not done here is that escaping is not

View File

@@ -1,29 +1,22 @@
" Folding support for LaTeX " Folding support for LaTeX
" "
" Options " Options
" g:LatexBox_Folding - Turn on/off folding " g:LatexBox_Folding - Turn on/off folding
" g:LatexBox_fold_preamble - Turn on/off folding of preamble " g:LatexBox_fold_text - Turn on/off LatexBox fold text function
" g:LatexBox_fold_parts - Define parts (eq. appendix, frontmatter) to fold " g:LatexBox_fold_preamble - Turn on/off folding of preamble
" g:LatexBox_fold_sections - Define section levels to fold " g:LatexBox_fold_parts - Define parts (eq. appendix, frontmatter) to fold
" g:LatexBox_fold_envs - Turn on/off folding of environments " g:LatexBox_fold_sections - Define section levels to fold
" g:LatexBox_fold_envs - Turn on/off folding of environments
" g:LatexBox_fold_toc - Turn on/off folding of TOC
" g:LatexBox_fold_toc_levels - Set max TOC fold level
" "
" {{{1 Initialize options to default values.
" {{{1 Set options if !exists('g:LatexBox_Folding')
if exists('g:LatexBox_Folding') && g:LatexBox_Folding == 1 let g:LatexBox_Folding=0
setl foldmethod=expr endif
setl foldexpr=LatexBox_FoldLevel(v:lnum) if !exists('g:LatexBox_fold_text')
setl foldtext=LatexBox_FoldText() let g:LatexBox_fold_text=1
"
" The foldexpr function returns "=" for most lines, which means it can become
" slow for large files. The following is a hack that is based on this reply to
" a discussion on the Vim Developer list:
" http://permalink.gmane.org/gmane.editors.vim.devel/14100
"
augroup FastFold
autocmd!
autocmd InsertEnter *.tex setlocal foldmethod=manual
autocmd InsertLeave *.tex setlocal foldmethod=expr
augroup end
endif endif
if !exists('g:LatexBox_fold_preamble') if !exists('g:LatexBox_fold_preamble')
let g:LatexBox_fold_preamble=1 let g:LatexBox_fold_preamble=1
@@ -57,7 +50,45 @@ endif
if !exists('g:LatexBox_fold_toc_levels') if !exists('g:LatexBox_fold_toc_levels')
let g:LatexBox_fold_toc_levels=1 let g:LatexBox_fold_toc_levels=1
endif endif
if !exists('g:LatexBox_fold_automatic')
let g:LatexBox_fold_automatic=1
endif
" }}}1
if g:LatexBox_Folding == 0
finish
endif
" {{{1 Set folding options for vim
setl foldexpr=LatexBox_FoldLevel(v:lnum)
if g:LatexBox_fold_text == 1
setl foldtext=LatexBox_FoldText()
endif
if g:LatexBox_fold_automatic == 1
setl foldmethod=expr
"
" The foldexpr function returns "=" for most lines, which means it can become
" slow for large files. The following is a hack that is based on this reply to
" a discussion on the Vim Developer list:
" http://permalink.gmane.org/gmane.editors.vim.devel/14100
"
augroup FastFold
autocmd!
autocmd InsertEnter *.tex setlocal foldmethod=manual
autocmd InsertLeave *.tex setlocal foldmethod=expr
augroup end
else
setl foldmethod=manual
endif
function! LatexBox_FoldOnDemand()
setl foldmethod=expr
normal! zx
setl foldmethod=manual
endfunction
command! LatexFold call LatexBox_FoldOnDemand()
" {{{1 LatexBox_FoldLevel help functions " {{{1 LatexBox_FoldLevel help functions
@@ -137,9 +168,9 @@ function! LatexBox_FoldLevel(lnum)
" Fold preamble " Fold preamble
if g:LatexBox_fold_preamble == 1 if g:LatexBox_fold_preamble == 1
if line =~# '\s*\\documentclass' if line =~# s:notcomment . s:notbslash . '\s*\\documentclass'
return ">1" return ">1"
elseif line =~# '^\s*\\begin\s*{\s*document\s*}' elseif line =~# s:notcomment . s:notbslash . '\s*\\begin\s*{\s*document\s*}'
return "0" return "0"
endif endif
endif endif
@@ -247,24 +278,13 @@ function! s:CaptionFrame(line)
endif endif
endfunction endfunction
" {{{1 LatexBox_FoldText function! LatexBox_FoldText_title()
function! LatexBox_FoldText()
" Initialize
let line = getline(v:foldstart) let line = getline(v:foldstart)
let nlines = v:foldend - v:foldstart + 1
let level = ''
let title = 'Not defined' let title = 'Not defined'
" Fold level
let level = strpart(repeat('-', v:foldlevel-1) . '*',0,3)
if v:foldlevel > 3
let level = strpart(level, 1) . v:foldlevel
endif
let level = printf('%-3s', level)
" Preamble " Preamble
if line =~ '\s*\\documentclass' if line =~ '\s*\\documentclass'
let title = "Preamble" return "Preamble"
endif endif
" Parts, sections and fakesections " Parts, sections and fakesections
@@ -280,11 +300,11 @@ function! LatexBox_FoldText()
elseif line =~ '\\appendix' elseif line =~ '\\appendix'
let title = "Appendix" let title = "Appendix"
elseif line =~ secpat1 . '.*}' elseif line =~ secpat1 . '.*}'
let title = matchstr(line, secpat1 . '\zs.*\ze}') let title = matchstr(line, secpat1 . '\zs.\{-}\ze}')
elseif line =~ secpat1 elseif line =~ secpat1
let title = matchstr(line, secpat1 . '\zs.*') let title = matchstr(line, secpat1 . '\zs.*')
elseif line =~ secpat2 . '.*\]' elseif line =~ secpat2 . '.*\]'
let title = matchstr(line, secpat2 . '\zs.*\ze\]') let title = matchstr(line, secpat2 . '\zs.\{-}\ze\]')
elseif line =~ secpat2 elseif line =~ secpat2
let title = matchstr(line, secpat2 . '\zs.*') let title = matchstr(line, secpat2 . '\zs.*')
elseif line =~ 'Fake' . sections . ':' elseif line =~ 'Fake' . sections . ':'
@@ -330,7 +350,22 @@ function! LatexBox_FoldText()
endif endif
endif endif
let title = strpart(title, 0, 68) return title
endfunction
" {{{1 LatexBox_FoldText
function! LatexBox_FoldText()
let nlines = v:foldend - v:foldstart + 1
let title = strpart(LatexBox_FoldText_title(), 0, 68)
let level = ''
" Fold level
let level = strpart(repeat('-', v:foldlevel-1) . '*',0,3)
if v:foldlevel > 3
let level = strpart(level, 1) . v:foldlevel
endif
let level = printf('%-3s', level)
return printf('%-3s %-68s #%5d', level, title, nlines) return printf('%-3s %-68s #%5d', level, title, nlines)
endfunction endfunction

View File

@@ -413,23 +413,38 @@ function! LatexBox_LatexErrors(status, ...)
if a:status < 0 if a:status < 0
botright copen botright copen
else else
" Write status message to screen
redraw
if a:status > 0 || len(getqflist())>1
echomsg 'Compiling to ' . g:LatexBox_output_type . ' ... failed!'
else
echomsg 'Compiling to ' . g:LatexBox_output_type . ' ... success!'
endif
" Only open window when an error/warning is detected " Only open window when an error/warning is detected
if g:LatexBox_quickfix if g:LatexBox_quickfix >= 3
\ ? s:log_contains_error(log)
\ : g:LatexBox_quickfix > 0
belowright cw belowright cw
if g:LatexBox_quickfix==2 if g:LatexBox_quickfix == 2 || g:LatexBox_quickfix == 4
wincmd p wincmd p
endif endif
endif endif
redraw
" Write status message to screen
if a:status > 0 || len(getqflist())>1
if s:log_contains_error(log)
let l:status_msg = ' ... failed!'
else
let l:status_msg = ' ... there were warnings!'
endif
else
let l:status_msg = ' ... success!'
endif
echomsg 'Compiling to ' . g:LatexBox_output_type . l:status_msg
endif endif
endfunction endfunction
function! s:log_contains_error(file)
let lines = readfile(a:file)
let lines = filter(lines, 'v:val =~ ''^.*:\d\+: ''')
let lines = uniq(map(lines, 'matchstr(v:val, ''^.*\ze:\d\+:'')'))
let lines = filter(lines, 'filereadable(fnameescape(v:val))')
return len(lines) > 0
endfunction
" }}} " }}}
" LatexmkStatus {{{ " LatexmkStatus {{{

View File

@@ -27,6 +27,12 @@ map <silent> <buffer> <LocalLeader>lt :LatexTOC<CR>
map <silent> <buffer> <LocalLeader>lj :LatexLabels<CR> map <silent> <buffer> <LocalLeader>lj :LatexLabels<CR>
" }}} " }}}
" Folding {{{
if g:LatexBox_Folding == 1
map <buffer> <LocalLeader>lf :LatexFold<CR>
endif
" }}}
" Jump to match {{{ " Jump to match {{{
if !exists('g:LatexBox_loaded_matchparen') if !exists('g:LatexBox_loaded_matchparen')
nmap <buffer> % <Plug>LatexBox_JumpToMatch nmap <buffer> % <Plug>LatexBox_JumpToMatch

View File

@@ -345,24 +345,22 @@ function! s:ReadTOC(auxfile, texfile, ...)
endif endif
" parse section number " parse section number
let secnum = '' let secnum = ''
if len(tree[1]) > 3 && empty(tree[1][1]) let tree = tree[1]
call remove(tree[1], 1) if len(tree) > 3 && empty(tree[1])
call remove(tree, 1)
endif endif
if len(tree[1]) > 1 && tree[1][0] =~ '\(numberline\|tocsection\)' if len(tree) > 1 && tree[0] =~ '^\\\(numberline\|tocsection\)'
if !empty(tree[1][1]) let secnum = LatexBox_TreeToTex(tree[1])
let secnum = LatexBox_TreeToTex(tree[1][1]) let secnum = substitute(secnum, '\\\S\+\s', '', 'g')
let secnum = substitute(secnum, '\\\S\+\s', '', 'g') let secnum = substitute(secnum, '\\\S\+{\(.\{-}\)}', '\1', 'g')
let secnum = substitute(secnum, '\\\S\+{\(.\{-}\)}', '\1', 'g') let secnum = substitute(secnum, '^{\+\|}\+$', '', 'g')
let secnum = substitute(secnum, '^{\+\|}\+$', '', 'g') call remove(tree, 1)
endif
let tree = tree[1][2:]
else
let tree = tree[1]
endif endif
" parse section title " parse section title
let text = LatexBox_TreeToTex(tree) let text = LatexBox_TreeToTex(tree)
let text = substitute(text, '^{\+\|}\+$', '', 'g') let text = substitute(text, '^{\+\|}\+$', '', 'g')
let text = substitute(text, '\*', '', 'g') let text = substitute(text, '\m^\\\(no\)\?numberline\s*', '', '')
let text = substitute(text, '\*', '', 'g')
" add TOC entry " add TOC entry
call add(fileindices[texfile], len(toc)) call add(fileindices[texfile], len(toc))

View File

@@ -76,9 +76,14 @@ function! s:TOCActivate(close)
execute b:calling_win . 'wincmd w' execute b:calling_win . 'wincmd w'
let root = fnamemodify(entry['file'], ':h') . '/'
let files = [entry['file']] let files = [entry['file']]
for line in filter(readfile(entry['file']), 'v:val =~ ''\\input{''') for line in filter(readfile(entry['file']), 'v:val =~ ''\\input{''')
call add(files, matchstr(line, '{\zs.*\ze\(\.tex\)\?}') . '.tex') let file = matchstr(line, '{\zs.\{-}\ze\(\.tex\)\?}') . '.tex'
if file[0] != '/'
let file = root . file
endif
call add(files, file)
endfor endfor
" Find section in buffer (or inputted files) " Find section in buffer (or inputted files)

View File

@@ -11,7 +11,7 @@ runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s
setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+ setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:
if exists('b:undo_ftplugin') if exists('b:undo_ftplugin')
let b:undo_ftplugin .= "|setl cms< com< fo< flp<" let b:undo_ftplugin .= "|setl cms< com< fo< flp<"

View File

@@ -69,8 +69,8 @@ endif
function! s:query_path(root) function! s:query_path(root)
let code = "print $:.join %q{,}" let code = "print $:.join %q{,}"
if &shell =~# 'sh' && $PATH !~# '\s' if &shell =~# 'sh'
let prefix = 'env PATH='.$PATH.' ' let prefix = 'env PATH='.shellescape($PATH).' '
else else
let prefix = '' let prefix = ''
endif endif
@@ -190,15 +190,16 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
endif endif
if maparg("\<C-]>",'n') == '' if maparg("\<C-]>",'n') == ''
nnoremap <silent> <buffer> <C-]> :<C-U>exe v:count1."tag <C-R>=RubyCursorIdentifier()<CR>"<CR> cnoremap <buffer> <SID>foldopen <Bar>if &foldopen =~# 'tag'<Bar>exe 'norm! zv'<Bar>endif
nnoremap <silent> <buffer> g<C-]> :<C-U>exe "tjump <C-R>=RubyCursorIdentifier()<CR>"<CR> nnoremap <silent> <script> <buffer> <C-]> :<C-U>exe v:count1."tag <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
nnoremap <silent> <buffer> g] :<C-U>exe "tselect <C-R>=RubyCursorIdentifier()<CR>"<CR> nnoremap <silent> <script> <buffer> g<C-]> :<C-U>exe "tjump <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
nnoremap <silent> <buffer> <C-W>] :<C-U>exe v:count1."stag <C-R>=RubyCursorIdentifier()<CR>"<CR> nnoremap <silent> <script> <buffer> g] :<C-U>exe "tselect <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
nnoremap <silent> <buffer> <C-W><C-]> :<C-U>exe v:count1."stag <C-R>=RubyCursorIdentifier()<CR>"<CR> nnoremap <silent> <script> <buffer> <C-W>] :<C-U>exe v:count1."stag <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
nnoremap <silent> <buffer> <C-W>g<C-]> :<C-U>exe "stjump <C-R>=RubyCursorIdentifier()<CR>"<CR> nnoremap <silent> <script> <buffer> <C-W><C-]> :<C-U>exe v:count1."stag <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
nnoremap <silent> <buffer> <C-W>g] :<C-U>exe "stselect <C-R>=RubyCursorIdentifier()<CR>"<CR> nnoremap <silent> <script> <buffer> <C-W>g<C-]> :<C-U>exe "stjump <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
nnoremap <silent> <buffer> <C-W>} :<C-U>exe "ptag <C-R>=RubyCursorIdentifier()<CR>"<CR> nnoremap <silent> <script> <buffer> <C-W>g] :<C-U>exe "stselect <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
nnoremap <silent> <buffer> <C-W>g} :<C-U>exe "ptjump <C-R>=RubyCursorIdentifier()<CR>"<CR> nnoremap <silent> <script> <buffer> <C-W>} :<C-U>exe "ptag <C-R>=RubyCursorIdentifier()<CR>"<CR>
nnoremap <silent> <script> <buffer> <C-W>g} :<C-U>exe "ptjump <C-R>=RubyCursorIdentifier()<CR>"<CR>
let b:undo_ftplugin = b:undo_ftplugin let b:undo_ftplugin = b:undo_ftplugin
\."| sil! exe 'nunmap <buffer> <C-]>'| sil! exe 'nunmap <buffer> g<C-]>'| sil! exe 'nunmap <buffer> g]'" \."| sil! exe 'nunmap <buffer> <C-]>'| sil! exe 'nunmap <buffer> g<C-]>'| sil! exe 'nunmap <buffer> g]'"
\."| sil! exe 'nunmap <buffer> <C-W>]'| sil! exe 'nunmap <buffer> <C-W><C-]>'" \."| sil! exe 'nunmap <buffer> <C-W>]'| sil! exe 'nunmap <buffer> <C-W><C-]>'"

View File

@@ -1,13 +1,19 @@
" Vim syntax file
" Language: Rust " Language: Rust
" Description: Vim syntax file for Rust
" Maintainer: Chris Morgan <me@chrismorgan.info> " Maintainer: Chris Morgan <me@chrismorgan.info>
" Last Change: 2014 Feb 27 " Maintainer: Kevin Ballard <kevin@sb.org>
" Last Change: Jul 07, 2014
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
endif endif
let b:did_ftplugin = 1 let b:did_ftplugin = 1
let s:save_cpo = &cpo
set cpo&vim
" Variables {{{1
" The rust source code at present seems to typically omit a leader on /*! " The rust source code at present seems to typically omit a leader on /*!
" comments, so we'll use that as our default, but make it easy to switch. " comments, so we'll use that as our default, but make it easy to switch.
" This does not affect indentation at all (I tested it with and without " This does not affect indentation at all (I tested it with and without
@@ -25,6 +31,14 @@ setlocal formatoptions-=t formatoptions+=croqnl
" j was only added in 7.3.541, so stop complaints about its nonexistence " j was only added in 7.3.541, so stop complaints about its nonexistence
silent! setlocal formatoptions+=j silent! setlocal formatoptions+=j
" smartindent will be overridden by indentexpr if filetype indent is on, but
" otherwise it's better than nothing.
setlocal smartindent nocindent
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
setlocal textwidth=99
" This includeexpr isn't perfect, but it's a good start " This includeexpr isn't perfect, but it's a good start
setlocal includeexpr=substitute(v:fname,'::','/','g') setlocal includeexpr=substitute(v:fname,'::','/','g')
@@ -42,22 +56,83 @@ if exists("g:loaded_delimitMate")
let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate' let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
endif endif
if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
let b:rust_set_foldmethod=1
setlocal foldmethod=syntax
if g:rust_fold == 2
setlocal foldlevel<
else
setlocal foldlevel=99
endif
endif
if has('conceal') && exists('g:rust_conceal')
let b:rust_set_conceallevel=1
setlocal conceallevel=2
endif
" Motion Commands {{{1
" Bind motion commands to support hanging indents " Bind motion commands to support hanging indents
nnoremap <silent> <buffer> [[ :call <SID>Rust_Jump('n', 'Back')<CR> nnoremap <silent> <buffer> [[ :call rust#Jump('n', 'Back')<CR>
nnoremap <silent> <buffer> ]] :call <SID>Rust_Jump('n', 'Forward')<CR> nnoremap <silent> <buffer> ]] :call rust#Jump('n', 'Forward')<CR>
xnoremap <silent> <buffer> [[ :call <SID>Rust_Jump('v', 'Back')<CR> xnoremap <silent> <buffer> [[ :call rust#Jump('v', 'Back')<CR>
xnoremap <silent> <buffer> ]] :call <SID>Rust_Jump('v', 'Forward')<CR> xnoremap <silent> <buffer> ]] :call rust#Jump('v', 'Forward')<CR>
onoremap <silent> <buffer> [[ :call <SID>Rust_Jump('o', 'Back')<CR> onoremap <silent> <buffer> [[ :call rust#Jump('o', 'Back')<CR>
onoremap <silent> <buffer> ]] :call <SID>Rust_Jump('o', 'Forward')<CR> onoremap <silent> <buffer> ]] :call rust#Jump('o', 'Forward')<CR>
" Commands {{{1
" See |:RustRun| for docs
command! -nargs=* -complete=file -bang -bar -buffer RustRun call rust#Run(<bang>0, [<f-args>])
" See |:RustExpand| for docs
command! -nargs=* -complete=customlist,rust#CompleteExpand -bang -bar -buffer RustExpand call rust#Expand(<bang>0, [<f-args>])
" See |:RustEmitIr| for docs
command! -nargs=* -bar -buffer RustEmitIr call rust#Emit("ir", [<f-args>])
" See |:RustEmitAsm| for docs
command! -nargs=* -bar -buffer RustEmitAsm call rust#Emit("asm", [<f-args>])
" Mappings {{{1
" Bind ⌘R in MacVim to :RustRun
nnoremap <silent> <buffer> <D-r> :RustRun<CR>
" Bind ⌘⇧R in MacVim to :RustRun! pre-filled with the last args
nnoremap <buffer> <D-R> :RustRun! <C-r>=join(b:rust_last_rustc_args)<CR><C-\>erust#AppendCmdLine(' -- ' . join(b:rust_last_args))<CR>
if !exists("b:rust_last_rustc_args") || !exists("b:rust_last_args")
let b:rust_last_rustc_args = []
let b:rust_last_args = []
endif
" Cleanup {{{1
let b:undo_ftplugin = " let b:undo_ftplugin = "
\setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd< \ setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd<
\|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth<
\|if exists('b:rust_original_delimitMate_excluded_regions') \|if exists('b:rust_original_delimitMate_excluded_regions')
\|let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions \|let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions
\|unlet b:rust_original_delimitMate_excluded_regions \|unlet b:rust_original_delimitMate_excluded_regions
\|elseif exists('b:delimitMate_excluded_regions') \|else
\|unlet b:delimitMate_excluded_regions \|unlet! b:delimitMate_excluded_regions
\|endif \|endif
\|if exists('b:rust_set_foldmethod')
\|setlocal foldmethod< foldlevel<
\|unlet b:rust_set_foldmethod
\|endif
\|if exists('b:rust_set_conceallevel')
\|setlocal conceallevel<
\|unlet b:rust_set_conceallevel
\|endif
\|unlet! b:rust_last_rustc_args b:rust_last_args
\|delcommand RustRun
\|delcommand RustExpand
\|delcommand RustEmitIr
\|delcommand RustEmitAsm
\|nunmap <buffer> <D-r>
\|nunmap <buffer> <D-R>
\|nunmap <buffer> [[ \|nunmap <buffer> [[
\|nunmap <buffer> ]] \|nunmap <buffer> ]]
\|xunmap <buffer> [[ \|xunmap <buffer> [[
@@ -66,31 +141,9 @@ let b:undo_ftplugin = "
\|ounmap <buffer> ]] \|ounmap <buffer> ]]
\" \"
if exists('*<SID>Rust_Jump') | finish | endif " }}}1
function! <SID>Rust_Jump(mode, function) range let &cpo = s:save_cpo
let cnt = v:count1 unlet s:save_cpo
normal! m'
if a:mode ==# 'v'
norm! gv
endif
let foldenable = &foldenable
set nofoldenable
while cnt > 0
execute "call <SID>Rust_Jump_" . a:function . "()"
let cnt = cnt - 1
endwhile
let &foldenable = foldenable
endfunction
function! <SID>Rust_Jump_Back() " vim: set noet sw=4 ts=4:
call search('{', 'b')
keepjumps normal! w99[{
endfunction
function! <SID>Rust_Jump_Forward()
normal! j0
call search('{', 'b')
keepjumps normal! w99[{%
call search('{')
endfunction

View File

@@ -9,8 +9,9 @@ if exists("b:did_ftplugin")
endif endif
let b:did_ftplugin = 1 let b:did_ftplugin = 1
let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<" let b:undo_ftplugin = "setl com< cms< def< inc< inex< ofu< sua<"
setlocal comments=://
setlocal commentstring=//\ %s setlocal commentstring=//\ %s
setlocal define=^\\s*\\%(@mixin\\\|=\\) setlocal define=^\\s*\\%(@mixin\\\|=\\)
setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','') setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','')

View File

@@ -1,3 +1,4 @@
setlocal formatoptions+=ro
setlocal commentstring=//%s setlocal commentstring=//%s
let &l:include = '^\s*import' let &l:include = '^\s*import'
let &l:includeexpr = 'substitute(v:fname,"\\.","/","g")' let &l:includeexpr = 'substitute(v:fname,"\\.","/","g")'

View File

@@ -8,5 +8,6 @@ if exists("b:did_ftplugin")
endif endif
runtime! ftplugin/sass.vim runtime! ftplugin/sass.vim
setlocal comments=s1:/*,mb:*,ex:*/,://
" vim:set sw=2: " vim:set sw=2:

12
indent/blade.vim Normal file
View File

@@ -0,0 +1,12 @@
" Language: Blade (Laravel)
" Maintainer: xsbeats <jwalton512@gmail.com>
" URL: http://github.com/xsbeats/vim-blade
" License: WTFPL
if exists("b:did_indent")
finish
endif
runtime! indent/html.vim
let b:did_indent = 1

72
indent/eelixir.vim Normal file
View File

@@ -0,0 +1,72 @@
" Vim indent file
" Language: Embedded Elixir
" URL: https://github.com/elixir-lang/vim-elixir
if exists("b:did_indent")
finish
endif
runtime! indent/elixir.vim
unlet! b:did_indent
setlocal indentexpr=
if exists("b:eelixir_subtype")
exe "runtime! indent/".b:eelixir_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:eelixir_subtype_indentexpr = &l:indentexpr
let b:did_indent = 1
setlocal indentexpr=GetEelixirIndent()
setlocal indentkeys=o,O,*<Return>,<>>,{,},0),0],o,O,!^F,=end,=else,=elsif,=catch,=after,=rescue
" Only define the function once.
if exists("*GetEelixirIndent")
finish
endif
function! GetEelixirIndent(...)
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 inelixir = searchpair('<%','','%>','W')
call cursor(v:lnum,vcol)
if inelixir && getline(v:lnum) !~ '^<%\|^\s*%>'
let ind = GetElixirIndent()
else
exe "let ind = ".b:eelixir_subtype_indentexpr
endif
let lnum = prevnonblank(v:lnum-1)
let line = getline(lnum)
let cline = getline(v:lnum)
if cline =~# '^\s*<%\s*\%(end\|else\|elsif\|catch\|after\|rescue\)\>.*%>'
let ind = ind - &sw
elseif line =~# '\S\s*<%\s*end\s*%>'
let ind = ind - &sw
endif
if line =~# '<%[=%]\=\s*.*\<do\s*%>'
let ind = ind + &sw
elseif line =~# '<%\s*\%(else\|elsif\|catch\|after\|rescue\)\>.*%>'
let ind = ind + &sw
endif
if cline =~# '^\s*%>\s*$'
let ind = ind - &sw
endif
return ind
endfunction

6
indent/emblem.vim Normal file
View File

@@ -0,0 +1,6 @@
" Language: emblem
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
" URL: http://github.com/heartsentwined/vim-emblem
" Version: 1.2.0
" Last Change: 2013 Apr 22
" License: GPL-3.0

View File

@@ -24,18 +24,6 @@ if exists("*GoIndent")
finish finish
endif endif
" The shiftwidth() function is relatively new.
" Don't require it to exist.
if exists('*shiftwidth')
func s:sw()
return shiftwidth()
endfunc
else
func s:sw()
return &shiftwidth
endfunc
endif
function! GoIndent(lnum) function! GoIndent(lnum)
let prevlnum = prevnonblank(a:lnum-1) let prevlnum = prevnonblank(a:lnum-1)
if prevlnum == 0 if prevlnum == 0
@@ -52,17 +40,17 @@ function! GoIndent(lnum)
if prevl =~ '[({]\s*$' if prevl =~ '[({]\s*$'
" previous line opened a block " previous line opened a block
let ind += s:sw() let ind += &sw
endif endif
if prevl =~# '^\s*\(case .*\|default\):$' if prevl =~# '^\s*\(case .*\|default\):$'
" previous line is part of a switch statement " previous line is part of a switch statement
let ind += s:sw() let ind += &sw
endif endif
" TODO: handle if the previous line is a label. " TODO: handle if the previous line is a label.
if thisl =~ '^\s*[)}]' if thisl =~ '^\s*[)}]'
" this line closed a block " this line closed a block
let ind -= s:sw() let ind -= &sw
endif endif
" Colons are tricky. " Colons are tricky.
@@ -70,7 +58,7 @@ function! GoIndent(lnum)
" We ignore trying to deal with jump labels because (a) they're rare, and " We ignore trying to deal with jump labels because (a) they're rare, and
" (b) they're hard to disambiguate from a composite literal key. " (b) they're hard to disambiguate from a composite literal key.
if thisl =~# '^\s*\(case .*\|default\):$' if thisl =~# '^\s*\(case .*\|default\):$'
let ind -= s:sw() let ind -= &sw
endif endif
return ind return ind

View File

@@ -68,7 +68,7 @@ function! HIndent(lnum)
endif endif
endif endif
if prevl =~ '\Wof\s*$' || prevl =~ '\Wdo\s*$' if prevl =~ '\Wof\s*$' || prevl =~ '\Wm\=do\s*$'
return previ + &sw return previ + &sw
endif endif

View File

@@ -61,6 +61,8 @@ call add(s:tags, 'dfn')
call add(s:tags, 'dir') call add(s:tags, 'dir')
call add(s:tags, 'div') call add(s:tags, 'div')
call add(s:tags, 'dl') call add(s:tags, 'dl')
call add(s:tags, 'dt')
call add(s:tags, 'dd')
call add(s:tags, 'em') call add(s:tags, 'em')
call add(s:tags, 'fieldset') call add(s:tags, 'fieldset')
call add(s:tags, 'font') call add(s:tags, 'font')

View File

@@ -60,7 +60,7 @@ function! GetJadeIndent()
return increase return increase
elseif line =~? '^\v%('.g:jade_self_closing_tags.')>' elseif line =~? '^\v%('.g:jade_self_closing_tags.')>'
return indent return indent
elseif group =~? '\v^%(jadeAttributesDelimiter|jadeClass|jadeId|htmlTagName|htmlSpecialTagName|jadeFilter)$' elseif group =~? '\v^%(jadeAttributesDelimiter|jadeClass|jadeId|htmlTagName|htmlSpecialTagName|jadeFilter|jadeTagBlockChar)$'
return increase return increase
else else
return indent return indent

View File

@@ -77,5 +77,18 @@ function! GetPuppetIndent()
let ind -= &sw let ind -= &sw
endif endif
" Don't indent resources that are one after another with a ->(ordering arrow)
" file {'somefile':
" ...
" } ->
"
" package { 'mycoolpackage':
" ...
" }
if line =~ '->$'
let ind -= &sw
endif
return ind return ind
endfunction endfunction

View File

@@ -90,13 +90,20 @@ let s:end_skip_expr = s:skip_expr .
let s:non_bracket_continuation_regex = '\%([\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$' let s:non_bracket_continuation_regex = '\%([\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$'
" Regex that defines continuation lines. " Regex that defines continuation lines.
" TODO: this needs to deal with if ...: and so on
let s:continuation_regex = let s:continuation_regex =
\ '\%(%\@<![({[\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$' \ '\%(%\@<![({[\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$'
" Regex that defines continuable keywords
let s:continuable_regex =
\ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' .
\ '\<\%(if\|for\|while\|until\|unless\):\@!\>'
" Regex that defines bracket continuations " Regex that defines bracket continuations
let s:bracket_continuation_regex = '%\@<!\%([({[]\)\s*\%(#.*\)\=$' let s:bracket_continuation_regex = '%\@<!\%([({[]\)\s*\%(#.*\)\=$'
" Regex that defines end of bracket continuation followed by another continuation
let s:bracket_switch_continuation_regex = '^\([^(]\+\zs).\+\)\+'.s:continuation_regex
" Regex that defines the first part of a splat pattern " Regex that defines the first part of a splat pattern
let s:splat_regex = '[[,(]\s*\*\s*\%(#.*\)\=$' let s:splat_regex = '[[,(]\s*\*\s*\%(#.*\)\=$'
@@ -488,6 +495,10 @@ function GetRubyIndent(...)
endif endif
endif endif
if s:Match(lnum, s:continuable_regex) && s:Match(lnum, s:continuation_regex)
return indent(s:GetMSL(lnum)) + &sw + &sw
endif
" If the previous line ended with a block opening, add a level of indent. " If the previous line ended with a block opening, add a level of indent.
if s:Match(lnum, s:block_regex) if s:Match(lnum, s:block_regex)
return indent(s:GetMSL(lnum)) + &sw return indent(s:GetMSL(lnum)) + &sw
@@ -575,10 +586,14 @@ function GetRubyIndent(...)
let p_lnum = lnum let p_lnum = lnum
let lnum = s:GetMSL(lnum) let lnum = s:GetMSL(lnum)
" If the previous line wasn't a MSL and is continuation return its indent. " If the previous line wasn't a MSL.
" TODO: the || s:IsInString() thing worries me a bit.
if p_lnum != lnum if p_lnum != lnum
if s:Match(p_lnum, s:non_bracket_continuation_regex) || s:IsInString(p_lnum,strlen(line)) " If previous line ends bracket and begins non-bracket continuation decrease indent by 1.
if s:Match(p_lnum, s:bracket_switch_continuation_regex)
return ind - 1
" If previous line is a continuation return its indent.
" TODO: the || s:IsInString() thing worries me a bit.
elseif s:Match(p_lnum, s:non_bracket_continuation_regex) || s:IsInString(p_lnum,strlen(line))
return ind return ind
endif endif
endif endif

View File

@@ -15,6 +15,7 @@ setlocal autoindent
setlocal softtabstop=2 setlocal softtabstop=2
setlocal tabstop=2 setlocal tabstop=2
setlocal shiftwidth=2 setlocal shiftwidth=2
setlocal expandtab
if exists("*GetScalaIndent") if exists("*GetScalaIndent")
finish finish
@@ -35,12 +36,12 @@ endfunction
function! scala#GetLine(lnum) function! scala#GetLine(lnum)
let line = substitute(getline(a:lnum), '//.*$', '', '') let line = substitute(getline(a:lnum), '//.*$', '', '')
let line = substitute(line, '"[^"]*"', '""', 'g') let line = substitute(line, '"\(.\|\\"\)\{-}"', '""', 'g')
return line return line
endfunction endfunction
function! scala#CountBrackets(line, openBracket, closedBracket) function! scala#CountBrackets(line, openBracket, closedBracket)
let line = substitute(a:line, '"\(.\|\\"\)*"', '', 'g') let line = substitute(a:line, '"\(.\|\\"\)\{-}"', '', 'g')
let open = substitute(line, '[^' . a:openBracket . ']', '', 'g') let open = substitute(line, '[^' . a:openBracket . ']', '', 'g')
let close = substitute(line, '[^' . a:closedBracket . ']', '', 'g') let close = substitute(line, '[^' . a:closedBracket . ']', '', 'g')
return strlen(open) - strlen(close) return strlen(open) - strlen(close)
@@ -101,7 +102,7 @@ function! scala#CurlyMatcher()
if scala#CountParens(scala#GetLine(matchline)) < 0 if scala#CountParens(scala#GetLine(matchline)) < 0
let savedpos = getpos('.') let savedpos = getpos('.')
call setpos('.', [savedpos[0], matchline, 9999, savedpos[3]]) call setpos('.', [savedpos[0], matchline, 9999, savedpos[3]])
call searchpos('{', 'Wb') call searchpos('{', 'Wbc')
call searchpos(')', 'Wb') call searchpos(')', 'Wb')
let [lnum, colnum] = searchpairpos('(', '', ')', 'Wbn') let [lnum, colnum] = searchpairpos('(', '', ')', 'Wbn')
call setpos('.', savedpos) call setpos('.', savedpos)
@@ -132,7 +133,7 @@ function! scala#GetLineAndColumnThatMatchesBracket(openBracket, closedBracket)
call searchpos(a:closedBracket . '\ze[^' . a:closedBracket . a:openBracket . ']*' . a:openBracket, 'W') call searchpos(a:closedBracket . '\ze[^' . a:closedBracket . a:openBracket . ']*' . a:openBracket, 'W')
else else
call setpos('.', [savedpos[0], savedpos[1], 9999, savedpos[3]]) call setpos('.', [savedpos[0], savedpos[1], 9999, savedpos[3]])
call searchpos(a:closedBracket, 'Wb') call searchpos(a:closedBracket, 'Wbc')
endif endif
let [lnum, colnum] = searchpairpos(a:openBracket, '', a:closedBracket, 'Wbn') let [lnum, colnum] = searchpairpos(a:openBracket, '', a:closedBracket, 'Wbn')
call setpos('.', savedpos) call setpos('.', savedpos)
@@ -381,7 +382,11 @@ function! GetScalaIndent()
let curline = scala#GetLine(curlnum) let curline = scala#GetLine(curlnum)
if prevline =~ '^\s*/\*\*' if prevline =~ '^\s*/\*\*'
return ind + 1 if prevline =~ '\*/\s*$'
return ind
else
return ind + 1
endif
endif endif
if curline =~ '^\s*\*' if curline =~ '^\s*\*'

15
indent/swift.vim Normal file
View File

@@ -0,0 +1,15 @@
" Language: Swift<https://developer.apple.com/swift/>
" Maintainer: toyama satoshi <toyamarinyon@gmail.com>
" URL: http://github.com/toyamarinyon/vim-swift
" License: GPL
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
" C indenting is built-in, thus this is very simple
setlocal cindent
let b:undo_indent = "setl cin<"

35
syntax/blade.vim Normal file
View File

@@ -0,0 +1,35 @@
" Language: Blade (Laravel)
" Maintainer: xsbeats <jwalton512@gmail.com>
" URL: http://github.com/xsbeats/vim-blade
" License: WTFPL
if exists("b:current_syntax")
finish
endif
runtime! syntax/html.vim
unlet b:current_syntax
runtime! syntax/php.vim
unlet b:current_syntax
syn match bladeConditional /@\(choice\|each\|elseif\|extends\|for\|foreach\|if\|include\|lang\|section\|unless\|while\|yield\)\>\s*/ nextgroup=bladeParenBlock containedin=ALLBUT,bladeComment
syn match bladeKeyword /@\(else\|endfor\|endforeach\|endif\|endsection\|endunless\|endwhile\|overwrite\|parent\|show\|stop\)\>/ containedin=ALL,bladeComment
syn region bladeCommentBlock start="{{--" end="--}}" contains=bladeComment keepend containedin=TOP
syn match bladeComment /.*/ contained containedin=bladeCommentBlock
syn region bladeEchoUnescaped matchgroup=bladeEchoDelim start="\([@|{]\)\@<!{{\(--\)\@!" end="}}" contains=@phpClInside containedin=ALLBUT,bladeComment
syn region bladeEchoEscaped matchgroup=bladeEchoDelim start="\(@\)\@<!{{{" end="}}}" contains=@phpClInside containedin=ALLBUT,bladeComment
syn cluster bladeStatement contains=bladeConditional,bladeKeyword
syn region bladeParenBlock start="(" end=")" contained oneline contains=bladeParenBlock,@phpClInside,@bladeStatement extend keepend
hi def link bladeComment Comment
hi def link bladeConditional Conditional
hi def link bladeKeyword Keyword
hi def link bladeEchoDelim Delimiter
let b:current_syntax = 'blade'

View File

@@ -116,7 +116,7 @@ syn match cabalOperator '\W\@<=impl\((.\+)\)\@='
syn match cabalOperator '\W\@<=flag\((.\+)\)\@=' syn match cabalOperator '\W\@<=flag\((.\+)\)\@='
syn match cabalOperator '\(^\s*--.*\)\@<!\(<\|>\|=\|||\|&&\)' syn match cabalOperator '\(^\s*--.*\)\@<!\(<\|>\|=\|||\|&&\)'
syn match cabalComment '\s\@<=--.*$' syn match cabalComment '--.*$' contains=@Spell
if version >= 508 || !exists('did_cabal_syntax_inits') if version >= 508 || !exists('did_cabal_syntax_inits')
if version < 508 if version < 508

654
syntax/css.vim Normal file
View File

@@ -0,0 +1,654 @@
" Vim syntax file
" Language: Cascading Style Sheets
" Previous Contributor List:
" Claudio Fleiner <claudio@fleiner.com> (Maintainer)
" Yeti (Add full CSS2, HTML4 support)
" Nikolai Weibull (Add CSS2 support)
" Maintainer: Jules Wang <w.jq0722@gmail.com>
" URL: https://github.com/JulesWang/css.vim
" Last Change: 2013 Nov.27
" 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 = 'css'
elseif exists("b:current_syntax") && b:current_syntax == "css"
finish
endif
let s:cpo_save = &cpo
set cpo&vim
syn case ignore
" All HTML4 tags
syn keyword cssTagName abbr acronym address applet area a b base
syn keyword cssTagName basefont bdo big blockquote body br button
syn keyword cssTagName caption center cite code col colgroup dd del
syn keyword cssTagName dfn dir div dl dt em fieldset font form frame
syn keyword cssTagName frameset h1 h2 h3 h4 h5 h6 head hr html img i
syn keyword cssTagName iframe img input ins isindex kbd label legend li
syn keyword cssTagName link map menu meta noframes noscript ol optgroup
syn keyword cssTagName option p param pre q s samp script select small
syn keyword cssTagName span strike strong style sub sup table tbody td
syn keyword cssTagName textarea tfoot th thead title tr tt ul u var
syn keyword cssTagName object svg
" 34 HTML5 tags
syn keyword cssTagName article aside audio bdi canvas command data
syn keyword cssTagName datalist details dialog embed figcaption figure footer
syn keyword cssTagName header hgroup keygen main mark menuitem meter nav
syn keyword cssTagName output progress rt rp ruby section
syn keyword cssTagName source summary time track video wbr
" Tags not supported in HTML5
syn keyword cssDeprecated acronym applet basefont big center dir
syn keyword cssDeprecated font frame frameset noframes strike tt
syn match cssTagName "\*"
" selectors
syn match cssSelectorOp "[,>+~]"
syn match cssSelectorOp2 "[~|^$*]\?=" contained
syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ
" .class and #id
syn match cssClassName "\.[A-Za-z][A-Za-z0-9_-]\+" contains=cssClassNameDot
syn match cssClassNameDot contained '\.'
try
syn match cssIdentifier "#[A-Za-z<>-<2D>_@][A-Za-z<>-<2D>0-9_@-]*"
catch /^.*/
syn match cssIdentifier "#[A-Za-z_@][A-Za-z0-9_@-]*"
endtry
" digits
syn match cssValueInteger contained "[-+]\=\d\+" contains=cssUnitDecorators
syn match cssValueNumber contained "[-+]\=\d\+\(\.\d*\)\=" contains=cssUnitDecorators
syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\)" contains=cssUnitDecorators
syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)" contains=cssUnitDecorators
syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)" contains=cssUnitDecorators
syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)" contains=cssUnitDecorators
syn match cssIncludeKeyword /@\(-[a-z]\+-\)\=\(media\|keyframes\|import\|charset\|namespace\|page\)/ contained
" @media
syn region cssInclude start=/@media\>/ end=/\ze{/ skipwhite skipnl contains=cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType,cssIncludeKeyword,cssMediaComma,cssComment nextgroup=cssMediaBlock
syn keyword cssMediaType contained screen print aural braille embossed handheld projection tty tv speech all contained skipwhite skipnl
syn keyword cssMediaKeyword only not and contained
syn region cssMediaBlock transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssTagName,cssClassName,cssIdentifier,cssPseudoClass,cssSelectorOp,cssSelectorOp2,cssAttributeSelector fold
syn match cssMediaComma "," skipwhite skipnl contained
" Reference: http://www.w3.org/TR/css3-mediaqueries/
syn keyword cssMediaProp contained width height orientation scan grid
syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(\(device\)-\)\=aspect-ratio/
syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-pixel-ratio/
syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-\(height\|width\)/
syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)/
syn keyword cssMediaAttr contained portrait landscape progressive interlace
" @page
" http://www.w3.org/TR/css3-page/
syn match cssPage "@page\>[^{]*{\@=" contains=cssPagePseudo,cssIncludeKeyword nextgroup=cssPageWrap transparent skipwhite skipnl
syn match cssPagePseudo /:\(left\|right\|first\|blank\)/ contained skipwhite skipnl
syn region cssPageWrap contained transparent matchgroup=cssBraces start="{" end="}" contains=cssPageMargin,cssPageProp,cssAttrRegion,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks
syn match cssPageMargin /@\(\(top\|left\|right\|bottom\)-\(left\|center\|right\|middle\|bottom\)\)\(-corner\)\=/ contained nextgroup=cssDefinition skipwhite skipnl
syn keyword cssPageProp contained content size
" http://www.w3.org/TR/CSS2/page.html#break-inside
syn keyword cssPageProp contained orphans widows
" @keyframe
" http://www.w3.org/TR/css3-animations/#keyframes
syn match cssKeyFrame "@\(-[a-z]\+-\)\=keyframes\>[^{]*{\@=" nextgroup=cssKeyFrameWrap contains=cssVendor,cssIncludeKeyword skipwhite skipnl transparent
syn region cssKeyFrameWrap contained transparent matchgroup=cssBraces start="{" end="}" contains=cssKeyFrameSelector
syn match cssKeyFrameSelector /\(\d*%\|from\|to\)\=/ contained skipwhite skipnl nextgroup=cssDefinition
" @import
syn region cssInclude start=/@import\>/ end=/\ze;/ transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword,cssURL,cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType
syn region cssInclude start=/@charset\>/ end=/\ze;/ transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword
syn region cssInclude start=/@namespace\>/ end=/\ze;/ transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword
" @font-face
" http://www.w3.org/TR/css3-fonts/#at-font-face-rule
syn match cssFontDescriptor "@font-face\>" nextgroup=cssFontDescriptorBlock skipwhite skipnl
syn region cssFontDescriptorBlock contained transparent matchgroup=cssBraces start="{" end="}" contains=cssComment,cssError,cssUnicodeEscape,cssFontProp,cssFontAttr,cssCommonAttr,cssStringQ,cssStringQQ,cssFontDescriptorProp,cssValue.*,cssFontDescriptorFunction,cssUnicodeRange,cssFontDescriptorAttr,cssNoise
"syn match cssFontDescriptorProp contained "\<\(unicode-range\|unit-per-em\|panose-1\|cap-height\|x-height\|definition-src\)\>"
"syn keyword cssFontDescriptorProp contained src stemv stemh slope ascent descent widths bbox baseline centerline mathline topline
syn keyword cssFontDescriptorProp contained src
syn match cssFontDescriptorProp contained "\<unicode-range\>"
syn keyword cssFontDescriptorAttr contained all
syn region cssFontDescriptorFunction contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline keepend
syn match cssUnicodeRange contained "U+[0-9A-Fa-f?]\+"
syn match cssUnicodeRange contained "U+\x\+-\x\+"
" The 16 basic color names
syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow
" 130 more color names
syn keyword cssColor contained aliceblue antiquewhite aquamarine azure
syn keyword cssColor contained beige bisque blanchedalmond blueviolet brown burlywood
syn keyword cssColor contained cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan
syn match cssColor contained /dark\(blue\|cyan\|goldenrod\|gray\|green\|grey\|khaki\)/
syn match cssColor contained /dark\(magenta\|olivegreen\|orange\|orchid\|red\|salmon\|seagreen\)/
syn match cssColor contained /darkslate\(blue\|gray\|grey\)/
syn match cssColor contained /dark\(turquoise\|violet\)/
syn keyword cssColor contained deeppink deepskyblue dimgray dimgrey dodgerblue firebrick
syn keyword cssColor contained floralwhite forestgreen gainsboro ghostwhite gold
syn keyword cssColor contained goldenrod greenyellow grey honeydew hotpink
syn keyword cssColor contained indianred indigo ivory khaki lavender lavenderblush lawngreen
syn keyword cssColor contained lemonchiffon limegreen linen magenta
syn match cssColor contained /light\(blue\|coral\|cyan\|goldenrodyellow\|gray\|green\)/
syn match cssColor contained /light\(grey\|pink\|salmon\|seagreen\|skyblue\|yellow\)/
syn match cssColor contained /light\(slategray\|slategrey\|steelblue\)/
syn match cssColor contained /medium\(aquamarine\|blue\|orchid\|purple\|seagreen\)/
syn match cssColor contained /medium\(slateblue\|springgreen\|turquoise\|violetred\)/
syn keyword cssColor contained midnightblue mintcream mistyrose moccasin navajowhite
syn keyword cssColor contained oldlace olivedrab orange orangered orchid
syn match cssColor contained /pale\(goldenrod\|green\|turquoise\|violetred\)/
syn keyword cssColor contained papayawhip peachpuff peru pink plum powderblue
syn keyword cssColor contained rosybrown royalblue saddlebrown salmon sandybrown
syn keyword cssColor contained seagreen seashell sienna skyblue slateblue
syn keyword cssColor contained slategray slategrey snow springgreen steelblue tan
syn keyword cssColor contained thistle tomato turquoise violet wheat
syn keyword cssColor contained whitesmoke yellowgreen
" FIXME: These are actually case-insensitive too, but (a) specs recommend using
" mixed-case (b) it's hard to highlight the word `Background' correctly in
" all situations
syn case match
syn keyword cssColor contained ActiveBorder ActiveCaption AppWorkspace ButtonFace ButtonHighlight ButtonShadow ButtonText CaptionText GrayText Highlight HighlightText InactiveBorder InactiveCaption InactiveCaptionText InfoBackground InfoText Menu MenuText Scrollbar ThreeDDarkShadow ThreeDFace ThreeDHighlight ThreeDLightShadow ThreeDShadow Window WindowFrame WindowText Background
syn case ignore
syn match cssImportant contained "!\s*important\>"
syn match cssColor contained "\<transparent\>"
syn match cssColor contained "\<currentColor\>"
syn match cssColor contained "\<white\>"
syn match cssColor contained "#[0-9A-Fa-f]\{3\}\>" contains=cssUnitDecorators
syn match cssColor contained "#[0-9A-Fa-f]\{6\}\>" contains=cssUnitDecorators
syn region cssURL contained matchgroup=cssFunctionName start="\<url\s*(" end=")" contains=cssStringQ,cssStringQQ oneline
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\|cubic-bezier\|steps\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgba\|hsl\|hsla\|color-stop\|from\|to\)\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma,cssFunction
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(linear-\|radial-\)\=\gradient\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(matrix\(3d\)\=\|scale\(3d\|X\|Y\|Z\)\=\|translate\(3d\|X\|Y\|Z\)\=\|skew\(X\|Y\)\=\|rotate\(3d\|X\|Y\|Z\)\=\|perspective\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssValueAngle,cssFunctionComma
syn keyword cssGradientAttr contained top bottom left right cover center middle ellipse at
syn match cssFunctionComma contained ","
" Common Prop and Attr
syn keyword cssCommonAttr contained auto none inherit all default normal
syn keyword cssCommonAttr contained top bottom center stretch hidden visible
"------------------------------------------------
" CSS Animations
" http://www.w3.org/TR/css3-animations/
syn match cssAnimationProp contained "\<animation\(-\(delay\|direction\|duration\|fill-mode\|name\|play-state\|timing-function\|iteration-count\)\)\=\>"
" animation-direction attributes
syn keyword cssAnimationAttr contained alternate reverse
syn match cssAnimationAttr contained "\<alternate-reverse\>"
" animation-fill-mode attributes
syn keyword cssAnimationAttr contained forwards backwards both
" animation-play-state attributes
syn keyword cssAnimationAttr contained running paused
" animation-iteration-count attributes
syn keyword cssAnimationAttr contained infinite
"------------------------------------------------
" CSS Backgrounds and Borders Module Level 3
" http://www.w3.org/TR/css3-background/
syn match cssBackgroundProp contained "\<background\(-\(attachment\|clip\|color\|image\|origin\|position\|repeat\|size\)\)\=\>"
" background-attachment attributes
syn keyword cssBackgroundAttr contained scroll fixed local
" background-position attributes
syn keyword cssBackgroundAttr contained left center right top bottom
" background-repeat attributes
syn match cssBackgroundAttr contained "\<no-repeat\>"
syn match cssBackgroundAttr contained "\<repeat\(-[xy]\)\=\>"
syn keyword cssBackgroundAttr contained space round
" background-size attributes
syn keyword cssBackgroundAttr contained cover contain
syn match cssBorderProp contained "\<border\(-\(top\|right\|bottom\|left\)\)\=\(-\(width\|color\|style\)\)\=\>"
syn match cssBorderProp contained "\<border\(-\(top\|bottom\)-\(left\|right\)\)\=-radius\>"
syn match cssBorderProp contained "\<border-image\(-\(outset\|repeat\|slice\|source\|width\)\)\=\>"
syn match cssBorderProp contained "\<box-decoration-break\>"
syn match cssBorderProp contained "\<box-shadow\>"
" border-image attributes
syn keyword cssBorderAttr contained stretch round space fill
" border-style attributes
syn keyword cssBorderAttr contained dotted dashed solid double groove ridge inset outset
" border-width attributes
syn keyword cssBorderAttr contained thin thick medium
" box-decoration-break attributes
syn keyword cssBorderAttr contained clone slice
"------------------------------------------------
syn match cssBoxProp contained "\<padding\(-\(top\|right\|bottom\|left\)\)\=\>"
syn match cssBoxProp contained "\<margin\(-\(top\|right\|bottom\|left\)\)\=\>"
syn match cssBoxProp contained "\<overflow\(-\(x\|y\|style\)\)\=\>"
syn match cssBoxProp contained "\<rotation\(-point\)\=\>"
syn keyword cssBoxAttr contained visible hidden scroll auto
syn match cssBoxAttr contained "\<no-\(display\|content\)\>"
syn keyword cssColorProp contained opacity
syn match cssColorProp contained "\<color-profile\>"
syn match cssColorProp contained "\<rendering-intent\>"
syn match cssDimensionProp contained "\<\(min\|max\)-\(width\|height\)\>"
syn keyword cssDimensionProp contained height
syn keyword cssDimensionProp contained width
" shadow and sizing are in other property groups
syn match cssFlexibleBoxProp contained "\<box-\(align\|direction\|flex\|ordinal-group\|orient\|pack\|shadow\|sizing\)\>"
syn keyword cssFlexibleBoxAttr contained start end baseline
syn keyword cssFlexibleBoxAttr contained reverse
syn keyword cssFlexibleBoxAttr contained single multiple
syn keyword cssFlexibleBoxAttr contained horizontal
syn match cssFlexibleBoxAttr contained "\<vertical\(-align\)\@!\>" "escape vertical-align
syn match cssFlexibleBoxAttr contained "\<\(inline\|block\)-axis\>"
" CSS Fonts Module Level 3
" http://www.w3.org/TR/css-fonts-3/
syn match cssFontProp contained "\<font\(-\(family\|\|feature-settings\|kerning\|language-override\|size\(-adjust\)\=\|stretch\|style\|synthesis\|variant\(-\(alternates\|caps\|east-asian\|ligatures\|numeric\|position\)\)\=\|weight\)\)\=\>"
" font attributes
syn keyword cssFontAttr contained icon menu caption
syn match cssFontAttr contained "\<small-\(caps\|caption\)\>"
syn match cssFontAttr contained "\<message-box\>"
syn match cssFontAttr contained "\<status-bar\>"
syn keyword cssFontAttr contained larger smaller
syn match cssFontAttr contained "\<\(x\{1,2\}-\)\=\(large\|small\)\>"
" font-family attributes
syn match cssFontAttr contained "\<\(sans-\)\=serif\>"
syn keyword cssFontAttr contained Antiqua Arial Black Book Charcoal Comic Courier Dingbats Gadget Geneva Georgia Grande Helvetica Impact Linotype Lucida MS Monaco Neue New Palatino Roboto Roman Symbol Tahoma Times Trebuchet Unicode Verdana Webdings Wingdings York Zapf
syn keyword cssFontAttr contained cursive fantasy monospace
" font-feature-settings attributes
syn keyword cssFontAttr contained on off
" font-stretch attributes
syn match cssFontAttr contained "\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>"
" font-style attributes
syn keyword cssFontAttr contained italic oblique
" font-variant-caps attributes
syn match cssFontAttr contained "\<\(all-\)\=\(small-\|petite-\|titling-\)caps\>"
syn keyword cssFontAttr contained unicase
" font-weight attributes
syn keyword cssFontAttr contained bold bolder lighter
"------------------------------------------------
" Webkit specific property/attributes
syn match cssFontProp contained "\<font-smooth\>"
syn match cssFontAttr contained "\<\(subpixel-\)\=\antialiased\>"
" CSS Multi-column Layout Module
" http://www.w3.org/TR/css3-multicol/
syn match cssMultiColumnProp contained "\<break-\(after\|before\|inside\)\>"
syn match cssMultiColumnProp contained "\<column-\(count\|fill\|gap\|rule\(-\(color\|style\|width\)\)\=\|span\|width\)\>"
syn keyword cssMultiColumnProp contained columns
syn keyword cssMultiColumnAttr contained balance medium
syn keyword cssMultiColumnAttr contained always avoid left right page column
syn match cssMultiColumnAttr contained "\<avoid-\(page\|column\)\>"
" http://www.w3.org/TR/css3-break/#page-break
syn match cssMultiColumnProp contained "\<page\(-break-\(before\|after\|inside\)\)\=\>"
" TODO find following items in w3c docs.
syn keyword cssGeneratedContentProp contained quotes crop
syn match cssGeneratedContentProp contained "\<counter-\(reset\|increment\)\>"
syn match cssGeneratedContentProp contained "\<move-to\>"
syn match cssGeneratedContentProp contained "\<page-policy\>"
syn match cssGeneratedContentAttr contained "\<\(no-\)\=\(open\|close\)-quote\>"
syn match cssGridProp contained "\<grid-\(columns\|rows\)\>"
syn match cssHyerlinkProp contained "\<target\(-\(name\|new\|position\)\)\=\>"
syn match cssListProp contained "\<list-style\(-\(type\|position\|image\)\)\=\>"
syn match cssListAttr contained "\<\(lower\|upper\)-\(roman\|alpha\|greek\|latin\)\>"
syn match cssListAttr contained "\<\(hiragana\|katakana\)\(-iroha\)\=\>"
syn match cssListAttr contained "\<\(decimal\(-leading-zero\)\=\|cjk-ideographic\)\>"
syn keyword cssListAttr contained disc circle square hebrew armenian georgian
syn keyword cssListAttr contained inside outside
syn keyword cssPositioningProp contained bottom clear clip display float left
syn keyword cssPositioningProp contained position right top visibility
syn match cssPositioningProp contained "\<z-index\>"
syn keyword cssPositioningAttr contained block compact
syn match cssPositioningAttr contained "\<table\(-\(row-group\|\(header\|footer\)-group\|row\|column\(-group\)\=\|cell\|caption\)\)\=\>"
syn keyword cssPositioningAttr contained left right both
syn match cssPositioningAttr contained "\<list-item\>"
syn match cssPositioningAttr contained "\<inline\(-\(block\|box\|table\)\)\=\>"
syn keyword cssPositioningAttr contained static relative absolute fixed
syn keyword cssPrintAttr contained landscape portrait crop cross always avoid
syn match cssTableProp contained "\<\(caption-side\|table-layout\|border-collapse\|border-spacing\|empty-cells\)\>"
syn keyword cssTableAttr contained fixed collapse separate show hide once always
syn keyword cssTextProp contained color direction
syn match cssTextProp "\<\(\(word\|letter\)-spacing\|text\(-\(decoration\|transform\|align\|index\|shadow\)\)\=\|vertical-align\|unicode-bidi\|line-height\)\>"
syn match cssTextProp contained "\<text-\(justify\|outline\|warp\|align-last\|size-adjust\|rendering\|stroke\|indent\)\>"
syn match cssTextProp contained "\<word-\(break\|\wrap\)\>"
syn match cssTextProp contained "\<white-space\>"
syn match cssTextProp contained "\<hanging-punctuation\>"
syn match cssTextProp contained "\<punctuation-trim\>"
syn match cssTextAttr contained "\<line-through\>"
syn match cssTextAttr contained "\<\(text-\)\=\(top\|bottom\)\>"
syn keyword cssTextAttr contained ltr rtl embed nowrap
syn keyword cssTextAttr contained underline overline blink sub super middle
syn keyword cssTextAttr contained capitalize uppercase lowercase
syn keyword cssTextAttr contained justify baseline sub super
syn keyword cssTextAttr contained optimizeLegibility optimizeSpeed
syn match cssTextAttr contained "\<pre\(-\(line\|wrap\)\)\=\>"
syn match cssTextAttr contained "\<\(allow\|force\)-end\>"
syn keyword cssTextAttr contained start end adjacent
syn match cssTextAttr contained "\<inter-\(word\|ideographic\|cluster\)\>"
syn keyword cssTextAttr contained distribute kashida first last
syn keyword cssTextAttr contained clip ellipsis unrestricted suppress
syn match cssTextAttr contained "\<break-all\>"
syn match cssTextAttr contained "\<break-word\>"
syn keyword cssTextAttr contained hyphenate
syn match cssTextAttr contained "\<bidi-override\>"
syn match cssTransformProp contained "\<transform\(-\(origin\|style\)\)\=\>"
syn match cssTransformProp contained "\<perspective\(-origin\)\=\>"
syn match cssTransformProp contained "\<backface-visibility\>"
" CSS Transitions
" http://www.w3.org/TR/css3-transitions/
syn match cssTransitionProp contained "\<transition\(-\(delay\|duration\|property\|timing-function\)\)\=\>"
" transition-time-function attributes
syn match cssTransitionAttr contained "\<linear\(-gradient\)\@!\>"
syn match cssTransitionAttr contained "\<ease\(-\(in-out\|out\|in\)\)\=\>"
syn match cssTransitionAttr contained "\<step\(-start\|-end\)\=\>"
"------------------------------------------------
" CSS Basic User Interface Module Level 3 (CSS3 UI)
" http://www.w3.org/TR/css3-ui/
syn match cssUIProp contained "\<box-sizing\>"
syn match cssUIAttr contained "\<\(content\|padding\|border\)\(-box\)\=\>"
syn keyword cssUIProp contained cursor
syn match cssUIAttr contained "\<\(\([ns]\=[ew]\=\)\|col\|row\|nesw\|nwse\)-resize\>"
syn keyword cssUIAttr contained crosshair help move pointer alias copy
syn keyword cssUIAttr contained progress wait text cell move
syn match cssUIAttr contained "\<context-menu\>"
syn match cssUIAttr contained "\<no-drop\>"
syn match cssUIAttr contained "\<not-allowed\>"
syn match cssUIAttr contained "\<all-scroll\>"
syn match cssUIAttr contained "\<\(vertical-\)\=text\>"
syn match cssUIAttr contained "\<zoom\(-in\|-out\)\=\>"
syn match cssUIProp contained "\<ime-mode\>"
syn keyword cssUIAttr contained active inactive disabled
syn match cssUIProp contained "\<nav-\(down\|index\|left\|right\|up\)\=\>"
syn match cssUIProp contained "\<outline\(-\(width\|style\|color\|offset\)\)\=\>"
syn keyword cssUIAttr contained invert
syn keyword cssUIProp contained icon resize
syn keyword cssUIAttr contained both horizontal vertical
syn match cssUIProp contained "\<text-overflow\>"
syn keyword cssUIAttr contained clip ellipsis
" Already highlighted Props: font content
"------------------------------------------------
" Webkit/iOS specific attributes
syn match cssUIAttr contained '\(preserve-3d\)'
" IE specific attributes
syn match cssIEUIAttr contained '\(bicubic\)'
" Webkit/iOS specific properties
syn match cssUIProp contained '\(tap-highlight-color\|user-select\|touch-callout\)'
" IE specific properties
syn match cssIEUIProp contained '\(interpolation-mode\|zoom\|filter\)'
" Webkit/Firebox specific properties/attributes
syn keyword cssUIProp contained appearance
syn keyword cssUIAttr contained window button field icon document menu
syn match cssAuralProp contained "\<\(pause\|cue\)\(-\(before\|after\)\)\=\>"
syn match cssAuralProp contained "\<\(play-during\|speech-rate\|voice-family\|pitch\(-range\)\=\|speak\(-\(punctuation\|numeral\|header\)\)\=\)\>"
syn keyword cssAuralProp contained volume during azimuth elevation stress richness
syn match cssAuralAttr contained "\<\(x-\)\=\(soft\|loud\)\>"
syn keyword cssAuralAttr contained silent
syn match cssAuralAttr contained "\<spell-out\>"
syn keyword cssAuralAttr contained non mix
syn match cssAuralAttr contained "\<\(left\|right\)-side\>"
syn match cssAuralAttr contained "\<\(far\|center\)-\(left\|center\|right\)\>"
syn keyword cssAuralAttr contained leftwards rightwards behind
syn keyword cssAuralAttr contained below level above lower higher
syn match cssAuralAttr contained "\<\(x-\)\=\(slow\|fast\|low\|high\)\>"
syn keyword cssAuralAttr contained faster slower
syn keyword cssAuralAttr contained male female child code digits continuous
" mobile text
syn match cssMobileTextProp contained "\<text-size-adjust\>"
syn match cssBraces contained "[{}]"
syn match cssError contained "{@<>"
syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=cssAttrRegion,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks,cssNoise fold
syn match cssBraceError "}"
syn match cssAttrComma ","
" Pseudo class
" http://www.w3.org/TR/css3-selectors/
syn match cssPseudoClass ":[A-Za-z0-9_-]*" contains=cssNoise,cssPseudoClassId,cssUnicodeEscape,cssVendor,cssPseudoClassFn
syn keyword cssPseudoClassId contained link visited active hover before after left right
syn keyword cssPseudoClassId contained root empty target enable disabled checked invalid
syn match cssPseudoClassId contained "\<first-\(line\|letter\)\>"
syn match cssPseudoClassId contained "\<\(first\|last\|only\)-\(of-type\|child\)\>"
syn region cssPseudoClassFn contained matchgroup=cssFunctionName start="\<\(not\|lang\|\(nth\|nth-last\)-\(of-type\|child\)\)(" end=")"
" ------------------------------------
" Vendor specific properties
syn match cssPseudoClassId contained "\<selection\>"
syn match cssPseudoClassId contained "\<focus\(-inner\)\=\>"
syn match cssPseudoClassId contained "\<\(input-\)\=placeholder\>"
" Misc highlight groups
syntax match cssUnitDecorators /\(#\|-\|%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\|Hz\|kHz\|s\|ms\|deg\|grad\|rad\)/ contained
syntax match cssNoise contained /\(:\|;\|\/\)/
" Comment
syn region cssComment start="/\*" end="\*/" contains=@Spell fold
syn match cssUnicodeEscape "\\\x\{1,6}\s\?"
syn match cssSpecialCharQQ +\\\\\|\\"+ contained
syn match cssSpecialCharQ +\\\\\|\\'+ contained
syn region cssStringQQ start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cssUnicodeEscape,cssSpecialCharQQ
syn region cssStringQ start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=cssUnicodeEscape,cssSpecialCharQ
" Vendor Prefix
syn match cssVendor contained "\(-\(webkit\|moz\|o\|ms\)-\)"
" Various CSS Hack characters
" In earlier versions of IE (6 and 7), one can prefix property names
" with a _ or * to isolate those definitions to particular versions of IE
" This is purely decorative and therefore we assign to the same highlight
" group to cssVendor, for more information:
" http://www.paulirish.com/2009/browser-specific-css-hacks/
syn match cssHacks contained /\(_\|*\)/
" Attr Enhance
" Some keywords are both Prop and Attr, so we have to handle them
syn region cssAttrRegion start=/:/ end=/\ze\(;\|)\|}\)/ contained contains=css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise
" Hack for transition
" 'transition' has Props after ':'.
syn region cssAttrRegion start=/transition\s*:/ end=/\ze\(;\|)\|}\)/ contained contains=css.*Prop,css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise
if main_syntax == "css"
syn sync minlines=10
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_css_syn_inits")
if version < 508
let did_css_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink cssComment Comment
HiLink cssVendor Comment
HiLink cssHacks Comment
HiLink cssTagName Statement
HiLink cssDeprecated Error
HiLink cssSelectorOp Special
HiLink cssSelectorOp2 Special
HiLink cssAttrComma Special
HiLink cssAnimationProp cssProp
HiLink cssBackgroundProp cssProp
HiLink cssBorderProp cssProp
HiLink cssBoxProp cssProp
HiLink cssColorProp cssProp
HiLink cssContentForPagedMediaProp cssProp
HiLink cssDimensionProp cssProp
HiLink cssFlexibleBoxProp cssProp
HiLink cssFontProp cssProp
HiLink cssGeneratedContentProp cssProp
HiLink cssGridProp cssProp
HiLink cssHyerlinkProp cssProp
HiLink cssLineboxProp cssProp
HiLink cssListProp cssProp
HiLink cssMarqueeProp cssProp
HiLink cssMultiColumnProp cssProp
HiLink cssPagedMediaProp cssProp
HiLink cssPositioningProp cssProp
HiLink cssPrintProp cssProp
HiLink cssRubyProp cssProp
HiLink cssSpeechProp cssProp
HiLink cssTableProp cssProp
HiLink cssTextProp cssProp
HiLink cssTransformProp cssProp
HiLink cssTransitionProp cssProp
HiLink cssUIProp cssProp
HiLink cssIEUIProp cssProp
HiLink cssAuralProp cssProp
HiLink cssRenderProp cssProp
HiLink cssMobileTextProp cssProp
HiLink cssAnimationAttr cssAttr
HiLink cssBackgroundAttr cssAttr
HiLink cssBorderAttr cssAttr
HiLink cssBoxAttr cssAttr
HiLink cssContentForPagedMediaAttr cssAttr
HiLink cssDimensionAttr cssAttr
HiLink cssFlexibleBoxAttr cssAttr
HiLink cssFontAttr cssAttr
HiLink cssGeneratedContentAttr cssAttr
HiLink cssGridAttr cssAttr
HiLink cssHyerlinkAttr cssAttr
HiLink cssLineboxAttr cssAttr
HiLink cssListAttr cssAttr
HiLink cssMarginAttr cssAttr
HiLink cssMarqueeAttr cssAttr
HiLink cssMultiColumnAttr cssAttr
HiLink cssPaddingAttr cssAttr
HiLink cssPagedMediaAttr cssAttr
HiLink cssPositioningAttr cssAttr
HiLink cssGradientAttr cssAttr
HiLink cssPrintAttr cssAttr
HiLink cssRubyAttr cssAttr
HiLink cssSpeechAttr cssAttr
HiLink cssTableAttr cssAttr
HiLink cssTextAttr cssAttr
HiLink cssTransformAttr cssAttr
HiLink cssTransitionAttr cssAttr
HiLink cssUIAttr cssAttr
HiLink cssIEUIAttr cssAttr
HiLink cssAuralAttr cssAttr
HiLink cssRenderAttr cssAttr
HiLink cssCommonAttr cssAttr
HiLink cssPseudoClassId PreProc
HiLink cssPseudoClassLang Constant
HiLink cssValueLength Number
HiLink cssValueInteger Number
HiLink cssValueNumber Number
HiLink cssValueAngle Number
HiLink cssValueTime Number
HiLink cssValueFrequency Number
HiLink cssFunction Constant
HiLink cssURL String
HiLink cssFunctionName Function
HiLink cssFunctionComma Function
HiLink cssColor Constant
HiLink cssIdentifier Function
HiLink cssInclude Include
HiLink cssIncludeKeyword atKeyword
HiLink cssImportant Special
HiLink cssBraces Function
HiLink cssBraceError Error
HiLink cssError Error
HiLink cssUnicodeEscape Special
HiLink cssStringQQ String
HiLink cssStringQ String
HiLink cssAttributeSelector String
HiLink cssMedia atKeyword
HiLink cssMediaType Special
HiLink cssMediaComma Normal
HiLink cssMediaKeyword Statement
HiLink cssMediaProp cssProp
HiLink cssMediaAttr cssAttr
HiLink cssPage atKeyword
HiLink cssPagePseudo PreProc
HiLink cssPageMargin atKeyword
HiLink cssPageProp cssProp
HiLink cssKeyFrame atKeyword
HiLink cssKeyFrameSelector Constant
HiLink cssFontDescriptor Special
HiLink cssFontDescriptorFunction Constant
HiLink cssFontDescriptorProp cssProp
HiLink cssFontDescriptorAttr cssAttr
HiLink cssUnicodeRange Constant
HiLink cssClassName Function
HiLink cssClassNameDot Function
HiLink cssProp StorageClass
HiLink cssAttr Constant
HiLink cssUnitDecorators Number
HiLink cssNoise Noise
HiLink atKeyword PreProc
delcommand HiLink
endif
let b:current_syntax = "css"
if main_syntax == 'css'
unlet main_syntax
endif
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8

View File

@@ -113,9 +113,9 @@ fu! <sid>DoHighlight() "{{{3
\. s:col . '/ contains=CSVDelimiter' \. s:col . '/ contains=CSVDelimiter'
else else
for i in range(len(b:csv_fixed_width_cols)) for i in range(len(b:csv_fixed_width_cols))
let pat = '/\%' . b:csv_fixed_width_cols[i] . 'c.*' . let pat = '/\%' . b:csv_fixed_width_cols[i] . 'v.*' .
\ ((i == len(b:csv_fixed_width_cols)-1) ? '/' : \ ((i == len(b:csv_fixed_width_cols)-1) ? '/' :
\ '\%' . b:csv_fixed_width_cols[i+1] . 'c/') \ '\%' . b:csv_fixed_width_cols[i+1] . 'v/')
let group = "CSVColumn" . (i%2 ? "Odd" : "Even" ) let group = "CSVColumn" . (i%2 ? "Odd" : "Even" )
let ngroup = "CSVColumn" . (i%2 ? "Even" : "Odd" ) let ngroup = "CSVColumn" . (i%2 ? "Even" : "Odd" )

66
syntax/eelixir.vim Normal file
View File

@@ -0,0 +1,66 @@
" Vim syntax file
" Language: Embedded Elixir
" URL: https://github.com/elixir-lang/vim-elixir
if exists("b:current_syntax")
finish
endif
if !exists("main_syntax")
let main_syntax = 'eelixir'
endif
if !exists("g:eelixir_default_subtype")
let g:eelixir_default_subtype = "html"
endif
if !exists("b:eelixir_subtype")
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
let b:eelixir_subtype = matchstr(s:lines,'eelixir_subtype=\zs\w\+')
if b:eelixir_subtype == ''
let b:eelixir_subtype = matchstr(&filetype,'^eex\.\zs\w\+')
endif
if b:eelixir_subtype == ''
let b:eelixir_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.eex\|\.eelixir\)\+$','',''),'\.\zs\w\+$')
endif
if b:eelixir_subtype == 'ex'
let b:eelixir_subtype = 'elixir'
elseif b:eelixir_subtype == 'exs'
let b:eelixir_subtype = 'elixir'
elseif b:eelixir_subtype == 'yml'
let b:eelixir_subtype = 'yaml'
elseif b:eelixir_subtype == 'js'
let b:eelixir_subtype = 'javascript'
elseif b:eelixir_subtype == 'txt'
" Conventional; not a real file type
let b:eelixir_subtype = 'text'
elseif b:eelixir_subtype == ''
let b:eelixir_subtype = g:eelixir_default_subtype
endif
endif
if exists("b:eelixir_subtype") && b:eelixir_subtype != ''
exe "runtime! syntax/".b:eelixir_subtype.".vim"
unlet! b:current_syntax
endif
syn include @elixirTop syntax/elixir.vim
syn cluster eelixirRegions contains=eelixirBlock,eelixirExpression,eelixirComment
exe 'syn region eelixirExpression matchgroup=eelixirDelimiter start="<%" end="%\@<!%>" contains=@elixirTop containedin=ALLBUT,@eelixirRegions keepend'
exe 'syn region eelixirExpression matchgroup=eelixirDelimiter start="<%=" end="%\@<!%>" contains=@elixirTop containedin=ALLBUT,@eelixirRegions keepend'
exe 'syn region eelixirQuote matchgroup=eelixirDelimiter start="<%%" end="%\@<!%>" contains=@elixirTop containedin=ALLBUT,@eelixirRegions keepend'
exe 'syn region eelixirComment matchgroup=eelixirDelimiter start="<%#" end="%\@<!%>" contains=elixirTodo,@Spell containedin=ALLBUT,@eelixirRegions keepend'
" Define the default highlighting.
hi def link eelixirDelimiter PreProc
hi def link eelixirComment Comment
let b:current_syntax = 'eelixir'
if main_syntax == 'eelixir'
unlet main_syntax
endif

View File

@@ -117,7 +117,7 @@ syn keyword elixirDelegateDefine defdelegate nextgroup=elixirDelegateDec
syn keyword elixirOverridableDefine defoverridable nextgroup=elixirOverridableDeclaration skipwhite skipnl syn keyword elixirOverridableDefine defoverridable nextgroup=elixirOverridableDeclaration skipwhite skipnl
syn keyword elixirExceptionDefine defexception nextgroup=elixirExceptionDeclaration skipwhite skipnl syn keyword elixirExceptionDefine defexception nextgroup=elixirExceptionDeclaration skipwhite skipnl
syn keyword elixirCallbackDefine defcallback nextgroup=elixirCallbackDeclaration skipwhite skipnl syn keyword elixirCallbackDefine defcallback nextgroup=elixirCallbackDeclaration skipwhite skipnl
syn keyword elixirStructDefine defstruct nextgroup=elixirStructDeclaration skipwhite skipnl syn keyword elixirStructDefine defstruct skipwhite skipnl
" Declarations " Declarations
syn match elixirModuleDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias nextgroup=elixirBlock skipwhite skipnl syn match elixirModuleDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias nextgroup=elixirBlock skipwhite skipnl
@@ -131,7 +131,6 @@ syn region elixirDelegateDeclaration start='\[' end='\]' contained con
syn match elixirOverridableDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl syn match elixirOverridableDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
syn match elixirExceptionDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl syn match elixirExceptionDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
syn match elixirCallbackDeclaration "[^[:space:];#<,()\[\]]\+" contained contains=elixirFunctionDeclaration skipwhite skipnl syn match elixirCallbackDeclaration "[^[:space:];#<,()\[\]]\+" contained contains=elixirFunctionDeclaration skipwhite skipnl
syn match elixirStructDeclaration "[^[:space:];#<]\+" contained nextgroup=elixirArguments skipwhite skipnl
syn cluster elixirDeclaration contains=elixirFunctionDeclaration,elixirModuleDeclaration,elixirProtocolDeclaration,elixirImplDeclaration,elixirRecordDeclaration,elixirMacroDeclaration,elixirDelegateDeclaration,elixirOverridableDeclaration,elixirExceptionDeclaration,elixirCallbackDeclaration,elixirStructDeclaration syn cluster elixirDeclaration contains=elixirFunctionDeclaration,elixirModuleDeclaration,elixirProtocolDeclaration,elixirImplDeclaration,elixirRecordDeclaration,elixirMacroDeclaration,elixirDelegateDeclaration,elixirOverridableDeclaration,elixirExceptionDeclaration,elixirCallbackDeclaration,elixirStructDeclaration

156
syntax/emblem.vim Normal file
View File

@@ -0,0 +1,156 @@
" Language: emblem
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
" URL: http://github.com/heartsentwined/vim-emblem
" Version: 1.2.0
" Last Change: 2013 Apr 22
" License: GPL-3.0
" Quit when a syntax file is already loaded.
if exists('b:current_syntax') && b:current_syntax == 'emblem'
finish
endif
if !exists('main_syntax')
let main_syntax = 'emblem'
endif
syn match eblLineStart '^\s*' nextgroup=@eblStartElements display
syn match eblLineOp '\s*:' nextgroup=@eblStartElements skipwhite contained display
hi def link eblLineOp eblOperator
syn cluster eblStartElements contains=eblIdOp,eblClassOp,eblHbsOp,@eblHbsHelpers,eblHbsPartialOp,eblView,@eblTag,eblComment,eblText
syn cluster eblComponent contains=eblIdOp,eblClassOp,eblInlineText,eblAttr,eblHbsOp,eblHbsAttrRegion,eblHbsPartialOp,eblLineOp
syn match eblIdOp '#' nextgroup=eblId contained display
syn match eblId '\v(\w|-)+' nextgroup=@eblComponent contained display
syn match eblClassOp '\.' nextgroup=eblClass contained display
syn match eblClass '\v(\w|-)+' nextgroup=@eblComponent contained display
hi def link eblIdOp eblId
hi def link eblClassOp eblClass
syn region eblHbsAttrRegion matchgroup=eblHbsAttrRegionOp start='{' end='}' contains=@eblHbsHelpers nextgroup=@eblComponent keepend contained display
hi def link eblHbsAttrRegionOp eblOperator
syn match eblInlineText '\v\s+[^:]+.*$' contains=eblItpl contained display
hi def link eblInlineText eblRaw
syn cluster eblHbsComponent contains=eblHbsArg,eblHbsAttr,eblHbsTextOp,eblLineOp
syn match eblHbsOp '\v\s*\=+' nextgroup=@eblHbsHelpers skipwhite contained display
syn match eblHbsHelper '\v\w(\w|-|\.)*' nextgroup=@eblHbsComponent skipwhite contained display
syn match eblHbsTextOp '|' nextgroup=eblHbsText contained display
syn match eblHbsText '.*' contained display
hi def link eblHbsOp eblOperator
hi def link eblHbsHelper eblFunction
hi def link eblHbsTextOp eblOperator
hi def link eblHbsText eblRaw
syn cluster eblHbsHelpers contains=eblHbsHelper,eblHbsCtrlFlowHelper,eblHbsEachHelper
syn match eblHbsCtrlFlowHelper '\v<(if|unless|else|with)>' nextgroup=@eblHbsComponent skipwhite contained display
syn match eblHbsEachHelper '\v<each>' nextgroup=eblHbsEachArg skipwhite contained display
syn match eblHbsEachArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblHbsIn,eblLineOp skipwhite contained display
syn match eblHbsIn '\v<in>' nextgroup=eblHbsInArg skipwhite contained display
syn match eblHbsInArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblLineOp skipwhite contained display
hi def link eblHbsCtrlFlowHelper eblKeyword
hi def link eblHbsEachHelper eblKeyword
hi def link eblHbsEachArg eblLiteral
hi def link eblHbsIn eblKeyword
hi def link eblHbsInArg eblLiteral
syn match eblHbsArg /\v\s*((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=@eblHbsComponent skipwhite contained display
syn match eblHbsAttr '\v\s*(\w|-)+\=@=' contains=eblHbsAttrBind nextgroup=eblHbsAttrOp contained display
syn match eblHbsAttrBind /\v<(\w|-)+Bind>/ contained display
syn match eblHbsAttrOp '=' nextgroup=eblHbsAttrLit contained display
syn match eblHbsAttrLit /\v(["'])[^\1]{-}\1|[^: ]+/ contains=eblItpl nextgroup=@eblHbsComponent skipwhite contained display
hi def link eblHbsArg eblLiteral
hi def link eblHbsAttr eblAttr
hi def link eblhbsAttrBind eblBind
hi def link eblHbsAttrOp eblOperator
hi def link eblHbsAttrLit eblLiteral
syn cluster eblAttrComponent contains=eblAttr,eblInlineText,eblLineOp
syn match eblAttr '\v\s*(\w|-)+\=@=' contains=eblKnownEvent nextgroup=eblAttrOp contained display
syn match eblAttrOp '=' nextgroup=eblAttrLit,eblAttrClassLit,eblAttrBind,eblAttrRegion contained display
syn match eblAttrLit /\v(["'])[^\1]{-}\1/ contains=eblItpl nextgroup=@eblAttrComponent skipwhite contained display
syn match eblAttrBind /\v(\w|-)+/ nextgroup=eblAttrBindAltOp,eblAttrBindUnboundOp,@eblAttrComponent skipwhite contained display
syn match eblAttrBindAltOp '\v(\w|-|:)@=:(\w|-|:)@=' nextgroup=eblAttrBindAlt,eblAttrBindAltOp contained display
syn match eblAttrBindAlt /\v(\w|-)+/ nextgroup=eblAttrBindAltOp,@eblAttrComponent skipwhite contained display
syn match eblAttrClassLit '\v:(\w|-)+' nextgroup=@eblAttrComponent skipwhite contained display
syn match eblAttrBindUnboundOp '\v(\w|-)@!!' nextgroup=@eblAttrComponent skipwhite contained display
hi def link eblAttrOp eblOperator
hi def link eblAttrLit eblLiteral
hi def link eblAttrBind eblBind
hi def link eblAttrBindAltOp eblOperator
hi def link eblAttrBindAlt eblBool
hi def link eblAttrClassLit eblLiteral
hi def link eblAttrBindUnboundOp eblOperator
syn region eblAttrRegion matchgroup=eblAttrRegionOp start='{' end='}' keepend contains=eblAttrRegionBind,eblAttrRegionClassLit nextgroup=@eblAttrComponent skipwhite contained display
syn match eblAttrRegionBind /\v(\w|-)+/ nextgroup=eblAttrRegionBindAltOp contained display
syn match eblAttrRegionBindAltOp '\v(\w|-|:)@=:(\w|-|:)@=' nextgroup=eblAttrRegionBindAlt,eblAttrRegionBindAltOp contained display
syn match eblAttrRegionBindAlt /\v(\w|-)+/ nextgroup=eblAttrRegionBindAltOp contained display
syn match eblAttrRegionClassLit '\v:(\w|-)+:@!' nextgroup=eblAttrRegionBind skipwhite contained display
hi def link eblAttrRegionOp eblOperator
hi def link eblAttrRegionBind eblBind
hi def link eblAttrRegionBindAltOp eblOperator
hi def link eblAttrRegionBindAlt eblBool
hi def link eblAttrRegionClassLit eblLiteral
syn match eblKnownEvent '\v\s*<(touchStart|touchMove|touchEnd|touchCancel|keyDown|keyUp|keyPress|mouseDown|mouseUp|contextMenu|click|doubleClick|mouseMove|focusIn|focusOut|mouseEnter|mouseLeave|submit|input|change|dragStart|drag|dragEnter|dragLeave|dragOver|drop|dragEnd)>' contained display
hi def link eblKnownEvent eblEvent
syn region eblItpl matchgroup=eblItplOp start='#{' end='}' contains=@eblHbsHelpers,eblHbsPartialOp keepend contained display
syn region eblItpl matchgroup=eblItplOp start='{{' end='}}' contains=@eblHbsHelpers,eblHbsPartialOp keepend contained display
hi def link eblItplOp eblOperator
syn match eblHbsPartialOp '\s*>' nextgroup=@eblHbsHelpers skipwhite contained display
hi def link eblhbsPartialOp eblOperator
syn match eblView '\v[A-Z](\w|\.)*' nextgroup=@eblViewComponent skipwhite contained display
syn cluster eblViewComponent contains=eblViewIdOp,eblViewClassOp,eblHbsArg,eblHbsAttr,eblLineOp
syn match eblViewIdOp '#' nextgroup=eblViewId contained display
syn match eblViewId '\v(\w|-)+' nextgroup=@eblViewComponent contained display
syn match eblViewClassOp '\.' nextgroup=eblViewClass contained display
syn match eblViewClass '\v(\w|-)+' nextgroup=@eblViewComponent contained display
hi def link eblViewIdOp eblId
hi def link eblViewId eblId
hi def link eblViewClassOp eblClass
hi def link eblViewClass eblClass
syn cluster eblTag contains=eblKnownTag,eblCustomTag
syn match eblKnownTag '\v<(figcaption|blockquote|plaintext|textarea|progress|optgroup|noscript|noframes|frameset|fieldset|datalist|colgroup|basefont|summary|section|marquee|listing|isindex|details|command|caption|bgsound|article|address|acronym|strong|strike|spacer|source|select|script|output|option|object|legend|keygen|iframe|hgroup|header|footer|figure|center|canvas|button|applet|video|track|title|thead|tfoot|tbody|table|style|small|param|meter|label|input|frame|embed|blink|audio|aside|time|span|samp|ruby|nobr|meta|menu|mark|main|link|html|head|form|font|data|code|cite|body|base|area|abbr|xmp|wbr|var|sup|sub|pre|nav|map|kbd|ins|img|div|dir|dfn|del|col|big|bdo|bdi|ul|tt|tr|th|td|rt|rp|ol|li|hr|h6|h5|h4|h3|h2|h1|em|dt|dl|dd|br|u|s|q|p|i|b|a)>' nextgroup=@eblComponent contained display
syn match eblCustomTag '%[a-z][a-z0-9-]*' nextgroup=@eblComponent contained display
hi def link eblKnownTag eblTag
hi def link eblCustomTag eblTag
syn match eblTextOp '\v^(\s*)[|']' contained display
syn region eblText start='\v^\z(\s*)[|']' end='\v^(\z1 )@!' contains=eblTextOp,eblItpl
syn region eblComment start='\v^\z(\s*)/' end='\v^(\z1 )@!'
hi def link eblText eblRaw
hi def link eblTextOp eblOperator
hi def link eblOperator Operator
hi def link eblFunction Function
hi def link eblBool Boolean
hi def link eblLiteral String
hi def link eblRaw NONE
hi def link eblComment Comment
hi def link eblAttr Label
hi def link eblBind Identifier
hi def link eblKeyword Keyword
hi def link eblEvent Special
hi def link eblView Type
hi def link eblTag Type
hi def link eblId Constant
hi def link eblClass Identifier
let b:current_syntax = 'emblem'

View File

@@ -39,9 +39,10 @@ syn region gitcommitDiscarded start=/^# Change\%(s not staged for commit\|d but
syn region gitcommitSelected start=/^# Changes to be committed:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitSelectedType fold syn region gitcommitSelected start=/^# Changes to be committed:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitSelectedType fold
syn region gitcommitUnmerged start=/^# Unmerged paths:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitUnmergedType fold syn region gitcommitUnmerged start=/^# Unmerged paths:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitUnmergedType fold
syn match gitcommitDiscardedType "\t\@<=[a-z][a-z ]*[a-z]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitDiscardedFile skipwhite
syn match gitcommitSelectedType "\t\@<=[a-z][a-z ]*[a-z]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitSelectedFile skipwhite syn match gitcommitDiscardedType "\t\@<=[[:lower:]][^:]*[[:lower:]]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitDiscardedFile skipwhite
syn match gitcommitUnmergedType "\t\@<=[a-z][a-z ]*[a-z]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitUnmergedFile skipwhite syn match gitcommitSelectedType "\t\@<=[[:lower:]][^:]*[[:lower:]]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitSelectedFile skipwhite
syn match gitcommitUnmergedType "\t\@<=[[:lower:]][^:]*[[:lower:]]: "he=e-2 contained containedin=gitcommitComment nextgroup=gitcommitUnmergedFile skipwhite
syn match gitcommitDiscardedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitDiscardedArrow syn match gitcommitDiscardedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitDiscardedArrow
syn match gitcommitSelectedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow syn match gitcommitSelectedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow
syn match gitcommitUnmergedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow syn match gitcommitUnmergedFile ".\{-\}\%($\| -> \)\@=" contained nextgroup=gitcommitSelectedArrow

View File

@@ -1,7 +1,7 @@
" Vim syntax file " Vim syntax file
" Language: git send-email message " Language: git send-email message
" Maintainer: Tim Pope " Maintainer: Tim Pope
" Filenames: *.msg.[0-9]* (first line is "From ... # This line is ignored.") " Filenames: .gitsendemail.*
" Last Change: 2010 May 21 " Last Change: 2010 May 21
if exists("b:current_syntax") if exists("b:current_syntax")
@@ -9,6 +9,10 @@ if exists("b:current_syntax")
endif endif
runtime! syntax/mail.vim runtime! syntax/mail.vim
unlet! b:current_syntax
syn include @gitsendemailDiff syntax/diff.vim
syn region gitsendemailDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ end=/^-- %/ fold contains=@gitsendemailDiff
syn case match syn case match
syn match gitsendemailComment "\%^From.*#.*" syn match gitsendemailComment "\%^From.*#.*"

View File

@@ -32,19 +32,39 @@ endif
if !exists("go_highlight_array_whitespace_error") if !exists("go_highlight_array_whitespace_error")
let go_highlight_array_whitespace_error = 1 let go_highlight_array_whitespace_error = 1
endif endif
if !exists("go_highlight_chan_whitespace_error") if !exists("go_highlight_chan_whitespace_error")
let go_highlight_chan_whitespace_error = 1 let go_highlight_chan_whitespace_error = 1
endif endif
if !exists("go_highlight_extra_types") if !exists("go_highlight_extra_types")
let go_highlight_extra_types = 1 let go_highlight_extra_types = 1
endif endif
if !exists("go_highlight_space_tab_error") if !exists("go_highlight_space_tab_error")
let go_highlight_space_tab_error = 1 let go_highlight_space_tab_error = 1
endif endif
if !exists("go_highlight_trailing_whitespace_error") if !exists("go_highlight_trailing_whitespace_error")
let go_highlight_trailing_whitespace_error = 1 let go_highlight_trailing_whitespace_error = 1
endif endif
if !exists("go_highlight_operators")
let go_highlight_operators = 0
endif
if !exists("go_highlight_functions")
let go_highlight_functions = 0
endif
if !exists("go_highlight_methods")
let go_highlight_methods = 0
endif
if !exists("go_highlight_structs")
let go_highlight_structs = 0
endif
syn case match syn case match
syn keyword goDirective package import syn keyword goDirective package import
@@ -81,8 +101,8 @@ hi def link goComplexes Type
" Treat func specially: it's a declaration at the start of a line, but a type " Treat func specially: it's a declaration at the start of a line, but a type
" elsewhere. Order matters here. " elsewhere. Order matters here.
syn match goType /\<func\>/ syn match goDeclaration /\<func\>/
syn match goDeclaration /^func\>/
" Predefined functions and values " Predefined functions and values
syn keyword goBuiltins append cap close complex copy delete imag len syn keyword goBuiltins append cap close complex copy delete imag len
@@ -197,6 +217,55 @@ endif
hi def link goExtraType Type hi def link goExtraType Type
hi def link goSpaceError Error hi def link goSpaceError Error
" included from: https://github.com/athom/more-colorful.vim/blob/master/after/syntax/go.vim
"
" Comments; their contents
syn keyword goTodo contained NOTE
hi def link goTodo Todo
" Operators;
if go_highlight_operators != 0
syn match goOperator /:=/
syn match goOperator />=/
syn match goOperator /<=/
syn match goOperator /==/
syn match goOperator /!=/
syn match goOperator /+=/
syn match goOperator /-=/
syn match goOperator /\s>\s/
syn match goOperator /\s<\s/
syn match goOperator /\s+\s/
syn match goOperator /\s-\s/
syn match goOperator /\s\*\s/
syn match goOperator /\s\/\s/
syn match goOperator /\s%\s/
endif
hi def link goOperator Operator
" Functions;
if go_highlight_functions != 0
syn match goFunction /\(func\s\+\)\@<=\w\+\((\)\@=/
syn match goFunction /\()\s\+\)\@<=\w\+\((\)\@=/
endif
hi def link goFunction Function
" Methods;
if go_highlight_methods != 0
syn match goMethod /\(\.\)\@<=\w\+\((\)\@=/
endif
hi def link goMethod Type
" Structs;
if go_highlight_structs != 0
syn match goStruct /\(.\)\@<=\w\+\({\)\@=/
syn match goStructDef /\(type\s\+\)\@<=\w\+\(\s\+struct\s\+{\)\@=/
endif
hi def link goStruct Function
hi def link goStructDef Function
" Search backwards for a global declaration to start processing the syntax. " Search backwards for a global declaration to start processing the syntax.
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/ "syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/

View File

@@ -7,13 +7,40 @@ if exists("b:current_syntax")
endif endif
syn case match syn case match
syn match godocTitle "^\([A-Z][A-Z ]*\)$"
command -nargs=+ HiLink hi def link <args> syn match godocTitle "^\([A-Z][A-Z ]*\)$"
hi def link godocTitle Title
HiLink godocTitle Title " Single Line Definitions
syn match godocMethodRec /\i\+\ze)/ contained
syn match godocMethodName /) \zs\i\+\ze(/ contained
syn match godocMethod /^func \((\i\+ [^)]*)\) \i\+(/ contains=godocMethodRec,godocMethodName
syn match godocFunction /^func \zs\i\+\ze(/
delcommand HiLink syn match godocType /^type \zs\i\+\ze.*/
syn match godocVar /^var \zs\i\+\ze.*/
syn match godocConst /^const \zs\i\+\ze.*/
hi def link godocMethodRec Type
hi def link godocType Type
hi def link godocMethodName Function
hi def link godocFunction Function
hi def link godocVar Identifier
hi def link godocConst Identifier
" Definition Blocks
syn region godocComment start="/\*" end="\*/" contained
syn region godocComment start="//" end="$" contained
syn match godocDefinition /^\s\+\i\+/ contained
syn region godocVarBlock start=/^var (/ end=/^)/ contains=godocComment,godocDefinition
syn region godocConstBlock start=/^const (/ end=/^)/ contains=godocComment,godocDefinition
syn region godocTypeBlock start=/^type \i\+ \(interface\|struct\) {/ end=/^}/ matchgroup=godocType contains=godocComment,godocType
hi def link godocComment Comment
hi def link godocDefinition Identifier
syn sync minlines=500
let b:current_syntax = "godoc" let b:current_syntax = "godoc"

View File

@@ -27,7 +27,7 @@ syn match hsFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
" a capital letter. Note that this also handles the case of @M.lookup@ where " a capital letter. Note that this also handles the case of @M.lookup@ where
" M is a qualified import. There is a big negative lookbehind assertion here " M is a qualified import. There is a big negative lookbehind assertion here
" so that we don't highlight import and module statements oddly. " so that we don't highlight import and module statements oddly.
syn match hsTypeName "\(^import\s.*\|^module\s.*\)\@<!\([^a-zA-Z0-9]\)\@<=[A-Z][a-zA-Z0-9_]*" syn match hsTypeName "\(^import\s.*\|^module\s.*\)\@<!\(^\|[^a-zA-Z0-9]\)\@<=[A-Z][a-zA-Z0-9_]*"
" Also make unit and the empty list easy to spot - they are constructors too. " Also make unit and the empty list easy to spot - they are constructors too.
syn match hsTypeName "()" syn match hsTypeName "()"
syn match hsTypeName "\[\]" syn match hsTypeName "\[\]"
@@ -37,24 +37,26 @@ syn keyword hsFIXME contained FIXME TODO XXX BUG NOTE
" Comment stuff " Comment stuff
syn region hsPragma start='{-#' end='#-}' syn region hsPragma start='{-#' end='#-}'
syn region hsBlockComment start='{-' end='-}' fold contains=hsFIXME,hsBlockComment syn region hsBlockComment start='{-' end='-}' fold contains=hsFIXME,hsBlockComment,@Spell
" FIXME: haddock block comments should be able to contain hsBlockComments, but " FIXME: haddock block comments should be able to contain hsBlockComments, but
" it doesn't seem to work at the moment. " it doesn't seem to work at the moment.
syn region hsHaddockComment start='{-|' end='-}' contains=hsFIXME syn region hsHaddockComment start='{-|' end='-}' contains=hsFIXME,@Spell
syn match hsLineComment "--.*$" contains=hsFIXME syn match hsLineComment "--.*$" contains=hsFIXME,@Spell
" Line-based haddock comments are trickier - they continue until " Line-based haddock comments are trickier - they continue until
" the next line that isn't part of the same block of comments. " the next line that isn't part of the same block of comments.
syn region hsHaddockComment start='-- |' end='^\(\s*--\)\@!' contains=hsFIXME syn region hsHaddockComment start='-- |' end='^\(\s*--\)\@!' contains=hsFIXME,@Spell
syn region hsHaddockComment start='-- \$\w\+' end='^\(\s*--\)\@!' contains=hsFIXME syn region hsHaddockComment start='-- \$\w\+' end='^\(\s*--\)\@!' contains=hsFIXME,@Spell
syn region hsHaddockComment start='-- ^' end='^\(\s*--\)\@!' contains=hsFIXME syn region hsHaddockComment start='-- ^' end='^\(\s*--\)\@!' contains=hsFIXME,@Spell
" Haddock sections for import lists " Haddock sections for import lists
syn match hsHaddockSection '-- \*.*$' syn match hsHaddockSection '-- \*.*$'
" Named documentation chunks (also for import lists) " Named documentation chunks (also for import lists)
syn match hsHaddockSection '-- \$.*$' syn match hsHaddockSection '-- \$.*$'
" Treat a shebang line at the start of the file as a comment
syn match hsLineComment "\%^\#\!.*$"
" Keywords appearing in expressions, plus a few top-level keywords " Keywords appearing in expressions, plus a few top-level keywords
syn keyword hsKeyword do let in _ where syn keyword hsKeyword do mdo let in _ where
syn keyword hsKeyword infix infixl infixr syn keyword hsKeyword infix infixl infixr
syn keyword hsKeyword forall foreign syn keyword hsKeyword forall foreign
syn match hsKeyword '\(^\(data\|type\)\s\+\)\@<=family\(\W\)\@=' syn match hsKeyword '\(^\(data\|type\)\s\+\)\@<=family\(\W\)\@='
@@ -68,21 +70,19 @@ syn keyword hsConditional case of if then else
" headers (-- *) can be highlighted specially only within this context. " headers (-- *) can be highlighted specially only within this context.
syn region hsModuleHeader start="^module\s" end="where" contains=hsHaddockSection keepend fold transparent syn region hsModuleHeader start="^module\s" end="where" contains=hsHaddockSection keepend fold transparent
" Treat Module imports as the #include category; it maps reasonably well " Treat Module imports as the #include category; it maps reasonably well
syn keyword hsImport import qualified as hiding module syn keyword hsImport import module
" Treat 'qualified', 'as', and 'hiding' as keywords when following 'import'
syn match hsImport '\(\<import\>.*\)\@<=\<\(qualified\|as\|hiding\)\>'
syn keyword hsTypeDecls class instance data newtype type deriving default syn keyword hsTypeDecls class instance data newtype type deriving default
" FIXME: Maybe we can do something fancy for data/type families? 'family' is " FIXME: Maybe we can do something fancy for data/type families? 'family' is
" only a keyword if it follows data/type... " only a keyword if it follows data/type...
" This is uglier than I'd like. We want to let '-' participate in operators, " We want to let '-' participate in operators, but we can't let it match
" but we can't let it match '--' because that interferes with comments. Hacks " '--', '---', etc. because it interferes with comments. The same goes for
" for now - just include some common operators with '-'. " '#!' at the start of a file. Also, the dot (.) is an operator character,
syn match hsOperator "<-\|->\|-->\|-\(-\)\@!\|[%\~\&\*/\$\^|@:+<!>=#!\?]\+" " but not when it comes immediately after a module name.
" A bare . is an operator (but not surrounded by alnum chars) syn match hsOperator "\(\%^\#\!\)\@!\(\(\<[A-Z]\w*\)\@64<=\.\)\@!\(--\+\([^.%\~\&\*/\$\^|@:+<!>=#!\?]\|$\)\)\@![-.%\~\&\*/\$\^|@:+<!>=#!\?]\+"
syn match hsOperator "\s\@<=\.\s\@="
" . is also an operator if adjacent to some other operator char
syn match hsOperator "[%\~\&\*\$\^|@:+<!>=#!\?]\+\.[%\~\&\*\$\^|@:+<\.!>=#!\?]*"
syn match hsOperator "[%\~\&\*\$\^|@:+<!>=#!\?]*\.[%\~\&\*\$\^|@:+\.<!>=#!\?]\+"
" Include support for infix functions as operators " Include support for infix functions as operators
syn match hsOperator "`[a-zA-Z0-9\.]\+`" syn match hsOperator "`[a-zA-Z0-9\.]\+`"
@@ -90,11 +90,11 @@ syn match hsOperator "`[a-zA-Z0-9\.]\+`"
" after a name. This allows whitespace before the name so that it can match " after a name. This allows whitespace before the name so that it can match
" in a 'where,' but it won't match local type annotations on random little " in a 'where,' but it won't match local type annotations on random little
" things. " things.
syn match hsFunctionList "^\s*\([a-z][a-zA-Z0-9']*[[:space:]\n,]\+\)*[a-z][a-zA-Z0-9']*[[:space:]\n]*::" contains=hsFunction syn match hsFunctionList "^\s*\(\<\(where\>\|let\>\)\@![a-z][a-zA-Z0-9']*[[:space:]\n,]\+\)*[a-z][a-zA-Z0-9']*[[:space:]\n]*::" contains=hsFunction
syn match hsFunction "\s*[a-z][a-zA-Z0-9']*[[:space:]\n]*\(::\|,\)\@=" contained syn match hsFunction "\s*[a-z][a-zA-Z0-9']*\([[:space:]\n]*\(::\|,\)\)\@=" contained
" Also support the style where the first where binding is on the same line as " Also support the style where the first where binding is on the same line as
" the where keyword. " the where keyword.
syn match hsFunction "\(^\s\+where\s\+\)\@<=[a-z][a-zA-Z0-9']*\(\s*::\)\@=" syn match hsFunction "\(\<\(where\|let\)\s\+\([a-z][a-zA-Z0-9']*\s*,\s*\)*\)\@<=[a-z][a-zA-Z0-9']*\(\s*\(,\s*[a-z][a-zA-Z0-9']*\s*\)*::\)\@="
" FIXME Ignoring proc for now, also mdo and rec " FIXME Ignoring proc for now, also mdo and rec

View File

@@ -27,15 +27,15 @@ syn cluster htmlJavascript add=javascriptParenthesisBlock
syn region jadeJavascript matchgroup=jadeJavascriptOutputChar start="[!&]\==\|\~" skip=",\s*$" end="$" contained contains=@htmlJavascript keepend syn region jadeJavascript matchgroup=jadeJavascriptOutputChar start="[!&]\==\|\~" skip=",\s*$" end="$" contained contains=@htmlJavascript keepend
syn region jadeJavascript matchgroup=jadeJavascriptChar start="-" skip=",\s*$" end="$" contained contains=@htmlJavascript keepend syn region jadeJavascript matchgroup=jadeJavascriptChar start="-" skip=",\s*$" end="$" contained contains=@htmlJavascript keepend
syn cluster jadeTop contains=jadeBegin,jadeComment,jadeHtmlComment,jadeJavascript syn cluster jadeTop contains=jadeBegin,jadeComment,jadeHtmlComment,jadeJavascript
syn match jadeBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=jadeTag,jadeClassChar,jadeIdChar,jadePlainChar,jadeJavascript,jadeScriptConditional,jadeScriptStatement syn match jadeBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=jadeTag,jadeClassChar,jadeIdChar,jadePlainChar,jadeJavascript,jadeScriptConditional,jadeScriptStatement,jadePipedText
syn match jadeTag "+\?\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@jadeComponent syn match jadeTag "+\?\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@jadeComponent
syn cluster jadeComponent contains=jadeAttributes,jadeIdChar,jadeBlockExpansionChar,jadeClassChar,jadePlainChar,jadeJavascript syn cluster jadeComponent contains=jadeAttributes,jadeIdChar,jadeBlockExpansionChar,jadeClassChar,jadePlainChar,jadeJavascript,jadeTagBlockChar,jadeTagInlineText
syn match jadeComment '\s*\/\/.*$' syn match jadeComment '\s*\/\/.*$'
syn region jadeHtmlComment start="^\z(\s*\)/" end="^\%(\z1\s\|\s*$\)\@!" syn region jadeHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->"
syn region jadeAttributes matchgroup=jadeAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,jadeHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@jadeComponent syn region jadeAttributes matchgroup=jadeAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,jadeHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@jadeComponent
syn match jadeClassChar "\." contained nextgroup=jadeClass syn match jadeClassChar "\." contained nextgroup=jadeClass
syn match jadeBlockExpansionChar ":\s" contained nextgroup=jadeTag syn match jadeBlockExpansionChar ":\s\+" contained nextgroup=jadeTag
syn match jadeIdChar "#{\@!" contained nextgroup=jadeId syn match jadeIdChar "#[[{]\@!" contained nextgroup=jadeId
syn match jadeClass "\%(\w\|-\)\+" contained nextgroup=@jadeComponent syn match jadeClass "\%(\w\|-\)\+" contained nextgroup=@jadeComponent
syn match jadeId "\%(\w\|-\)\+" contained nextgroup=@jadeComponent syn match jadeId "\%(\w\|-\)\+" contained nextgroup=@jadeComponent
syn region jadeDocType start="^\s*\(!!!\|doctype\)" end="$" syn region jadeDocType start="^\s*\(!!!\|doctype\)" end="$"
@@ -47,6 +47,12 @@ syn keyword jadeHtmlArg contained href title
syn match jadePlainChar "\\" contained syn match jadePlainChar "\\" contained
syn region jadeInterpolation matchgroup=jadeInterpolationDelimiter start="#{" end="}" contains=@htmlJavascript syn region jadeInterpolation matchgroup=jadeInterpolationDelimiter start="#{" end="}" contains=@htmlJavascript
syn match jadeInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)" syn match jadeInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)"
syn match jadeTagInlineText "\s.*$" contained contains=jadeInterpolation,jadeTextInlineJade
syn region jadePipedText matchgroup=jadePipeChar start="|" end="$" contained contains=jadeInterpolation,jadeTextInlineJade nextgroup=jadePipedText skipnl
syn match jadeTagBlockChar "\.$" contained nextgroup=jadeTagBlockText,jadeTagBlockEnd skipnl
syn region jadeTagBlockText start="\%(\s*\)\S" end="\ze\n" contained contains=jadeInterpolation,jadeTextInlineJade nextgroup=jadeTagBlockText,jadeTagBlockEnd skipnl
syn region jadeTagBlockEnd start="\s*\S" end="$" contained contains=jadeInterpolation,jadeTextInlineJade nextgroup=jadeBegin skipnl
syn region jadeTextInlineJade matchgroup=jadeInlineDelimiter start="#\[" end="]" contained contains=jadeTag keepend
syn region jadeJavascriptFilter matchgroup=jadeFilter start="^\z(\s*\):javascript\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript syn region jadeJavascriptFilter matchgroup=jadeFilter start="^\z(\s*\):javascript\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript
syn region jadeCoffeescriptFilter matchgroup=jadeFilter start="^\z(\s*\):coffeescript\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlCoffeescript syn region jadeCoffeescriptFilter matchgroup=jadeFilter start="^\z(\s*\):coffeescript\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlCoffeescript
@@ -55,9 +61,9 @@ syn region jadeStylusFilter matchgroup=jadeFilter start="^\z(\s*\):stylus\s*$"
syn region jadePlainFilter matchgroup=jadeFilter start="^\z(\s*\):\%(sass\|less\|cdata\)\s*$" end="^\%(\z1\s\|\s*$\)\@!" syn region jadePlainFilter matchgroup=jadeFilter start="^\z(\s*\):\%(sass\|less\|cdata\)\s*$" end="^\%(\z1\s\|\s*$\)\@!"
syn match jadeScriptConditional "^\s*\<\%(if\|else\|unless\|while\|until\|case\|when\|default\)\>[?!]\@!" syn match jadeScriptConditional "^\s*\<\%(if\|else\|unless\|while\|until\|case\|when\|default\)\>[?!]\@!"
syn region jadeScriptLoopRegion start="^\s*\(for\)" end="$" contains=jadeScriptLoopKeywords syn match jadeScriptStatement "^\s*\<\%(each\|for\|block\|prepend\|append\|mixin\|extends\|include\)\>[?!]\@!"
syn region jadeScriptLoopRegion start="^\s*\(for \)" end="$" contains=jadeScriptLoopKeywords
syn keyword jadeScriptLoopKeywords for in contained syn keyword jadeScriptLoopKeywords for in contained
syn match jadeScriptStatement "^\s*\<\%(each\|block\|prepend\|append\|mixin\|extends\|include\)\>[?!]\@!"
syn region jadeJavascript start="^\z(\s*\)script\%(:\w\+\)\=" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript,jadeJavascriptTag keepend syn region jadeJavascript start="^\z(\s*\)script\%(:\w\+\)\=" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript,jadeJavascriptTag keepend
syn region jadeJavascriptTag contained start="^\z(\s*\)script\%(:\w\+\)\=" end="$" contains=jadeBegin,jadeTag syn region jadeJavascriptTag contained start="^\z(\s*\)script\%(:\w\+\)\=" end="$" contains=jadeBegin,jadeTag
@@ -75,13 +81,16 @@ hi def link jadeAttributesDelimiter Identifier
hi def link jadeIdChar Special hi def link jadeIdChar Special
hi def link jadeClassChar Special hi def link jadeClassChar Special
hi def link jadeBlockExpansionChar Special hi def link jadeBlockExpansionChar Special
hi def link jadePipeChar Special
hi def link jadeTagBlockChar Special
hi def link jadeId Identifier hi def link jadeId Identifier
hi def link jadeClass Type hi def link jadeClass Type
hi def link jadeInterpolationDelimiter Delimiter hi def link jadeInterpolationDelimiter Delimiter
hi def link jadeInlineDelimiter Delimiter
hi def link jadeFilter PreProc hi def link jadeFilter PreProc
hi def link jadeDocType PreProc hi def link jadeDocType PreProc
hi def link jadeComment Comment hi def link jadeComment Comment
hi def link jadeHtmlComment jadeComment hi def link jadeHtmlConditionalComment jadeComment
let b:current_syntax = "jade" let b:current_syntax = "jade"

View File

@@ -75,18 +75,20 @@ syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" conta
syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained
syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline
syn region markdownItalic start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" keepend contains=markdownLineStart let s:concealends = has('conceal') ? ' concealends' : ''
syn region markdownItalic start="\S\@<=_\|_\S\@=" end="\S\@<=_\|_\S\@=" keepend contains=markdownLineStart exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" keepend contains=markdownLineStart' . s:concealends
syn region markdownBold start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend contains=markdownLineStart,markdownItalic exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=_\|_\S\@=" end="\S\@<=_\|_\S\@=" keepend contains=markdownLineStart' . s:concealends
syn region markdownBold start="\S\@<=__\|__\S\@=" end="\S\@<=__\|__\S\@=" keepend contains=markdownLineStart,markdownItalic exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend contains=markdownLineStart,markdownItalic' . s:concealends
syn region markdownBoldItalic start="\S\@<=\*\*\*\|\*\*\*\S\@=" end="\S\@<=\*\*\*\|\*\*\*\S\@=" keepend contains=markdownLineStart exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=__\|__\S\@=" end="\S\@<=__\|__\S\@=" keepend contains=markdownLineStart,markdownItalic' . s:concealends
syn region markdownBoldItalic start="\S\@<=___\|___\S\@=" end="\S\@<=___\|___\S\@=" keepend contains=markdownLineStart exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\S\@<=\*\*\*\|\*\*\*\S\@=" end="\S\@<=\*\*\*\|\*\*\*\S\@=" keepend contains=markdownLineStart' . s:concealends
exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\S\@<=___\|___\S\@=" end="\S\@<=___\|___\S\@=" keepend contains=markdownLineStart' . s:concealends
syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepend contains=markdownLineStart syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepend contains=markdownLineStart
syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart
syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*```.*$" end="^\s*```\ze\s*$" keepend syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*```.*$" end="^\s*```\ze\s*$" keepend
syn match markdownFootnote "\[^[^\]]\]\s*$" syn match markdownFootnote "\[^[^\]]\+\]"
syn match markdownFootnoteDefinition "^\[^[^\]]\]:" syn match markdownFootnoteDefinition "^\[^[^\]]\+\]:"
if main_syntax ==# 'markdown' if main_syntax ==# 'markdown'
for s:type in g:markdown_fenced_languages for s:type in g:markdown_fenced_languages
@@ -125,8 +127,11 @@ hi def link markdownUrlDelimiter htmlTag
hi def link markdownUrlTitleDelimiter Delimiter hi def link markdownUrlTitleDelimiter Delimiter
hi def link markdownItalic htmlItalic hi def link markdownItalic htmlItalic
hi def link markdownItalicDelimiter markdownItalic
hi def link markdownBold htmlBold hi def link markdownBold htmlBold
hi def link markdownBoldDelimiter markdownBold
hi def link markdownBoldItalic htmlBoldItalic hi def link markdownBoldItalic htmlBoldItalic
hi def link markdownBoldItalicDelimiter markdownBoldItalic
hi def link markdownCodeDelimiter Delimiter hi def link markdownCodeDelimiter Delimiter
hi def link markdownEscape Special hi def link markdownEscape Special

View File

@@ -40,10 +40,10 @@ else
endif endif
syntax match mustacheError '}}}\?' syntax match mustacheError '}}}\?'
syntax match mustacheInsideError '{{[{#<>=!\/]\?' syntax match mustacheInsideError '{{[{$#<>=!\/]\?'
syntax region mustacheInside start=/{{/ end=/}}}\?/ keepend containedin=TOP,@htmlMustacheContainer syntax region mustacheInside start=/{{/ end=/}}}\?/ keepend containedin=TOP,@htmlMustacheContainer
syntax match mustacheOperators '=\|\.\|/' contained containedin=mustacheInside,@htmlMustacheContainer syntax match mustacheOperators '=\|\.\|/' contained containedin=mustacheInside,@htmlMustacheContainer
syntax region mustacheSection start='{{[#^/]'lc=2 end=/}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer syntax region mustacheSection start='{{[$#^/]'lc=2 end=/}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer
syntax region mustachePartial start=/{{[<>]/lc=2 end=/}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer syntax region mustachePartial start=/{{[<>]/lc=2 end=/}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer
syntax region mustacheMarkerSet start=/{{=/lc=2 end=/=}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer syntax region mustacheMarkerSet start=/{{=/lc=2 end=/=}}/me=e-2 contained containedin=mustacheInside,@htmlMustacheContainer
syntax match mustacheHandlebars '{{\|}}' contained containedin=mustacheInside,@htmlMustacheContainer syntax match mustacheHandlebars '{{\|}}' contained containedin=mustacheInside,@htmlMustacheContainer

View File

@@ -28,7 +28,7 @@
" unlet perl_fold " unlet perl_fold
" unlet perl_fold_blocks " unlet perl_fold_blocks
" unlet perl_nofold_packages " unlet perl_nofold_packages
" let perl_nofold_subs = 1 " unlet perl_nofold_subs
" unlet perl_fold_anonymous_subs " unlet perl_fold_anonymous_subs
" unlet perl_no_subprototype_error " unlet perl_no_subprototype_error
@@ -145,11 +145,11 @@ syn match perlPackageRef "[$@#%*&]\%(\%(::\|'\)\=\I\i*\%(\%(::\|'\)\I\i*\)*\)\
if !exists("perl_no_scope_in_variables") if !exists("perl_no_scope_in_variables")
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
else else
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
endif endif
@@ -172,7 +172,9 @@ if !exists("perl_no_extended_vars")
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
syn match perlPackageConst "__PACKAGE__" nextgroup=perlMethod,perlPostDeref syn match perlPackageConst "__PACKAGE__" nextgroup=perlMethod,perlPostDeref
syn match perlMethod "->\$*\I\i*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref syn match perlMethod "->\$*\I\i*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
syn match perlPostDeref "->\%($#\|[$@%]\)\*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref syn match perlPostDeref "->\%($#\|[$@%&*]\)\*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
syn region perlPostDeref start="->\%($#\|[$@%&*]\)\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
syn region perlPostDeref matchgroup=perlPostDeref start="->\%($#\|[$@%&*]\){" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
endif endif
" File Descriptors " File Descriptors
@@ -369,9 +371,12 @@ else
endif endif
if !exists("perl_no_subprototype_error") " Set 1 if using signatures feature in perl5.19.9 if !exists("perl_no_subprototype_error") " Set 1 if using signatures feature in perl5.19.9
syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
syn match perlSubPrototype +(\_[^)]*)\_s*\|+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError syn match perlSubPrototype +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError
else
syntax match perlSignature "(.\{-})" nextgroup=perlSubAttributes,perlComment contained
endif endif
syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype,perlComment
syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype,perlSignature,perlSubAttributes,perlComment
syn match perlFunction +\<sub\>\_s*+ nextgroup=perlSubName syn match perlFunction +\<sub\>\_s*+ nextgroup=perlSubName
@@ -456,6 +461,7 @@ HiLink perlOperator Operator
HiLink perlFunction Keyword HiLink perlFunction Keyword
HiLink perlSubName Function HiLink perlSubName Function
HiLink perlSubPrototype Type HiLink perlSubPrototype Type
HiLink perlSignature Type
HiLink perlSubAttributes PreProc HiLink perlSubAttributes PreProc
HiLink perlSubAttributesCont perlSubAttributes HiLink perlSubAttributesCont perlSubAttributes
HiLink perlComment Comment HiLink perlComment Comment

View File

@@ -235,7 +235,7 @@ let s:routines = [
\ "acos acosh atanh sech cosech cotanh sech acosech acotanh asech ok", \ "acos acosh atanh sech cosech cotanh sech acosech acotanh asech ok",
\ "plan_ok dies_ok lives_ok skip todo pass flunk force_todo use_ok isa_ok", \ "plan_ok dies_ok lives_ok skip todo pass flunk force_todo use_ok isa_ok",
\ "diag is_deeply isnt like skip_rest unlike cmp_ok eval_dies_ok nok_error", \ "diag is_deeply isnt like skip_rest unlike cmp_ok eval_dies_ok nok_error",
\ "eval_lives_ok approx is_approx throws_ok version_lt plan eval succ pred", \ "eval_lives_ok approx is_approx throws_ok version_lt plan EVAL succ pred",
\ "times nonce once signature new connect operator undef undefine sleep", \ "times nonce once signature new connect operator undef undefine sleep",
\ "from to infix postfix prefix circumfix postcircumfix minmax lazy count", \ "from to infix postfix prefix circumfix postcircumfix minmax lazy count",
\ "unwrap getc pi e context void quasi body each contains rewinddir subst", \ "unwrap getc pi e context void quasi body each contains rewinddir subst",

View File

@@ -3,7 +3,7 @@
" "
" {{{ BLOCK: Last-modified " {{{ BLOCK: Last-modified
" Mon, 02 Jun 2014 07:13:11 +0000, PHP 5.6.0beta3 " Thu, 14 Aug 2014 09:05:56 +0000, PHP 5.6.0RC2
" }}} " }}}
" "
@@ -33,11 +33,19 @@
" (Statements) in your code. " (Statements) in your code.
" "
" Options: php_sql_query = 1 for SQL syntax highlighting inside strings (default: 0) " Options: php_sql_query = 1 for SQL syntax highlighting inside strings (default: 0)
" php_sql_heredoc = 1 for SQL syntax highlighting inside heredocs (default: 1)
" b:sql_type_override = 'postgresql' for PostgreSQL syntax highlighting in current buffer (default: 'mysql')
" g:sql_type_default = 'postgresql' to set global SQL syntax highlighting language default (default: 'mysql')"
" php_html_in_strings = 1 for HTML syntax highlighting inside strings (default: 0) " php_html_in_strings = 1 for HTML syntax highlighting inside strings (default: 0)
" php_html_in_heredoc = 1 for HTML syntax highlighting inside heredocs (default: 1)
" php_html_load = 1 for loading the HTML syntax at all. Overwrites php_html_in_strings and php_html_in_heredoc (default: 1)
" php_ignore_phpdoc = 0 for not highlighting parts of phpDocs
" php_parent_error_close = 1 for highlighting parent error ] or ) (default: 0) " php_parent_error_close = 1 for highlighting parent error ] or ) (default: 0)
" php_parent_error_open = 1 for skipping an php end tag, " php_parent_error_open = 1 for skipping an php end tag,
" if there exists an open ( or [ without a closing one (default: 0) " if there exists an open ( or [ without a closing one (default: 0)
" php_folding = 1 for folding classes and functions " php_folding = 1 for folding loops, if/elseif/else, switch, try/catch, classes, and functions based on
" indent, finds a } with an indent matching the structure.
" 2 for folding all { }, ( ), and [ ] pairs. (see known bugs ii)
" php_sync_method = x " php_sync_method = x
" x=-1 to sync by search ( default ) " x=-1 to sync by search ( default )
" x>0 to sync at least x lines backwards " x>0 to sync at least x lines backwards
@@ -52,12 +60,6 @@
" g:php_syntax_extensions_disabled A list of extension names (lowercase) for which built-in functions, " g:php_syntax_extensions_disabled A list of extension names (lowercase) for which built-in functions,
" constants, classes and interfaces is enabled / disabled. " constants, classes and interfaces is enabled / disabled.
" "
" Note:
" Setting php_folding=1 will match a closing } by comparing the indent
" before the class or function keyword with the indent of a matching }.
" Setting php_folding=2 will match all of pairs of {,} ( see known
" bugs ii )
"
" Known Bugs: " Known Bugs:
" - setting php_parent_error_close on and php_parent_error_open off " - setting php_parent_error_close on and php_parent_error_open off
" has these two leaks: " has these two leaks:
@@ -83,10 +85,35 @@ if !exists("main_syntax")
let main_syntax = 'php' let main_syntax = 'php'
endif endif
runtime! syntax/html.vim " Save the 'iskeyword' setting before including the HTML syntax.
unlet! b:current_syntax " See https://github.com/pangloss/vim-javascript/issues/153
" HTML syntax file turns on spelling for all top level words, we attempt to turn off let s:iskeyword_save = &iskeyword
syntax spell default
if !exists("php_html_load")
let php_html_load=1
endif
if (exists("php_html_load") && php_html_load)
if !exists("php_html_in_heredoc")
let php_html_in_heredoc=1
endif
runtime! syntax/html.vim
unlet! b:current_syntax
" HTML syntax file turns on spelling for all top level words, we attempt to turn off
syntax spell default
syn cluster htmlPreproc add=phpRegion
else
" If it is desired that the HTML syntax file not be loaded at all, set the options for highlighting it in string
" and heredocs to false.
let php_html_in_strings=0
let php_html_in_heredoc=0
endif
if (exists("php_html_in_strings") && php_html_in_strings)
syn cluster phpAddStrings add=@htmlTop
endif
" Set sync method if none declared " Set sync method if none declared
if ( ! exists("php_sync_method") || php_sync_method == 1) if ( ! exists("php_sync_method") || php_sync_method == 1)
@@ -97,27 +124,42 @@ if ( ! exists("php_sync_method") || php_sync_method == 1)
endif endif
endif endif
syn cluster htmlPreproc add=phpRegion if !exists("php_sql_heredoc")
let php_sql_heredoc=1
" Use MySQL as the default SQL syntax file.
" See https://github.com/StanAngeloff/php.vim/pull/1
if !exists('b:sql_type_override') && !exists('g:sql_type_default')
let b:sql_type_override='mysql'
endif
syn include @sqlTop syntax/sql.vim
syn sync clear
unlet! b:current_syntax
syn cluster sqlTop remove=sqlString,sqlComment
if (exists("php_sql_query") && php_sql_query)
syn cluster phpAddStrings contains=@sqlTop
endif endif
if (exists("php_html_in_strings") && php_html_in_strings) if ((exists("php_sql_query") && php_sql_query) || (exists("php_sql_heredoc") && php_sql_heredoc))
syn cluster phpAddStrings add=@htmlTop " Use MySQL as the default SQL syntax file.
" See https://github.com/StanAngeloff/php.vim/pull/1
if !exists('b:sql_type_override') && !exists('g:sql_type_default')
let b:sql_type_override='mysql'
endif
syn include @sqlTop syntax/sql.vim
syn sync clear
unlet! b:current_syntax
syn cluster sqlTop remove=sqlString,sqlComment
if (exists("php_sql_query") && php_sql_query)
syn cluster phpAddStrings contains=@sqlTop
endif
endif endif
" set default for php_folding so we don't have to keep checking its existence.
if !exists("php_folding")
let php_folding = 0
endif
" Folding Support {{{
"
if php_folding==1 && has("folding")
command! -nargs=+ SynFold <args> fold
else
command! -nargs=+ SynFold <args>
endif
" }}}
syn case match syn case match
" Superglobals " Superglobals
@@ -140,7 +182,7 @@ endif
syn case match syn case match
if index(g:php_syntax_extensions_enabled, "core") >= 0 && index(g:php_syntax_extensions_disabled, "core") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "core") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "core") < 0) if index(g:php_syntax_extensions_enabled, "core") >= 0 && index(g:php_syntax_extensions_disabled, "core") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "core") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "core") < 0)
" Core constants " Core constants
syn keyword phpConstants DEBUG_BACKTRACE_IGNORE_ARGS DEBUG_BACKTRACE_PROVIDE_OBJECT DEFAULT_INCLUDE_PATH E_ALL E_COMPILE_ERROR E_COMPILE_WARNING E_CORE_ERROR E_CORE_WARNING E_DEPRECATED E_ERROR E_NOTICE E_PARSE E_RECOVERABLE_ERROR E_STRICT E_USER_DEPRECATED E_USER_ERROR E_USER_NOTICE E_USER_WARNING E_WARNING FALSE NULL PEAR_EXTENSION_DIR PEAR_INSTALL_DIR PHP_BINARY PHP_BINDIR PHP_CONFIG_FILE_PATH PHP_CONFIG_FILE_SCAN_DIR PHP_DATADIR PHP_DEBUG PHP_EOL PHP_EXTENSION_DIR PHP_EXTRA_VERSION PHP_INT_MAX PHP_INT_SIZE PHP_LIBDIR PHP_LOCALSTATEDIR PHP_MAJOR_VERSION PHP_MANDIR PHP_MAXPATHLEN PHP_MINOR_VERSION PHP_OS PHP_OUTPUT_HANDLER_CLEAN PHP_OUTPUT_HANDLER_CLEANABLE PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_DISABLED PHP_OUTPUT_HANDLER_END PHP_OUTPUT_HANDLER_FINAL PHP_OUTPUT_HANDLER_FLUSH PHP_OUTPUT_HANDLER_FLUSHABLE PHP_OUTPUT_HANDLER_REMOVABLE PHP_OUTPUT_HANDLER_START PHP_OUTPUT_HANDLER_STARTED PHP_OUTPUT_HANDLER_STDFLAGS PHP_OUTPUT_HANDLER_WRITE PHP_PREFIX PHP_RELEASE_VERSION PHP_SAPI PHP_SHLIB_SUFFIX PHP_SYSCONFDIR PHP_VERSION PHP_VERSION_ID PHP_ZTS STDERR STDIN STDOUT TRUE UPLOAD_ERR_CANT_WRITE UPLOAD_ERR_EXTENSION UPLOAD_ERR_FORM_SIZE UPLOAD_ERR_INI_SIZE UPLOAD_ERR_NO_FILE UPLOAD_ERR_NO_TMP_DIR UPLOAD_ERR_OK UPLOAD_ERR_PARTIAL ZEND_DEBUG_BUILD ZEND_THREAD_SAFE contained syn keyword phpConstants DEBUG_BACKTRACE_IGNORE_ARGS DEBUG_BACKTRACE_PROVIDE_OBJECT DEFAULT_INCLUDE_PATH E_ALL E_COMPILE_ERROR E_COMPILE_WARNING E_CORE_ERROR E_CORE_WARNING E_DEPRECATED E_ERROR E_NOTICE E_PARSE E_RECOVERABLE_ERROR E_STRICT E_USER_DEPRECATED E_USER_ERROR E_USER_NOTICE E_USER_WARNING E_WARNING PEAR_EXTENSION_DIR PEAR_INSTALL_DIR PHP_BINARY PHP_BINDIR PHP_CONFIG_FILE_PATH PHP_CONFIG_FILE_SCAN_DIR PHP_DATADIR PHP_DEBUG PHP_EOL PHP_EXTENSION_DIR PHP_EXTRA_VERSION PHP_INT_MAX PHP_INT_SIZE PHP_LIBDIR PHP_LOCALSTATEDIR PHP_MAJOR_VERSION PHP_MANDIR PHP_MAXPATHLEN PHP_MINOR_VERSION PHP_OS PHP_OUTPUT_HANDLER_CLEAN PHP_OUTPUT_HANDLER_CLEANABLE PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_DISABLED PHP_OUTPUT_HANDLER_END PHP_OUTPUT_HANDLER_FINAL PHP_OUTPUT_HANDLER_FLUSH PHP_OUTPUT_HANDLER_FLUSHABLE PHP_OUTPUT_HANDLER_REMOVABLE PHP_OUTPUT_HANDLER_START PHP_OUTPUT_HANDLER_STARTED PHP_OUTPUT_HANDLER_STDFLAGS PHP_OUTPUT_HANDLER_WRITE PHP_PREFIX PHP_RELEASE_VERSION PHP_SAPI PHP_SHLIB_SUFFIX PHP_SYSCONFDIR PHP_VERSION PHP_VERSION_ID PHP_ZTS STDERR STDIN STDOUT UPLOAD_ERR_CANT_WRITE UPLOAD_ERR_EXTENSION UPLOAD_ERR_FORM_SIZE UPLOAD_ERR_INI_SIZE UPLOAD_ERR_NO_FILE UPLOAD_ERR_NO_TMP_DIR UPLOAD_ERR_OK UPLOAD_ERR_PARTIAL ZEND_DEBUG_BUILD ZEND_THREAD_SAFE contained
endif endif
if index(g:php_syntax_extensions_enabled, "curl") >= 0 && index(g:php_syntax_extensions_disabled, "curl") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "curl") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "curl") < 0) if index(g:php_syntax_extensions_enabled, "curl") >= 0 && index(g:php_syntax_extensions_disabled, "curl") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "curl") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "curl") < 0)
" curl constants " curl constants
@@ -240,7 +282,7 @@ syn keyword phpConstants ABDAY_1 ABDAY_2 ABDAY_3 ABDAY_4 ABDAY_5 ABDAY_6 ABDAY_7
endif endif
if index(g:php_syntax_extensions_enabled, "tokenizer") >= 0 && index(g:php_syntax_extensions_disabled, "tokenizer") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "tokenizer") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "tokenizer") < 0) if index(g:php_syntax_extensions_enabled, "tokenizer") >= 0 && index(g:php_syntax_extensions_disabled, "tokenizer") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "tokenizer") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "tokenizer") < 0)
" tokenizer constants " tokenizer constants
syn keyword phpConstants T_ABSTRACT T_AND_EQUAL T_ARRAY T_ARRAY_CAST T_AS T_BAD_CHARACTER T_BOOLEAN_AND T_BOOLEAN_OR T_BOOL_CAST T_BREAK T_CALLABLE T_CASE T_CATCH T_CHARACTER T_CLASS T_CLASS_C T_CLONE T_CLOSE_TAG T_COMMENT T_CONCAT_EQUAL T_CONST T_CONSTANT_ENCAPSED_STRING T_CONTINUE T_CURLY_OPEN T_DEC T_DECLARE T_DEFAULT T_DIR T_DIV_EQUAL T_DNUMBER T_DO T_DOC_COMMENT T_DOLLAR_OPEN_CURLY_BRACES T_DOUBLE_ARROW T_DOUBLE_CAST T_DOUBLE_COLON T_ECHO T_ELLIPSIS T_ELSE T_ELSEIF T_EMPTY T_ENCAPSED_AND_WHITESPACE T_ENDDECLARE T_ENDFOR T_ENDFOREACH T_ENDIF T_ENDSWITCH T_ENDWHILE T_END_HEREDOC T_EVAL T_EXIT T_EXTENDS T_FILE T_FINAL T_FINALLY T_FOR T_FOREACH T_FUNCTION T_FUNC_C T_GLOBAL T_GOTO T_HALT_COMPILER T_IF T_IMPLEMENTS T_INC T_INCLUDE T_INCLUDE_ONCE T_INLINE_HTML T_INSTANCEOF T_INSTEADOF T_INTERFACE T_INT_CAST T_ISSET T_IS_EQUAL T_IS_GREATER_OR_EQUAL T_IS_IDENTICAL T_IS_NOT_EQUAL T_IS_NOT_IDENTICAL T_IS_SMALLER_OR_EQUAL T_LINE T_LIST T_LNUMBER T_LOGICAL_AND T_LOGICAL_OR T_LOGICAL_XOR T_METHOD_C T_MINUS_EQUAL T_MOD_EQUAL T_MUL_EQUAL T_NAMESPACE T_NEW T_NS_C T_NS_SEPARATOR T_NUM_STRING T_OBJECT_CAST T_OBJECT_OPERATOR T_OPEN_TAG T_OPEN_TAG_WITH_ECHO T_OR_EQUAL T_PAAMAYIM_NEKUDOTAYIM T_PLUS_EQUAL T_PRINT T_PRIVATE T_PROTECTED T_PUBLIC T_REQUIRE T_REQUIRE_ONCE T_RETURN T_SL T_SL_EQUAL T_SR T_SR_EQUAL T_START_HEREDOC T_STATIC T_STRING T_STRING_CAST T_STRING_VARNAME T_SWITCH T_THROW T_TRAIT T_TRAIT_C T_TRY T_UNSET T_UNSET_CAST T_USE T_VAR T_VARIABLE T_WHILE T_WHITESPACE T_XOR_EQUAL T_YIELD contained syn keyword phpConstants T_ABSTRACT T_AND_EQUAL T_ARRAY T_ARRAY_CAST T_AS T_BAD_CHARACTER T_BOOLEAN_AND T_BOOLEAN_OR T_BOOL_CAST T_BREAK T_CALLABLE T_CASE T_CATCH T_CHARACTER T_CLASS T_CLASS_C T_CLONE T_CLOSE_TAG T_COMMENT T_CONCAT_EQUAL T_CONST T_CONSTANT_ENCAPSED_STRING T_CONTINUE T_CURLY_OPEN T_DEC T_DECLARE T_DEFAULT T_DIR T_DIV_EQUAL T_DNUMBER T_DO T_DOC_COMMENT T_DOLLAR_OPEN_CURLY_BRACES T_DOUBLE_ARROW T_DOUBLE_CAST T_DOUBLE_COLON T_ECHO T_ELLIPSIS T_ELSE T_ELSEIF T_EMPTY T_ENCAPSED_AND_WHITESPACE T_ENDDECLARE T_ENDFOR T_ENDFOREACH T_ENDIF T_ENDSWITCH T_ENDWHILE T_END_HEREDOC T_EVAL T_EXIT T_EXTENDS T_FILE T_FINAL T_FINALLY T_FOR T_FOREACH T_FUNCTION T_FUNC_C T_GLOBAL T_GOTO T_HALT_COMPILER T_IF T_IMPLEMENTS T_INC T_INCLUDE T_INCLUDE_ONCE T_INLINE_HTML T_INSTANCEOF T_INSTEADOF T_INTERFACE T_INT_CAST T_ISSET T_IS_EQUAL T_IS_GREATER_OR_EQUAL T_IS_IDENTICAL T_IS_NOT_EQUAL T_IS_NOT_IDENTICAL T_IS_SMALLER_OR_EQUAL T_LINE T_LIST T_LNUMBER T_LOGICAL_AND T_LOGICAL_OR T_LOGICAL_XOR T_METHOD_C T_MINUS_EQUAL T_MOD_EQUAL T_MUL_EQUAL T_NAMESPACE T_NEW T_NS_C T_NS_SEPARATOR T_NUM_STRING T_OBJECT_CAST T_OBJECT_OPERATOR T_OPEN_TAG T_OPEN_TAG_WITH_ECHO T_OR_EQUAL T_PAAMAYIM_NEKUDOTAYIM T_PLUS_EQUAL T_POW T_POW_EQUAL T_PRINT T_PRIVATE T_PROTECTED T_PUBLIC T_REQUIRE T_REQUIRE_ONCE T_RETURN T_SL T_SL_EQUAL T_SR T_SR_EQUAL T_START_HEREDOC T_STATIC T_STRING T_STRING_CAST T_STRING_VARNAME T_SWITCH T_THROW T_TRAIT T_TRAIT_C T_TRY T_UNSET T_UNSET_CAST T_USE T_VAR T_VARIABLE T_WHILE T_WHITESPACE T_XOR_EQUAL T_YIELD contained
endif endif
if index(g:php_syntax_extensions_enabled, "xml") >= 0 && index(g:php_syntax_extensions_disabled, "xml") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "xml") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "xml") < 0) if index(g:php_syntax_extensions_enabled, "xml") >= 0 && index(g:php_syntax_extensions_disabled, "xml") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "xml") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "xml") < 0)
" xml constants " xml constants
@@ -444,10 +486,15 @@ endif
syntax keyword phpClasses containedin=ALLBUT,phpComment,phpDocComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar syntax keyword phpClasses containedin=ALLBUT,phpComment,phpDocComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar
" Control Structures " Control Structures
syn keyword phpKeyword if echo else elseif while do for foreach function break switch case default continue return goto as endif endwhile endfor endforeach endswitch declare endeclare print new clone yield contained syn keyword phpKeyword echo continue case default break return goto as endif endwhile endfor endforeach endswitch declare endeclare print new clone yield contained
" Only create keyword groupings for these if not doing folding, otherwise they take precedence over the regions
" used for folding.
if php_folding != 1
syn keyword phpKeyword if else elseif while do for foreach function switch contained
" Exception Keywords " Exception Keywords
syn keyword phpKeyword try catch finally throw contained syn keyword phpKeyword try catch finally throw contained
endif
" Class Keywords " Class Keywords
syn keyword phpType class abstract extends interface implements static final var public private protected const trait contained syn keyword phpType class abstract extends interface implements static final var public private protected const trait contained
@@ -532,16 +579,16 @@ endif
syn match phpCommentStar contained "^\s*\*[^/]"me=e-1 syn match phpCommentStar contained "^\s*\*[^/]"me=e-1
syn match phpCommentStar contained "^\s*\*$" syn match phpCommentStar contained "^\s*\*$"
if !exists("php_ignore_phpdoc") if !exists("php_ignore_phpdoc") || !php_ignore_phpdoc
syn case ignore syn case ignore
syn region phpDocComment start="/\*\*" end="\*/" keepend contains=phpCommentTitle,phpDocTags,phpTodo,@Spell syn region phpDocComment start="/\*\*" end="\*/" keepend contains=phpCommentTitle,phpDocTags,phpTodo,@Spell
syn region phpCommentTitle contained matchgroup=phpDocComment start="/\*\*" matchgroup=phpCommmentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=phpCommentStar,phpTodo,phpDocTags,@Spell containedin=phpDocComment syn region phpCommentTitle contained matchgroup=phpDocComment start="/\*\*" matchgroup=phpCommmentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=phpCommentStar,phpTodo,phpDocTags,@Spell containedin=phpDocComment
syn region phpDocTags start="{@\(example\|id\|internal\|inheritdoc\|link\|source\|toc\|tutorial\)" end="}" containedin=phpDocComment syn region phpDocTags start="{@\(example\|id\|internal\|inheritdoc\|link\|source\|toc\|tutorial\)" end="}" containedin=phpDocComment
syn match phpDocTags "@\(abstract\|access\|author\|category\|copyright\|deprecated\|example\|exception\|filesource\|final\|global\|id\|ignore\|inheritdoc\|internal\|license\|link\|magic\|method\|name\|package\|param\|property\|return\|see\|since\|source\|static\|staticvar\|subpackage\|throws\|toc\|todo\|tutorial\|uses\|var\|version\)\s\+\S\+.*" contains=phpDocParam containedin=phpDocComment syn match phpDocTags "@\%(abstract\|access\|api\|author\|brief\|bug\|category\|class\|copyright\|created\|date\|deprecated\|details\|example\|exception\|file\|filesource\|final\|global\|id\|ignore\|inheritdoc\|internal\|license\|link\|magic\|method\|name\|package\|param\|property\|return\|see\|since\|source\|static\|staticvar\|struct\|subpackage\|throws\|toc\|todo\|tutorial\|type\|uses\|var\|version\|warning\)" containedin=phpDocComment nextgroup=phpDocParam,phpDocIdentifier skipwhite
syn match phpDocParam "\s\S\+" contained contains=phpDocIdentifier syn match phpDocParam "\s\+\zs\%(\h\w*|\?\)\+" nextgroup=phpDocIdentifier skipwhite
syn match phpDocIdentifier contained "$\h\w*" syn match phpDocIdentifier "\s\+\zs$\h\w*"
syn case match syn case match
endif endif
@@ -568,23 +615,29 @@ else
endif endif
" HereDoc " HereDoc
syn case match syn case match
syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@<="\z(\I\i*\)"$+ end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
" including HTML,JavaScript,SQL even if not enabled via options SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@<="\z(\I\i*\)"$+ end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend " including HTML,JavaScript,SQL if enabled via options
syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend if (exists("php_html_in_heredoc") && php_html_in_heredoc)
syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
syn case ignore SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
if (exists("php_sql_heredoc") && php_sql_heredoc)
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
endif
" NowDoc " NowDoc
syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@<='\z(\I\i*\)'$+ end="^\z1\(;\=$\)\@=" contained keepend extend SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@<='\z(\I\i*\)'$+ end="^\z1\(;\=$\)\@=" contained keepend extend
syn case ignore
" Parent " Parent
if (exists("php_parent_error_close") && php_parent_error_close) || (exists("php_parent_error_open") && php_parent_error_open) if (exists("php_parent_error_close") && php_parent_error_close) || (exists("php_parent_error_open") && php_parent_error_open)
syn match phpParent "[{}]" contained syn match phpParent "[{}]" contained
syn region phpParent matchgroup=Delimiter start="(" end=")" contained contains=@phpClFunction transparent syn region phpParent matchgroup=Delimiter start="(" end=")" contained contains=@phpClFunction,@phpClControl transparent
syn region phpParent matchgroup=Delimiter start="\[" end="\]" contained contains=@phpClInside transparent syn region phpParent matchgroup=Delimiter start="\[" end="\]" contained contains=@phpClFunction,@phpClControl transparent
if ! (exists("php_parent_error_close") && php_parent_error_close) if ! (exists("php_parent_error_close") && php_parent_error_close)
syn match phpParent "[\])]" contained syn match phpParent "[\])]" contained
endif endif
@@ -622,7 +675,8 @@ syn match phpFunction /\h\w*/
syn cluster phpClConst contains=phpFunctions,phpClasses,phpStaticClasses,phpIdentifier,phpStatement,phpKeyword,phpOperator,phpSplatOperator,phpStringSingle,phpStringDouble,phpBacktick,phpNumber,phpType,phpBoolean,phpStructure,phpMethodsVar,phpConstants,phpException,phpSuperglobals,phpMagicConstants,phpServerVars syn cluster phpClConst contains=phpFunctions,phpClasses,phpStaticClasses,phpIdentifier,phpStatement,phpKeyword,phpOperator,phpSplatOperator,phpStringSingle,phpStringDouble,phpBacktick,phpNumber,phpType,phpBoolean,phpStructure,phpMethodsVar,phpConstants,phpException,phpSuperglobals,phpMagicConstants,phpServerVars
syn cluster phpClInside contains=@phpClConst,phpComment,phpDocComment,phpParent,phpParentError,phpInclude,phpHereDoc,phpNowDoc syn cluster phpClInside contains=@phpClConst,phpComment,phpDocComment,phpParent,phpParentError,phpInclude,phpHereDoc,phpNowDoc
syn cluster phpClFunction contains=@phpClInside,phpDefine,phpParentError,phpStorageClass,phpKeyword syn cluster phpClFunction contains=@phpClInside,phpDefine,phpParentError,phpStorageClass,phpKeyword
syn cluster phpClTop contains=@phpClFunction,phpFoldFunction,phpFoldClass,phpFoldInterface,phpFoldTry,phpFoldCatch syn cluster phpClControl contains=phpFoldIfContainer,phpFoldWhile,phpFoldDoWhile,phpFoldFor,phpFoldForeach,phpFoldTryContainer,phpFoldSwitch
syn cluster phpClTop contains=@phpClFunction,@phpClControl,phpFoldFunction,phpFoldClass,phpFoldInterface,phpFoldHtmlInside
" Php Region " Php Region
if (exists("php_parent_error_open") && php_parent_error_open) if (exists("php_parent_error_open") && php_parent_error_open)
@@ -632,8 +686,8 @@ else
endif endif
" Fold " Fold
if exists("php_folding") && php_folding==1 if php_folding==1
" match one line constructs here and skip them at folding " match one line constructs here and skip them at folding
syn keyword phpSCKeyword abstract final private protected public static contained syn keyword phpSCKeyword abstract final private protected public static contained
syn keyword phpFCKeyword function contained syn keyword phpFCKeyword function contained
syn match phpDefine "\(\s\|^\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\(\s\+.*[;}]\)\@=" contained contains=phpSCKeyword syn match phpDefine "\(\s\|^\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\(\s\+.*[;}]\)\@=" contained contains=phpSCKeyword
@@ -641,19 +695,46 @@ if exists("php_folding") && php_folding==1
syn match phpStructure "\(\s\|^\)interface\(\s\+.*}\)\@=" contained syn match phpStructure "\(\s\|^\)interface\(\s\+.*}\)\@=" contained
syn match phpException "\(\s\|^\)try\(\s\+.*}\)\@=" contained syn match phpException "\(\s\|^\)try\(\s\+.*}\)\@=" contained
syn match phpException "\(\s\|^\)catch\(\s\+.*}\)\@=" contained syn match phpException "\(\s\|^\)catch\(\s\+.*}\)\@=" contained
syn match phpKeyword "^\s*\(if\|else\%[if]\)\s*\(.*{.*}$\|[^{}]*$\)\@=" contained
syn match phpKeyword "^\s*while\s*\([^{}]*$\|.*{.*}$\)\@=" contained
syn match phpKeyword "^\s*do\s*\([^{}]*$\|{.*}\s*while\s*.*;$\)\@=" contained
syn match phpKeyword "while\s*\((.*);$\)\@=" contained
syn match phpKeyword "^\s*for\s*\((.*)\s*{.*}$\|[^{}]*$\)\@=" contained
syn match phpKeyword "^\s*foreach\s*\((.*)\s*{.*}$\|[^{}]*$\)\@=" contained
set foldmethod=syntax set foldmethod=syntax
syn region phpFoldHtmlInside matchgroup=Delimiter start="?>" end="<?\(php\)\=" contained transparent contains=@htmlTop syn region phpFoldHtmlInside matchgroup=Delimiter start="?>" end="<?\(php\)\=" contained transparent contains=@htmlTop
syn region phpFoldFunction matchgroup=Storageclass start="^\z(\s*\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\s\([^};]*$\)\@="rs=e-9 matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldHtmlInside,phpFCKeyword contained transparent fold extend syn region phpFoldFunction matchgroup=Storageclass start="^\z(\s*\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\s\([^};]*$\)\@="rs=e-9 matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,@phpClControl,phpFoldHtmlInside,phpFCKeyword contained transparent fold extend
syn region phpFoldFunction matchgroup=Define start="^function\s\([^};]*$\)\@=" matchgroup=Delimiter end="^}" contains=@phpClFunction,phpFoldHtmlInside contained transparent fold extend syn region phpFoldFunction matchgroup=Define start="^function\s\([^};]*$\)\@=" matchgroup=Delimiter end="^}" contains=@phpClFunction,@phpClControl,phpFoldHtmlInside contained transparent fold extend
syn region phpFoldClass matchgroup=Structure start="^\z(\s*\)\(abstract\s\+\|final\s\+\)*class\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction,phpSCKeyword contained transparent fold extend syn region phpFoldClass matchgroup=Structure start="^\z(\s*\)\(abstract\s\+\|final\s\+\)*class\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction,phpSCKeyword contained transparent fold extend
syn region phpFoldInterface matchgroup=Structure start="^\z(\s*\)interface\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend syn region phpFoldInterface matchgroup=Structure start="^\z(\s*\)interface\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend
syn region phpFoldCatch matchgroup=Exception start="^\z(\s*\)catch\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend
syn region phpFoldTry matchgroup=Exception start="^\z(\s*\)try\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend syn region phpFoldTryContainer start="^\z(\s*\)try\s\+\(.*{$\)\@=" skip="^\z1}\_s*\(catch\|finally\)" end="^\z1}$" keepend extend contained contains=@phpClFunction,@phpClControl,phpFoldFunction,phpFoldHtmlInside transparent
elseif exists("php_folding") && php_folding==2 syn region phpFoldTry matchgroup=phpException start="^\z(\s*\)try\s\+\(.*{$\)\@=" matchgroup=Delimiter end="^\z1}$" end="^\z1}\(\s\+\(catch\|finally\)\)\@="me=s-1 containedin=phpFoldTryContainer contained transparent keepend fold extend nextgroup=phpFoldCatch
syn region phpFoldCatch matchgroup=phpException start="^\z(\s*\)\(}\s\+\)\=catch\s\+\(.*{$\)\@=" matchgroup=Delimiter end="^\z1}$" end="^\z1}\(\s\+\(catch\|finally\)\)\@="me=s-1 containedin=phpFoldTryContainer keepend contained transparent fold extend nextgroup=phpFoldCatch,phpFoldFinally
syn region phpFoldFinally matchgroup=phpException start="^\z(\s*\)\(}\s\+\)\=finally\s\+\(.*{$\)\@=" matchgroup=Delimiter end="^\z1}$" contained containedin=phpFoldTryContainer transparent fold keepend
syn region phpFoldIfContainer start="^\z(\s*\)if\s\+\(.*{$\)\@=" skip="^\z1}\_s*else\%[if]" end="^\z1}$" keepend extend contained contains=@phpClFunction,@phpClControl,phpFCKeyword,phpFoldHtmlInside
syn region phpFoldIf matchgroup=phpKeyword start="^\z(\s*\)if\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="\(^\z1\)\@=}\(\_s\+\%[elseif]\s\+[^}]*$\)\@="me=s-1 contained containedin=phpFoldIfContainer keepend nextgroup=phpFoldElseIf,phpFoldElse fold transparent
syn region phpFoldElseIf matchgroup=phpKeyword start="^\z(\s*\)\(}\s\+\)\=elseif\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="\(^\z1\)\@=}\(\s*\%[elseif]\s*[^}]*$\)\@="me=s-1 contained containedin=phpFoldIfContainer keepend nextgroup=phpFoldElseIf,phpFoldElse fold transparent
syn region phpFoldElse matchgroup=phpKeyword start="^\z(\s*\)\(}\s\+\)\=else\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="\(^\z1\)\@=}\(\s\+\%[elseif]\s\+[^}]*$\)\@="me=s-1 contained containedin=phpFoldIfContainer keepend fold transparent
syn region phpFoldSwitch matchgroup=phpKeyword start="^\z(\s*\)switch\s*\(.*{$\)\@=" matchgroup=Delimiter end="^\z1}$" keepend extend contained contains=@phpClFunction,@phpClControl,phpFCKeyword,phpFoldHtmlInside fold transparent
syn region phpFoldCase matchgroup=phpKeyword start="^\z(\s*\)case\s*\(.*:$\)\@=" end="^\z1\(case\|default\)"me=s-1 contained containedin=phpFoldSwitch keepend contains=@phpClFunction,@phpClControl,phpFCKeyword,phpFoldHtmlInside nextgroup=phpFoldCase,phpFoldDefault fold transparent
syn region phpFoldDefault matchgroup=phpKeyword start="^\z(\s*\)default\(:$\)\@=" matchgroup=Delimiter end="\s*}$" contained contains=@phpClFunction,@phpClControl,phpFCKeyword,phpFoldHtmlInside containedin=phpFoldSwitch keepend fold transparent
syn region phpFoldWhile matchgroup=phpKeyword start="^\z(\s*\)while\s\+\(.*{$\)\@=" matchgroup=Delimiter end="^\z1}$" contains=@phpClFunction,@phpClControl,phpFoldHtmlInside contained fold extend
syn region phpFoldDoWhile matchgroup=phpkeyword start="^\z(\s*\)do\s\+\({$\)\@=" matchgroup=Delimiter end="\z1}\s\+\(while\s\+.*;$\)\@=" contains=@phpClFunction,@phpClControl,phpFoldHtmlInside contained fold extend keepend
syn region phpFoldFor matchgroup=phpKeyword start="^\z(\s*\)for\s\(.*{$\)\@=" matchgroup=Delimiter end="\z1}$" contains=@phpClFunction,@phpClControl,phpFCKeyword,phpFoldHtmlInside contained transparent fold extend
syn region phpFoldForeach matchgroup=phpKeyword start="^\z(\s*\)foreach\s\(.*{$\)\@=" matchgroup=Delimiter end="\z1}$" contains=@phpClFunction,@phpClControl,phpFCKeyword,phpFoldHtmlInside contained transparent fold extend
elseif php_folding==2
set foldmethod=syntax set foldmethod=syntax
syn region phpFoldHtmlInside matchgroup=Delimiter start="?>" end="<?\(php\)\=" contained transparent contains=@htmlTop syn region phpFoldHtmlInside matchgroup=Delimiter start="?>" end="<?\(php\)\=" contained transparent contains=@htmlTop
syn region phpParent matchgroup=Delimiter start="{" end="}" contained contains=@phpClFunction,phpFoldHtmlInside transparent fold syn region phpParent matchgroup=Delimiter start="{" end="}" contained contains=@phpClFunction,phpFoldHtmlInside transparent fold
syn region phpParent matchgroup=Delimiter start="(" end=")" contained contains=@phpClFunction,phpFoldHtmlInside transparent fold
syn region phpParent matchgroup=Delimiter start="\[" end="]" contained contains=@phpClFunction,phpFoldHtmlInside transparent fold
endif endif
" Sync " Sync
@@ -687,7 +768,7 @@ if !exists("did_php_syn_inits")
hi def link phpFunctions Function hi def link phpFunctions Function
hi def link phpMethods Function hi def link phpMethods Function
hi def link phpClasses StorageClass hi def link phpClasses StorageClass
hi def link phpException StorageClass hi def link phpException Exception
hi def link phpIdentifier Identifier hi def link phpIdentifier Identifier
hi def link phpIdentifierSimply Identifier hi def link phpIdentifierSimply Identifier
hi def link phpStatement Statement hi def link phpStatement Statement
@@ -734,10 +815,18 @@ if !exists("did_php_syn_inits")
endif endif
" Cleanup: {{{
delcommand SynFold
let b:current_syntax = "php" let b:current_syntax = "php"
let &iskeyword = s:iskeyword_save
unlet s:iskeyword_save
if main_syntax == 'php' if main_syntax == 'php'
unlet main_syntax unlet main_syntax
endif endif
" vim: ts=8 sts=2 sw=2 expandtab " }}}
" vim: ts=8 sts=2 sw=2 fdm=marker expandtab

View File

@@ -76,7 +76,7 @@ syn region puppetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=pupp
syn match puppetNotVariable "\\$\w\+" contained syn match puppetNotVariable "\\$\w\+" contained
syn match puppetNotVariable "\\${\w\+}" contained syn match puppetNotVariable "\\${\w\+}" contained
syn keyword puppetKeyword import inherits include require syn keyword puppetKeyword import inherits include require contains
syn keyword puppetControl case default if else elsif syn keyword puppetControl case default if else elsif
syn keyword puppetSpecial true false undef syn keyword puppetSpecial true false undef

View File

@@ -103,6 +103,8 @@ syn match rubySymbol "[]})\"':]\@<!:\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)
syn region rubySymbol start="[]})\"':]\@<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold syn region rubySymbol start="[]})\"':]\@<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold
syn region rubySymbol start="[]})\"':]\@<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold syn region rubySymbol start="[]})\"':]\@<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold
syn match rubyCapitalizedMethod "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)*\s*(\@="
syn match rubyBlockParameter "\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" contained syn match rubyBlockParameter "\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" contained
syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\s*\)\@<=|" end="|" oneline display contains=rubyBlockParameter syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\s*\)\@<=|" end="|" oneline display contains=rubyBlockParameter
@@ -336,6 +338,7 @@ hi def link rubyAccess Statement
hi def link rubyAttribute Statement hi def link rubyAttribute Statement
hi def link rubyEval Statement hi def link rubyEval Statement
hi def link rubyPseudoVariable Constant hi def link rubyPseudoVariable Constant
hi def link rubyCapitalizedMethod rubyLocalVariableOrMethod
hi def link rubyComment Comment hi def link rubyComment Comment
hi def link rubyData Comment hi def link rubyData Comment

View File

@@ -3,7 +3,7 @@
" Maintainer: Patrick Walton <pcwalton@mozilla.com> " Maintainer: Patrick Walton <pcwalton@mozilla.com>
" Maintainer: Ben Blum <bblum@cs.cmu.edu> " Maintainer: Ben Blum <bblum@cs.cmu.edu>
" Maintainer: Chris Morgan <me@chrismorgan.info> " Maintainer: Chris Morgan <me@chrismorgan.info>
" Last Change: 2014 Feb 27 " Last Change: July 18, 2014
if version < 600 if version < 600
syntax clear syntax clear
@@ -26,12 +26,11 @@ syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
syn keyword rustKeyword for in if impl let syn keyword rustKeyword for in if impl let
syn keyword rustKeyword loop once proc pub syn keyword rustKeyword loop once proc pub
syn keyword rustKeyword return super syn keyword rustKeyword return super
syn keyword rustKeyword unsafe virtual while syn keyword rustKeyword unsafe virtual where while
syn keyword rustKeyword use nextgroup=rustModPath skipwhite skipempty syn keyword rustKeyword use nextgroup=rustModPath,rustModPathInUse skipwhite skipempty
" FIXME: Scoped impl's name is also fallen in this category " FIXME: Scoped impl's name is also fallen in this category
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite skipempty syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite skipempty
syn keyword rustStorage mut ref static syn keyword rustStorage mut ref static const
syn keyword rustObsoleteStorage const
syn keyword rustInvalidBareKeyword crate syn keyword rustInvalidBareKeyword crate
@@ -50,6 +49,10 @@ syn region rustBoxPlacementBalance start="(" end=")" containedin=rustBoxPlace
syn region rustBoxPlacementBalance start="\[" end="\]" containedin=rustBoxPlacement transparent syn region rustBoxPlacementBalance start="\[" end="\]" containedin=rustBoxPlacement transparent
" {} are handled by rustFoldBraces " {} are handled by rustFoldBraces
syn region rustMacroRepeat matchgroup=rustMacroRepeatDelimiters start="$(" end=")" contains=TOP nextgroup=rustMacroRepeatCount
syn match rustMacroRepeatCount ".\?[*+]" contained
syn match rustMacroVariable "$\w\+"
" Reserved (but not yet used) keywords {{{2 " Reserved (but not yet used) keywords {{{2
syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield
@@ -62,11 +65,11 @@ syn keyword rustType f64 i8 i16 i32 i64 str Self
" to make it easy to update. " to make it easy to update.
" Core operators {{{3 " Core operators {{{3
syn keyword rustTrait Copy Send Sized Share syn keyword rustTrait Copy Send Sized Sync
syn keyword rustTrait Add Sub Mul Div Rem Neg Not syn keyword rustTrait Add Sub Mul Div Rem Neg Not
syn keyword rustTrait BitAnd BitOr BitXor syn keyword rustTrait BitAnd BitOr BitXor
syn keyword rustTrait Drop Deref DerefMut syn keyword rustTrait Drop Deref DerefMut
syn keyword rustTrait Shl Shr Index syn keyword rustTrait Shl Shr Index IndexMut
syn keyword rustEnum Option syn keyword rustEnum Option
syn keyword rustEnumVariant Some None syn keyword rustEnumVariant Some None
syn keyword rustEnum Result syn keyword rustEnum Result
@@ -78,34 +81,39 @@ syn keyword rustEnumVariant Ok Err
"syn keyword rustFunction drop "syn keyword rustFunction drop
" Types and traits {{{3 " Types and traits {{{3
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr IntoBytes syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr
syn keyword rustTrait IntoBytes
syn keyword rustTrait ToCStr syn keyword rustTrait ToCStr
syn keyword rustTrait Char syn keyword rustTrait Char UnicodeChar
syn keyword rustTrait Clone syn keyword rustTrait Clone
syn keyword rustTrait Eq Ord TotalEq TotalOrd Ordering Equiv syn keyword rustTrait PartialEq PartialOrd Eq Ord Equiv
syn keyword rustEnum Ordering
syn keyword rustEnumVariant Less Equal Greater syn keyword rustEnumVariant Less Equal Greater
syn keyword rustTrait Container Mutable Map MutableMap Set MutableSet syn keyword rustTrait Collection Mutable Map MutableMap MutableSeq
syn keyword rustTrait FromIterator Extendable syn keyword rustTrait Set MutableSet
syn keyword rustTrait Iterator DoubleEndedIterator RandomAccessIterator CloneableIterator syn keyword rustTrait FromIterator Extendable ExactSize
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator ExactSize syn keyword rustTrait Iterator DoubleEndedIterator
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul syn keyword rustTrait RandomAccessIterator CloneableIterator
syn keyword rustTrait Signed Unsigned syn keyword rustTrait OrdIterator MutableDoubleEndedIterator
syn keyword rustTrait Primitive Int Float FloatMath ToPrimitive FromPrimitive syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul CheckedDiv
"syn keyword rustTrait Expect syn keyword rustTrait Signed Unsigned Primitive Int Float
syn keyword rustTrait FloatMath ToPrimitive FromPrimitive
syn keyword rustTrait Box syn keyword rustTrait Box
syn keyword rustTrait GenericPath Path PosixPath WindowsPath syn keyword rustTrait GenericPath Path PosixPath WindowsPath
syn keyword rustTrait RawPtr syn keyword rustTrait RawPtr
syn keyword rustTrait Buffer Writer Reader Seek syn keyword rustTrait Buffer Writer Reader Seek
syn keyword rustTrait Str StrVector StrSlice OwnedStr IntoMaybeOwned syn keyword rustTrait Str StrVector StrSlice
syn keyword rustTrait StrAllocating syn keyword rustTrait IntoMaybeOwned StrAllocating UnicodeStrSlice
syn keyword rustTrait ToStr IntoStr syn keyword rustTrait ToString IntoStr
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4 syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8 syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12 syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12
syn keyword rustTrait CloneableVector ImmutableCloneableVector MutableCloneableVector syn keyword rustTrait CloneableVector ImmutableCloneableVector
syn keyword rustTrait ImmutableVector MutableVector syn keyword rustTrait MutableCloneableSlice MutableOrdSlice
syn keyword rustTrait ImmutableEqVector ImmutableTotalOrdVector MutableTotalOrdVector syn keyword rustTrait ImmutableSlice MutableSlice
syn keyword rustTrait Vector VectorVector OwnedVector MutableVectorAllocating syn keyword rustTrait ImmutablePartialEqSlice ImmutableOrdSlice
syn keyword rustTrait Slice VectorVector
syn keyword rustTrait MutableSliceAllocating
syn keyword rustTrait String syn keyword rustTrait String
syn keyword rustTrait Vec syn keyword rustTrait Vec
@@ -123,8 +131,9 @@ syn keyword rustBoolean true false
" If foo::bar changes to foo.bar, change this ("::" to "\."). " If foo::bar changes to foo.bar, change this ("::" to "\.").
" If foo::bar changes to Foo::bar, change this (first "\w" to "\u"). " If foo::bar changes to Foo::bar, change this (first "\w" to "\u").
syn match rustModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3 syn match rustModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3
syn match rustModPath "\w\(\w\)*" contained " only for 'use path;' syn match rustModPathInUse "\w\(\w\)*" contained " only for 'use path;'
syn match rustModPathSep "::" syn match rustModPathSep "::"
" rustModPathInUse is split out from rustModPath so that :syn-include can get the group list right.
syn match rustFuncCall "\w\(\w\)*("he=e-1,me=e-1 syn match rustFuncCall "\w\(\w\)*("he=e-1,me=e-1
syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 " foo::<T>(); syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 " foo::<T>();
@@ -145,11 +154,13 @@ syn match rustOperator display "&&\|||"
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustFail syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustFail
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustFail syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustFail
syn match rustSpecialError display contained /\\./ syn match rustEscapeError display contained /\\./
syn match rustSpecial display contained /\\\([nrt0\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)/ syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/
syn match rustEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{8}\)/
syn match rustStringContinuation display contained /\\\n\s*/ syn match rustStringContinuation display contained /\\\n\s*/
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustSpecial,rustSpecialError,rustStringContinuation,@Spell syn region rustString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation
syn region rustString start='r\z(#*\)"' end='"\z1' contains=@Spell syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell
syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell
syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDeriving syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDeriving
syn region rustDeriving start="deriving(" end=")" contained contains=rustTrait syn region rustDeriving start="deriving(" end=")" contained contains=rustTrait
@@ -177,7 +188,11 @@ syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[
"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting "rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
syn match rustCharacter /'\([^'\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustSpecial,rustSpecialError syn match rustCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/
" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII).
syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/
syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode
syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
@@ -203,8 +218,6 @@ syn keyword rustTodo contained TODO FIXME XXX NB NOTE
" Trivial folding rules to begin with. " Trivial folding rules to begin with.
" TODO: use the AST to make really good folding " TODO: use the AST to make really good folding
syn region rustFoldBraces start="{" end="}" transparent fold syn region rustFoldBraces start="{" end="}" transparent fold
" If you wish to enable this, setlocal foldmethod=syntax
" It's not enabled by default as it would drive some people mad.
" Default highlighting {{{1 " Default highlighting {{{1
hi def link rustDecNumber rustNumber hi def link rustDecNumber rustNumber
@@ -214,11 +227,17 @@ hi def link rustBinNumber rustNumber
hi def link rustIdentifierPrime rustIdentifier hi def link rustIdentifierPrime rustIdentifier
hi def link rustTrait rustType hi def link rustTrait rustType
hi def link rustMacroRepeatCount rustMacroRepeatDelimiters
hi def link rustMacroRepeatDelimiters Macro
hi def link rustMacroVariable Define
hi def link rustSigil StorageClass hi def link rustSigil StorageClass
hi def link rustSpecial Special hi def link rustEscape Special
hi def link rustSpecialError Error hi def link rustEscapeUnicode rustEscape
hi def link rustEscapeError Error
hi def link rustStringContinuation Special hi def link rustStringContinuation Special
hi def link rustString String hi def link rustString String
hi def link rustCharacterInvalid Error
hi def link rustCharacterInvalidUnicode rustCharacterInvalid
hi def link rustCharacter Character hi def link rustCharacter Character
hi def link rustNumber Number hi def link rustNumber Number
hi def link rustBoolean Boolean hi def link rustBoolean Boolean
@@ -233,6 +252,7 @@ hi def link rustReservedKeyword Error
hi def link rustConditional Conditional hi def link rustConditional Conditional
hi def link rustIdentifier Identifier hi def link rustIdentifier Identifier
hi def link rustCapsIdent rustIdentifier hi def link rustCapsIdent rustIdentifier
hi def link rustModPathInUse rustModPath
hi def link rustModPath Include hi def link rustModPath Include
hi def link rustModPathSep Delimiter hi def link rustModPathSep Delimiter
hi def link rustFunction Function hi def link rustFunction Function

View File

@@ -58,7 +58,7 @@ syn match sassAmpersand "&"
" TODO: Attribute namespaces " TODO: Attribute namespaces
" TODO: Arithmetic (including strings and concatenation) " TODO: Arithmetic (including strings and concatenation)
syn region sassMediaQuery matchgroup=sassMedia start="@media" end="$" contains=sassMediaOperators syn region sassMediaQuery matchgroup=sassMedia start="@media" end="[{};]\@=\|$" contains=sassMediaOperators
syn keyword sassMediaOperators and not only contained syn keyword sassMediaOperators and not only contained
syn region sassCharset start="@charset" end=";\|$" contains=scssComment,cssStringQ,cssStringQQ,cssURL,cssUnicodeEscape,cssMediaType syn region sassCharset start="@charset" end=";\|$" contains=scssComment,cssStringQ,cssStringQQ,cssURL,cssUnicodeEscape,cssMediaType
syn region sassInclude start="@import" end=";\|$" contains=scssComment,cssStringQ,cssStringQQ,cssURL,cssUnicodeEscape,cssMediaType syn region sassInclude start="@import" end=";\|$" contains=scssComment,cssStringQ,cssStringQQ,cssURL,cssUnicodeEscape,cssMediaType

View File

@@ -37,7 +37,7 @@ syn match scalaSymbol /'[_A-Za-z0-9$]\+/
hi link scalaSymbol Number hi link scalaSymbol Number
syn match scalaChar /'.'/ syn match scalaChar /'.'/
syn match scalaEscapedChar /\\[\\ntbrf]/ syn match scalaEscapedChar /\\[\\"ntbrf]/
syn match scalaUnicodeChar /\\u[A-Fa-f0-9]\{4}/ syn match scalaUnicodeChar /\\u[A-Fa-f0-9]\{4}/
hi link scalaChar Character hi link scalaChar Character
hi link scalaEscapedChar Function hi link scalaEscapedChar Function

View File

@@ -48,9 +48,10 @@ syn region slimWrappedAttrs matchgroup=slimWrappedAttrsDelimiter start="\s*{\s*"
syn region slimWrappedAttrs matchgroup=slimWrappedAttrsDelimiter start="\s*\[\s*" end="\s*\]\s*" contained contains=slimAttr nextgroup=slimRuby syn region slimWrappedAttrs matchgroup=slimWrappedAttrsDelimiter start="\s*\[\s*" end="\s*\]\s*" contained contains=slimAttr nextgroup=slimRuby
syn region slimWrappedAttrs matchgroup=slimWrappedAttrsDelimiter start="\s*(\s*" end="\s*)\s*" contained contains=slimAttr nextgroup=slimRuby syn region slimWrappedAttrs matchgroup=slimWrappedAttrsDelimiter start="\s*(\s*" end="\s*)\s*" contained contains=slimAttr nextgroup=slimRuby
syn match slimAttr "\s*\%(\w\|-\)\+\s*" contained contains=htmlArg nextgroup=slimAttrAssignment syn match slimAttr /\s*\%(\w\|-\)\+\s*=/me=e-1 contained contains=htmlArg nextgroup=slimAttrAssignment
syn match slimAttrAssignment "\s*=\s*" contained nextgroup=slimWrappedAttrValue,slimAttrString syn match slimAttrAssignment "\s*=\s*" contained nextgroup=slimWrappedAttrValue,slimAttrString
syn region slimWrappedAttrValue start="[^"']" end="\s\|$" contained contains=slimAttrString,@slimRubyTop nextgroup=slimAttr,slimRuby,slimInlineTagChar
syn region slimWrappedAttrValue matchgroup=slimWrappedAttrValueDelimiter start="{" end="}" contained contains=slimAttrString,@slimRubyTop nextgroup=slimAttr,slimRuby,slimInlineTagChar syn region slimWrappedAttrValue matchgroup=slimWrappedAttrValueDelimiter start="{" end="}" contained contains=slimAttrString,@slimRubyTop nextgroup=slimAttr,slimRuby,slimInlineTagChar
syn region slimWrappedAttrValue matchgroup=slimWrappedAttrValueDelimiter start="\[" end="\]" contained contains=slimAttrString,@slimRubyTop nextgroup=slimAttr,slimRuby,slimInlineTagChar syn region slimWrappedAttrValue matchgroup=slimWrappedAttrValueDelimiter start="\[" end="\]" contained contains=slimAttrString,@slimRubyTop nextgroup=slimAttr,slimRuby,slimInlineTagChar
syn region slimWrappedAttrValue matchgroup=slimWrappedAttrValueDelimiter start="(" end=")" contained contains=slimAttrString,@slimRubyTop nextgroup=slimAttr,slimRuby,slimInlineTagChar syn region slimWrappedAttrValue matchgroup=slimWrappedAttrValueDelimiter start="(" end=")" contained contains=slimAttrString,@slimRubyTop nextgroup=slimAttr,slimRuby,slimInlineTagChar
@@ -65,11 +66,11 @@ syn region slimInterpolation matchgroup=slimInterpolationDelimiter start="#{" en
syn region slimInterpolation matchgroup=slimInterpolationDelimiter start="#{{" end="}}" contains=@hamlRubyTop containedin=javascriptStringS,javascriptStringD,slimWrappedAttrs syn region slimInterpolation matchgroup=slimInterpolationDelimiter start="#{{" end="}}" contains=@hamlRubyTop containedin=javascriptStringS,javascriptStringD,slimWrappedAttrs
syn match slimInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)" syn match slimInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)"
syn region slimRuby matchgroup=slimRubyOutputChar start="\s*[=]\==[']\=" skip=",\s*$" end="$" contained contains=@slimRubyTop keepend syn region slimRuby matchgroup=slimRubyOutputChar start="\s*[=]\==[']\=" skip="\%\(,\s*\|\\\)$" end="$" contained contains=@slimRubyTop keepend
syn region slimRuby matchgroup=slimRubyChar start="\s*-" skip=",\s*$" end="$" contained contains=@slimRubyTop keepend syn region slimRuby matchgroup=slimRubyChar start="\s*-" skip="\%\(,\s*\|\\\)$" end="$" contained contains=@slimRubyTop keepend
syn match slimComment /^\(\s*\)[/].*\(\n\1\s.*\)*/ contains=slimTodo syn match slimComment /^\(\s*\)[/].*\(\n\1\s.*\)*/ contains=slimTodo
syn match slimText /^\(\s*\)[`|'].*\(\n\1\s.*\)*/ syn match slimText /^\(\s*\)[`|'].*\(\n\1\s.*\)*/ contains=slimInterpolation
syn match slimFilter /\s*\w\+:\s*/ contained syn match slimFilter /\s*\w\+:\s*/ contained
syn match slimHaml /^\(\s*\)\<haml:\>.*\(\n\1\s.*\)*/ contains=@slimHaml,slimFilter syn match slimHaml /^\(\s*\)\<haml:\>.*\(\n\1\s.*\)*/ contains=@slimHaml,slimFilter

64
syntax/swift.vim Normal file
View File

@@ -0,0 +1,64 @@
" Language: Swift<https://developer.apple.com/swift/>
" Maintainer: toyama satoshi <toyamarinyon@gmail.com>
" URL: http://github.com/toyamarinyon/vim-swift
" License: GPL
" Bail if our syntax is already loaded.
if exists('b:current_syntax') && b:current_syntax == 'swift'
finish
endif
" {{{ Whitespace and Comments
syntax region swiftComment start=#\/\*# end=#\*\/#
syntax match swiftComment /\/\/.*/
highlight default link swiftComment Comment
" }}}
" {{{ Identifiers
syntax match swiftIdentifier /[[:alpha:]_][[:alnum:]_]*/
highlight default link swiftIdentifier Identifier
" }}}
" {{{ Keywords
" Keywords used in declarations:
syntax keyword swiftDeclarationKeywords class deinit enum extension func import init let protocol static struct subscript typealias var
highlight default link swiftDeclarationKeywords Keyword
" Keywords used in statements:
syntax keyword swiftStatementKeywords break case continue default do else fallthrough if in for return switch where while
highlight default link swiftStatementKeywords Keyword
" Keywords used in expressions and types:
syntax keyword swiftExpressionTypeKeywords as dynamicType is new super self Self Type __COLUMN__ __FILE__ __FUNCTION__ __LINE__
highlight default link swiftExpressionTypeKeywords Keyword
" Keywords reserved in particular contexts:
syntax keyword swiftReserveKeywords associativity didSet get infix inout left mutating none nonmutating operator override postfix precedence prefix right set unowned unowned(safe) unowned(unsafe) weak willSet
highlight default link swiftReserveKeywords Keyword
" }}}
" {{{ Literals
" Integer literal
syntax match swiftIntegerLiteral /\<\d\+\%(_\d\+\)*\%(\.\d\+\%(_\d\+\)*\)\=\>/
syntax match swiftIntegerLiteral /\<\d\+\%(_\d\+\)*\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)\>/
syntax match swiftIntegerLiteral /\<0x\x\+\%(_\x\+\)*\>/
syntax match swiftIntegerLiteral /\<0o\o\+\%(_\o\+\)*\>/
syntax match swiftIntegerLiteral /\<0b[01]\+\%(_[01]\+\)*\>/
highlight default link swiftIntegerLiteral Number
" String literal
syntax region swiftStringLiteral start=/"/ skip=/\\"/ end=/"/
highlight default link swiftStringLiteral String
" }}}
" {{{ Operators
syntax keyword swiftOperatorKeywords / = - + ! * % < > & \| ^ ~ .
highlight default link swiftOperatorKeywords Operator
" }}}
" {{{ Type
syntax match swiftTypeIdentifier /\<[[:alpha:]_][[:alnum:]_.]*/ contained
syntax match swiftType /: .*/ contains=swiftTypeIdentifier
highlight default link swiftType Operator
highlight default link swiftTypeIdentifier Type
" }}}
if !exists('b:current_syntax')
let b:current_syntax = 'swift'
endif