Compare commits

...

6 Commits

Author SHA1 Message Date
Adam Stankiewicz
a39c9013cc Update ruby syntax 2015-10-24 13:15:38 +02:00
Adam Stankiewicz
25d2786cae Update erlang provider to vim-erlang/vim-erlang-runtime, closes #76 2015-10-18 16:13:43 +02:00
Adam Stankiewicz
1f1e821192 Change haskell provider to neovimhaskell/haskell-vim, closes #75 2015-10-18 16:08:51 +02:00
Adam Stankiewicz
ae882e85f8 Update 2015-10-18 16:07:12 +02:00
Adam Stankiewicz
aec5e42bdb Update yajs syntax 2015-10-10 17:52:47 +02:00
Adam Stankiewicz
a0c79360ed Add qml support, closes #69 2015-10-10 17:25:38 +02:00
24 changed files with 842 additions and 62 deletions

View File

@@ -38,14 +38,14 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
- [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)
- [emblem](https://github.com/heartsentwined/vim-emblem) (syntax, indent, ftplugin, ftdetect)
- [erlang](https://github.com/hcs42/vim-erlang-runtime) (syntax, indent)
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (syntax, indent, ftdetect)
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect)
- [glsl](https://github.com/tikhomirov/vim-glsl) (syntax, indent, ftdetect)
- [go](https://github.com/fatih/vim-go) (syntax, indent, ftdetect)
- [groovy](https://github.com/vim-scripts/groovy.vim) (syntax)
- [haml](https://github.com/tpope/vim-haml) (syntax, indent, compiler, ftplugin, ftdetect)
- [handlebars](https://github.com/mustache/vim-mustache-handlebars) (syntax, ftplugin, ftdetect)
- [haskell](https://github.com/raichoo/haskell-vim) ()
- [haskell](https://github.com/neovimhaskell/haskell-vim) (syntax, indent, ftplugin, ftdetect)
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax, ftdetect)
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
- [jade](https://github.com/digitaltoad/vim-jade) (syntax, indent, ftplugin, ftdetect)
@@ -70,6 +70,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
- [powershell](https://github.com/Persistent13/vim-ps1) (syntax, indent, ftplugin, ftdetect)
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, ftdetect)
- [python](https://github.com/mitsuhiko/vim-python-combined) (syntax, indent)
- [qml](https://github.com/peterhoeg/vim-qml) (syntax, indent, ftplugin, ftdetect)
- [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin)
- [ragel](https://github.com/jneen/ragel.vim) (syntax)
- [rspec](https://github.com/sheerun/rspec.vim) (syntax, ftdetect)

8
after/ftplugin/cabal.vim Normal file
View File

@@ -0,0 +1,8 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
setlocal comments=s1fl:{-,mb:-,ex:-},:--
setlocal formatoptions-=cro formatoptions+=j
setlocal iskeyword+=-,.,*
setlocal commentstring=--\ %s
endif

View File

@@ -0,0 +1,7 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
setlocal comments=s1fl:{-,mb:-,ex:-},:--
setlocal formatoptions-=cro formatoptions+=j
setlocal iskeyword+='
endif

View File

@@ -44,4 +44,8 @@ syn region xmlString contained start=+{+ end=++ contains=jsBlock,javascriptBlock
" Add jsxRegion to the lowest-level JS syntax cluster.
syn cluster jsExpression add=jsxRegion
" Allow jsxRegion to contain reserved words.
" See: https://github.com/othree/yajs.vim
syn cluster javascriptNoReserved add=jsxRegion
endif

5
build
View File

@@ -109,14 +109,14 @@ PACKS="
elixir:elixir-lang/vim-elixir
emberscript:heartsentwined/vim-ember-script
emblem:heartsentwined/vim-emblem
erlang:hcs42/vim-erlang-runtime
erlang:vim-erlang/vim-erlang-runtime
git:tpope/vim-git
glsl:tikhomirov/vim-glsl
go:fatih/vim-go:_BASIC
groovy:vim-scripts/groovy.vim
haml:tpope/vim-haml
handlebars:mustache/vim-mustache-handlebars
haskell:raichoo/haskell-vim
haskell:neovimhaskell/haskell-vim
haxe:yaymukund/vim-haxe
html5:othree/html5.vim
jade:digitaltoad/vim-jade
@@ -141,6 +141,7 @@ PACKS="
powershell:Persistent13/vim-ps1
protobuf:uarun/vim-protobuf
python:mitsuhiko/vim-python-combined
qml:peterhoeg/vim-qml
r-lang:vim-scripts/R.vim
ragel:jneen/ragel.vim
rspec:sheerun/rspec.vim

View File

@@ -64,6 +64,10 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
autocmd BufNewFile,BufRead *.emblem set filetype=emblem
autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1
au BufNewFile,BufRead *.erl,*.hrl,rebar.config,*.app,*.app.src,*.yaws,*.xrl set ft=erlang
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
autocmd BufNewFile,BufRead *.git/{,modules/**/,worktrees/*/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit
@@ -114,6 +118,10 @@ autocmd BufNewFile,BufRead *.haml,*.hamlbars,*.hamlc setf haml
autocmd BufNewFile,BufRead *.sass setf sass
autocmd BufNewFile,BufRead *.scss setf scss
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
au BufRead,BufNewFile *.hsc set filetype=haskell
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haxe') == -1
autocmd BufNewFile,BufRead *.hx setf haxe
@@ -249,6 +257,10 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1
au! BufRead,BufNewFile *.pp setfiletype puppet
au! BufRead,BufNewFile Puppetfile setfiletype ruby
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
autocmd BufRead,BufNewFile *.qml setfiletype qml
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
function! s:setf(filetype) abort

69
ftplugin/cabal.vim Normal file
View File

@@ -0,0 +1,69 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
if exists("g:loaded_haskellvim_cabal")
finish
endif
let g:loaded_haskellvim_cabal = 1
function! s:makeSection(content)
return "\n" . join(a:content, "\n")
endfunction
function! s:exeTmpl(name, src)
let l:exetmpl = [ 'executable ' . a:name,
\ '-- ghc-options:',
\ 'main-is: ' . a:src,
\ '-- other-modules:',
\ '-- other-extensions:',
\ 'build-depends: base',
\ '-- hs-source-dirs:',
\ 'default-language: Haskell2010'
\ ]
return s:makeSection(l:exetmpl)
endfunction
function! s:libTmpl()
let l:libtmpl = [ 'library',
\ '-- ghc-options:',
\ '-- other-modules:',
\ '-- other-extensions:',
\ 'build-depends: base',
\ '-- hs-source-dirs:',
\ 'default-language: Haskell2010'
\ ]
return s:makeSection(l:libtmpl)
endfunction
function! s:flagTmpl(name)
let l:flagtmpl = [ 'flag ' . a:name,
\ 'description:',
\ 'default: False',
\ 'manual: True',
\ ]
return s:makeSection(l:flagtmpl)
endfunction
function! cabal#addExecutable()
let l:name = input("Enter executable name: ")
let l:src = input("Enter source file: ")
exe "normal Go" . s:exeTmpl(l:name, l:src)
endfunction
function! cabal#addLibrary()
exe "normal Go" . s:libTmpl()
endfunction
function! cabal#addFlag()
let l:name = input("Enter flag name: ")
exe "normal Go" . s:flagTmpl(l:name)
endfunction
command! -buffer CabalAddExecutable call cabal#addExecutable()
command! -buffer CabalAddLibrary call cabal#addLibrary()
command! -buffer CabalAddFlag call cabal#addFlag()
endif

25
ftplugin/haskell.vim Normal file
View File

@@ -0,0 +1,25 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
if exists("g:loaded_haskellvim_haskell")
finish
endif
let g:loaded_haskellvim_haskell = 1
function! haskell#makeModuleCommentBlock()
let l:commenttmpl = [ '{-|',
\ 'Module : ',
\ 'Description : ',
\ 'Copyright : ',
\ 'License : ',
\ 'Maintainer : ',
\ 'Stability : ',
\ 'Portability : ',
\ '-}']
exe "normal ggO" . join(l:commenttmpl, "\n")
endfunction
command! -buffer -nargs=0 HaskellAddModuleComment call haskell#makeModuleCommentBlock()
endif

41
ftplugin/qml.vim Normal file
View File

@@ -0,0 +1,41 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
" Vim filetype plugin file
" Language: qml
" Last change: 2014 Feb 8
if exists( 'b:did_ftplugin' )
finish
endif
let b:did_ftplugin = 1
let s:cpoptions_save = &cpoptions
set cpoptions&vim
" command for undo
let b:undo_ftplugin =
\ 'let b:browsefilter = "" | ' .
\ 'setlocal ' .
\ 'comments< '.
\ 'commentstring< ' .
\ 'formatoptions< ' .
\ 'indentexpr<'
if has( 'gui_win32' )
\ && !exists( 'b:browsefilter' )
let b:browsefilter =
\ 'qml files (*.qml)\t*.qml\n' .
\ 'All files (*.*)\t*.*\n'
endif
" Set 'comments' to format dashed lists in comments.
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
setlocal commentstring=//%s
setlocal formatoptions-=t
setlocal formatoptions+=croql
let &cpoptions = s:cpoptions_save
unlet s:cpoptions_save
endif

View File

@@ -138,7 +138,7 @@ if exists('s:ruby_paths') && stridx(&l:tags, join(map(copy(s:ruby_paths),'v:val.
let &l:tags = &tags . ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',')
endif
if has("gui_win32") && !exists("b:browsefilter")
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "Ruby Source Files (*.rb)\t*.rb\n" .
\ "All Files (*.*)\t*.*\n"
endif

35
indent/cabal.vim Normal file
View File

@@ -0,0 +1,35 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
" indentation for cabal
"
" author: raichoo (raichoo@googlemail.com)
"
if exists('b:did_indent')
finish
endif
let b:did_indent = 1
if !exists('g:cabal_indent_section')
"executable name
">>main-is: Main.hs
">>hs-source-dirs: src
let g:cabal_indent_section = 2
elseif exists('g:cabal_indent_section') && g:cabal_indent_section > 4
let g:cabal_indent_section = 4
endif
setlocal indentexpr=GetCabalIndent()
setlocal indentkeys=!^F,o,O,<CR>
function! GetCabalIndent()
let l:prevline = getline(v:lnum - 1)
if l:prevline =~ '\C^\(executable\|library\|flag\|source-repository\|test-suite\|benchmark\)'
return g:cabal_indent_section
else
return match(l:prevline, '\S')
endif
endfunction
endif

189
indent/haskell.vim Normal file
View File

@@ -0,0 +1,189 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
" indentation for haskell
"
" Based on idris indentation
"
" author: raichoo (raichoo@googlemail.com)
"
" Modify g:haskell_indent_if and g:haskell_indent_case to
" change indentation for `if'(default 3) and `case'(default 5).
" Example (in .vimrc):
" > let g:haskell_indent_if = 2
if exists('b:did_indent')
finish
endif
let b:did_indent = 1
if !exists('g:haskell_indent_if')
" if bool
" >>>then ...
" >>>else ...
let g:haskell_indent_if = 3
endif
if !exists('g:haskell_indent_case')
" case xs of
" >>[] -> ...
" >>(y:ys) -> ...
let g:haskell_indent_case = 2
endif
if !exists('g:haskell_indent_let')
" let x = 0 in
" >>>>x
let g:haskell_indent_let = 4
endif
if !exists('g:haskell_indent_where')
" where f :: Int -> Int
" >>>>>>f x = x
let g:haskell_indent_where = 6
endif
if !exists('g:haskell_indent_do')
" do x <- a
" >>>y <- b
let g:haskell_indent_do = 3
endif
if !exists('g:haskell_indent_in')
" let x = 1
" >in x
let g:haskell_indent_in = 1
endif
setlocal indentexpr=GetHaskellIndent()
setlocal indentkeys=!^F,o,O,0\|,0=where,0=in,0=let,0=deriving,0=->,0=\=>,<CR>,0}
function! GetHaskellIndent()
let l:prevline = getline(v:lnum - 1)
if l:prevline =~ '^\s*--'
return match(l:prevline, '\S')
endif
if synIDattr(synID(line("."), col("."), 1), "name") == 'haskellBlockComment'
for l:c in range(v:lnum - 1, 0, -1)
let l:bline = getline(l:c)
if l:bline =~ '{-'
return 1 + match(l:bline, '{-')
endfor
return 1
endif
if l:prevline =~ '^\s*$'
return 0
endif
let l:line = getline(v:lnum)
if l:line =~ '\C^\s*\<where\>'
let l:s = match(l:prevline, '\S')
return l:s + &shiftwidth
endif
if l:line =~ '\C^\s*\<deriving\>'
let l:s = match(l:prevline, '\C\<\(newtype\|data\)\>')
if l:s >= 0
return l:s + &shiftwidth
endif
endif
if l:line =~ '\C^\s*\<let\>'
let l:s = match(l:prevline, '\C\<let\>')
if l:s != 0
return l:s
endif
endif
if l:line =~ '\C^\s*\<in\>'
let l:s = match(l:prevline, '\C\<let\>')
if l:s >= 0
return l:s + g:haskell_indent_in
elseif match(l:prevline, '=') > 0
let l:s = match(l:prevline, '\S')
return l:s - (4 - g:haskell_indent_in)
endif
endif
if l:line =~ '^\s*|'
if match(l:prevline, '^\s*data') < 0
if match(l:prevline, '^\s*|\s') >= 0
return match(l:prevline, '|')
else
return &shiftwidth
endif
endif
endif
if l:line =~ '^\s*[=-]>'
let l:s = match(l:prevline, ' :: ')
if l:s >= 0
return l:s + 1
endif
endif
if l:prevline =~ '\s\+[!#$%&*+./<>?@\\^|~-]\+\s*$'
let l:s = match(l:prevline, '\S')
if l:s > 0
return l:s + &shiftwidth
endif
endif
if l:prevline =~ '[{([][^})\]]\+$'
return match(l:prevline, '[{([]')
endif
if l:prevline =~ '\C\<let\>\s\+[^=]\+=\s*$'
return match(l:prevline, '\C\<let\>') + g:haskell_indent_let + &shiftwidth
endif
if l:prevline =~ '\C\<let\>\s\+.\+\(\<in\>\)\?\s*$'
return match(l:prevline, '\C\<let\>') + g:haskell_indent_let
endif
if l:prevline !~ '\C\<else\>'
let l:s = match(l:prevline, '\C\<if\>.*\&.*\zs\<then\>')
if l:s > 0
return l:s
endif
let l:s = match(l:prevline, '\C\<if\>')
if l:s > 0
return l:s + g:haskell_indent_if
endif
endif
if l:prevline =~ '\C\(\<where\>\|\<do\>\|=\|[{([]\)\s*$'
return match(l:prevline, '\S') + &shiftwidth
endif
if l:prevline =~ '\C\<where\>\s\+\S\+.*$'
return match(l:prevline, '\C\<where\>') + g:haskell_indent_where
endif
if l:prevline =~ '\C\<do\>\s\+\S\+.*$'
return match(l:prevline, '\C\<do\>') + g:haskell_indent_do
endif
if l:prevline =~ '\C^\s*\<data\>\s\+[^=]\+\s\+=\s\+\S\+.*$'
if l:line =~ '^\s*|'
return match(l:prevline, '=')
endif
endif
if l:prevline =~ '\C\<case\>\s\+.\+\<of\>\s*$'
return match(l:prevline, '\C\<case\>') + g:haskell_indent_case
endif
if l:prevline =~ '\C^\s*\<\data\>\s\+\S\+\s*$'
return match(l:prevline, '\C\<data\>') + &shiftwidth
endif
return match(l:prevline, '\S')
endfunction
endif

63
indent/qml.vim Normal file
View File

@@ -0,0 +1,63 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
" Vim indent file
" Language: QML
" Author: Robert Kieffer
" URL:
" Last Change: 2010-03-27 (Happy Birthday, Dash!)
"
" Improved JavaScript indent script.
" Indent script in place for this already?
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal indentexpr=GetJsIndent()
setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e,*<Return>,=*/
" Only define functions once per session
if exists("*GetJsIndent")
finish
endif
" Clean up a line of code by removing trailing '//' comments, and trimming
" whitespace
function! Trim(line)
return substitute(substitute(a:line, '// .*', '', ''), '^\s*\|\s*$', '', 'g')
endfunction
function! GetJsIndent()
let num = v:lnum
let line = Trim(getline(num))
let pnum = prevnonblank(num - 1)
if pnum == 0
return 0
endif
let pline = Trim(getline(pnum))
let ind = indent(pnum)
" bracket/brace/paren blocks
if pline =~ '[{[(]$'
let ind += &sw
endif
if line =~ '^[}\])]'
let ind -= &sw
endif
" '/*' comments
if pline =~ '^/\*.*\*/'
" no indent for single-line form
elseif pline =~ '^/\*'
let ind += 1
elseif pline =~ '^\*/'
let ind -= 1
endif
return ind
endfunction
endif

View File

@@ -119,7 +119,7 @@ function! GetStylusIndent()
" if group !~? 'css.*' && line =~? ')\s*$' " match user functions
" return increase
if group =~? '\v^%(cssTagName|cssClassName|cssIdentifier|cssSelectorOp|cssSelectorOp2|cssBraces|cssAttributeSelector|cssPseudoClass|cssPseudoClassId|stylusId|stylusClass)$'
if group =~? '\v^%(cssTagName|cssClassName|cssIdentifier|cssSelectorOp|cssSelectorOp2|cssBraces|cssAttributeSelector|cssPseudo|stylusId|stylusClass)$'
return increase
elseif (group == 'stylusUserFunction') && (indent(lnum) == '0') " mixin definition
return increase

55
syntax/cabal.vim Normal file
View File

@@ -0,0 +1,55 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
" syntax highlighting for cabal
"
" author: raichoo (raichoo@googlemail.com)
if version < 600
syn clear
elseif exists("b:current_syntax")
finish
endif
syn match cabalLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=@Spell
syn match cabalIdentifier "[A-Za-z\-]*" contained
syn match cabalOperator "[<=>&|!]"
syn match cabalColon ":" contained
syn match cabalNumber "\<[0-9][0-9\.*]*\>"
syn match cabalDelimiter "[,()]"
syn keyword cabalBool True False
syn keyword cabalConditional if else
syn match cabalCompilerFlag "\s\+-[^ -][^ ]*"
syn match cabalDocBulletPoint "^\s\+\*"
syn match cabalDocHeadline "^\s\+=.*$"
syn match cabalDocCode "^\s\+>.*$"
syn match cabalDocNewline "^\s\+\.\s*$"
syn match cabalSection "^\c\(executable\|library\|flag\|source-repository\|test-suite\|benchmark\)"
syn match cabalEntry "^\s*[A-Za-z][a-zA-Z\-]*:" contains=cabalIdentifier,cabalColon
syn region cabalDescription start="^\s*[dD]escription:" end="^\<" keepend
\ contains=
\ cabalEntry,
\ cabalLineComment,
\ cabalDocBulletPoint,
\ cabalDocHeadline,
\ cabalDocNewline,
\ cabalDocCode
highlight def link cabalIdentifier Identifier
highlight def link cabalLineComment Comment
highlight def link cabalOperator Operator
highlight def link cabalColon Operator
highlight def link cabalNumber Number
highlight def link cabalSection Structure
highlight def link cabalDelimiter Delimiter
highlight def link cabalBool Boolean
highlight def link cabalCompilerFlag Macro
highlight def link cabalConditional Conditional
highlight def link cabalDocBulletPoint Structure
highlight def link cabalDocHeadline Include
highlight def link cabalDocNewline Operator
highlight def link cabalDocCode Macro
let b:current_syntax = "cabal"
endif

180
syntax/haskell.vim Normal file
View File

@@ -0,0 +1,180 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
" syntax highlighting for haskell
"
" Heavily modified version of the haskell syntax
" highlighter to support haskell.
"
" author: raichoo (raichoo@googlemail.com)
if version < 600
syn clear
elseif exists("b:current_syntax")
finish
endif
syn match haskellRecordField contained containedin=haskellBlock
\ "[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)"
\ contains=
\ haskellIdentifier,
\ haskellOperators,
\ haskellSeparator,
\ haskellParens,
syn match haskellTypeSig
\ "^\s*\(where\s\+\|let\s\+\|default\s\+\)\?[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)"
\ contains=
\ haskellWhere,
\ haskellLet,
\ haskellIdentifier,
\ haskellOperators,
\ haskellSeparator,
\ haskellParens,
syn keyword haskelLWhere where
syn keyword haskellLet let
syn keyword haskellDeclKeyword module class instance newtype deriving in
syn match haskellDecl "\<\(type\|data\)\>\s\+\(\<family\>\)\?"
syn keyword haskellDefault default
syn keyword haskellImportKeywords import qualified safe as hiding contained
syn keyword haskellForeignKeywords foreign export import ccall safe unsafe interruptible capi prim contained
syn region haskellForeignImport start="\<foreign\>" end="::" keepend
\ contains=
\ haskellString,
\ haskellOperators,
\ haskellForeignKeywords,
\ haskellIdentifier
syn match haskellImport "^\<import\>\s\+\(\<safe\>\s\+\)\?\(\<qualified\>\s\+\)\?.\+\(\s\+\<as\>\s\+.\+\)\?\(\s\+\<hiding\>\)\?"
\ contains=
\ haskellParens,
\ haskellOperators,
\ haskellImportKeywords,
\ haskellType,
\ haskellLineComment,
\ haskellBlockComment,
\ haskellPragma,
syn keyword haskellStatement do case of
if exists('g:haskell_enable_static_pointers') && g:haskell_enable_static_pointers == 1
syn keyword haskellStatic static
endif
syn keyword haskellConditional if then else
syn match haskellNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>\|\<0[bB][10]\+\>"
syn match haskellFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
syn match haskellSeparator "[,;]"
syn region haskellParens matchgroup=haskellDelimiter start="(" end=")" contains=TOP,haskellTypeSig
syn region haskellBrackets matchgroup=haskellDelimiter start="\[" end="]" contains=TOP,haskellTypeSig
syn region haskellBlock matchgroup=haskellDelimiter start="{" end="}" contains=TOP
syn keyword haskellInfix infix infixl infixr
syn keyword haskellBottom undefined error
syn match haskellOperators "[-!#$%&\*\+/<=>\?@\\^|~:.]\+\|\<_\>"
syn match haskellQuote "\<'\+" contained
syn match haskellQuotedType "[A-Z][a-zA-Z0-9_']*\>" contained
syn region haskellQuoted start="\<'\+" end="\>"
\ contains=
\ haskellType,
\ haskellQuote,
\ haskellQuotedType,
\ haskellSeparator,
\ haskellParens,
\ haskellOperators,
\ haskellIdentifier
syn match haskellLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$"
\ contains=
\ haskellTodo,
\ @Spell
syn match haskellBacktick "`[A-Za-z_][A-Za-z0-9_\.']*`"
syn region haskellString start=+"+ skip=+\\\\\|\\"+ end=+"+
\ contains=@Spell
syn match haskellIdentifier "[_a-z][a-zA-z0-9_']*" contained
syn match haskellChar "\<'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'\>"
syn match haskellType "\<[A-Z][a-zA-Z0-9_']*\>"
syn region haskellBlockComment start="{-" end="-}"
\ contains=
\ haskellBlockComment,
\ haskellTodo,
\ @Spell
syn region haskellPragma start="{-#" end="#-}"
syn match haskellQuasiQuoted "." containedin=haskellQuasiQuote contained
syn region haskellQuasiQuote matchgroup=haskellTH start="\[[_a-z][a-zA-z0-9_']*|" end="|\]"
syn region haskellTHBlock matchgroup=haskellTH start="\[\(d\|t\|p\)\?|" end="|]" contains=TOP
syn region haskellTHDoubleBlock matchgroup=haskellTH start="\[||" end="||]" contains=TOP
syn match haskellPreProc "^#.*$"
syn keyword haskellTodo TODO FIXME contained
" Treat a shebang line at the start of the file as a comment
syn match haskellShebang "\%^#!.*$"
if exists('g:haskell_enable_typeroles') && g:haskell_enable_typeroles == 1
syn keyword haskellTypeRoles phantom representational nominal contained
syn region haskellTypeRoleBlock matchgroup=haskellTypeRoles start="type\s\+role" end="$" keepend
\ contains=
\ haskellType,
\ haskellTypeRoles
endif
if exists('g:haskell_enable_quantification') && g:haskell_enable_quantification == 1
syn keyword haskellForall forall
endif
if exists('g:haskell_enable_recursivedo') && g:haskell_enable_recursivedo == 1
syn keyword haskellRecursiveDo mdo rec
endif
if exists('g:haskell_enable_arrowsyntax') && g:haskell_enable_arrowsyntax == 1
syn keyword haskellArrowSyntax proc
endif
if exists('g:haskell_enable_pattern_synonyms') && g:haskell_enable_pattern_synonyms == 1
syn keyword haskellPatternKeyword pattern
endif
highlight def link haskellBottom Macro
highlight def link haskellTH Boolean
highlight def link haskellBlockKeywords Structure
highlight def link haskellIdentifier Identifier
highlight def link haskellForeignKeywords Structure
highlight def link haskellDeriving Structure
highlight def link haskellStatement Statement
highlight def link haskellDefault Statement
highlight def link haskellConditional Conditional
highlight def link haskellNumber Number
highlight def link haskellFloat Float
highlight def link haskellSeparator Delimiter
highlight def link haskellDelimiter Delimiter
highlight def link haskellInfix PreProc
highlight def link haskellOperators Operator
highlight def link haskellQuote Operator
highlight def link haskellQuotedType Include
highlight def link haskellType Include
highlight def link haskellShebang Comment
highlight def link haskellLineComment Comment
highlight def link haskellBlockComment Comment
highlight def link haskellPragma SpecialComment
highlight def link haskellString String
highlight def link haskellChar String
highlight def link haskellBacktick Operator
highlight def link haskellPreProc Macro
highlight def link haskellTodo Todo
highlight def link haskellAssocType Structure
highlight def link haskellImportBlock Delimiter
highlight def link haskellImportKeywords Structure
highlight def link haskellDeclKeyword Structure
highlight def link haskellDecl Structure
highlight def link haskellWhere Structure
highlight def link haskellLet Structure
highlight def link haskellQuasiQuoted String
if exists('g:haskell_enable_quantification') && g:haskell_enable_quantification == 1
highlight def link haskellForall Operator
endif
if exists('g:haskell_enable_recursivedo') && g:haskell_enable_recursivedo == 1
highlight def link haskellRecursiveDo Operator
endif
if exists('g:haskell_enable_arrowsyntax') && g:haskell_enable_arrowsyntax == 1
highlight def link haskellArrowSyntax Operator
endif
if exists('g:haskell_enable_pattern_synonyms') && g:haskell_enable_pattern_synonyms == 1
highlight def link haskellPatternKeyword Structure
endif
if exists('g:haskell_enable_typeroles') && g:haskell_enable_typeroles == 1
highlight def link haskellTypeRoles Structure
endif
if exists('g:haskell_enable_static_pointers') && g:haskell_enable_static_pointers == 1
highlight def link haskellStatic Statement
endif
let b:current_syntax = "haskell"
endif

View File

@@ -87,14 +87,14 @@ exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start=
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*\z(\z(`\)\{3,}\|\z(\~\)\{3,}\)[^`]*$" end="^\s*\z1\%(\z2\z3\)*\ze\s*$" keepend
syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*```.*$" end="^\s*```\ze\s*$" keepend
syn match markdownFootnote "\[^[^\]]\+\]"
syn match markdownFootnoteDefinition "^\[^[^\]]\+\]:"
if main_syntax ==# 'markdown'
for s:type in g:markdown_fenced_languages
exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*\z(\z(`\)\{3,}\|\z(\~\)\{3,}\)\s*'.matchstr(s:type,'[^=]*').'\>[^`]*$" end="^\s*\z1\%(\z2\z3\)*\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g')
exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*```\s*'.matchstr(s:type,'[^=]*').'\>.*$" end="^\s*```\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g')
endfor
unlet! s:type
endif

137
syntax/qml.vim Normal file
View File

@@ -0,0 +1,137 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
" Vim syntax file
" Language: QML
" Maintainer: Warwick Allison <warwick.allison@nokia.com>
" Updaters:
" URL:
" Changes:
" Last Change: 2009 Apr 30
" Based on javascript syntax (as is QML)
if !exists("main_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
let main_syntax = 'qml'
endif
" Drop fold if it set but vim doesn't support it.
if version < 600 && exists("qml_fold")
unlet qml_fold
endif
syn case ignore
syn keyword qmlCommentTodo TODO FIXME XXX TBD contained
syn match qmlLineComment "\/\/.*" contains=@Spell,qmlCommentTodo
syn match qmlCommentSkip "^[ \t]*\*\($\|[ \t]\+\)"
syn region qmlComment start="/\*" end="\*/" contains=@Spell,qmlCommentTodo fold
syn match qmlSpecial "\\\d\d\d\|\\."
syn region qmlStringD start=+"+ skip=+\\\\\|\\"\|\\$+ end=+"\|$+ contains=qmlSpecial,@htmlPreproc
syn region qmlStringS start=+'+ skip=+\\\\\|\\'\|\\$+ end=+'\|$+ contains=qmlSpecial,@htmlPreproc
syn match qmlCharacter "'\\.'"
syn match qmlNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
syn region qmlRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi]\{0,2\}\s*$+ end=+/[gi]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline
syn match qmlObjectLiteralType "[A-Za-z][_A-Za-z0-9]*\s*\({\)\@="
syn match qmlNonBindingColon "?[^;]*:"
syn match qmlBindingProperty "\<[A-Za-z][_A-Za-z.0-9]*\s*:"
syn keyword qmlConditional if else switch
syn keyword qmlRepeat while for do in
syn keyword qmlBranch break continue
syn keyword qmlOperator new delete instanceof typeof
syn keyword qmlJsType Array Boolean Date Function Number Object String RegExp
syn keyword qmlType action alias bool color date double enumeration font int list point real rect size string time url variant vector3d
syn keyword qmlStatement return with
syn keyword qmlBoolean true false
syn keyword qmlNull null undefined
syn keyword qmlIdentifier arguments this var
syn keyword qmlLabel case default
syn keyword qmlException try catch finally throw
syn keyword qmlMessage alert confirm prompt status
syn keyword qmlGlobal self
syn keyword qmlDeclaration property signal
syn keyword qmlReserved abstract boolean byte char class const debugger enum export extends final float goto implements import interface long native package pragma private protected public short static super synchronized throws transient volatile
if get(g:, 'qml_fold', 0)
syn match qmlFunction "\<function\>"
syn region qmlFunctionFold start="\<function\>.*[^};]$" end="^\z1}.*$" transparent fold keepend
syn sync match qmlSync grouphere qmlFunctionFold "\<function\>"
syn sync match qmlSync grouphere NONE "^}"
setlocal foldmethod=syntax
setlocal foldtext=getline(v:foldstart)
else
syn keyword qmlFunction function
syn match qmlBraces "[{}\[\]]"
syn match qmlParens "[()]"
endif
syn sync fromstart
syn sync maxlines=100
if main_syntax == "qml"
syn sync ccomment qmlComment
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_qml_syn_inits")
if version < 508
let did_qml_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink qmlComment Comment
HiLink qmlLineComment Comment
HiLink qmlCommentTodo Todo
HiLink qmlSpecial Special
HiLink qmlStringS String
HiLink qmlStringD String
HiLink qmlCharacter Character
HiLink qmlNumber Number
HiLink qmlConditional Conditional
HiLink qmlRepeat Repeat
HiLink qmlBranch Conditional
HiLink qmlOperator Operator
HiLink qmlJsType Type
HiLink qmlType Type
HiLink qmlObjectLiteralType Type
HiLink qmlStatement Statement
HiLink qmlFunction Function
HiLink qmlBraces Function
HiLink qmlError Error
HiLink qmlNull Keyword
HiLink qmlBoolean Boolean
HiLink qmlRegexpString String
HiLink qmlIdentifier Identifier
HiLink qmlLabel Label
HiLink qmlException Exception
HiLink qmlMessage Keyword
HiLink qmlGlobal Keyword
HiLink qmlReserved Keyword
HiLink qmlDebug Debug
HiLink qmlConstant Label
HiLink qmlNonBindingColon NONE
HiLink qmlBindingProperty Label
HiLink qmlDeclaration Function
delcommand HiLink
endif
let b:current_syntax = "qml"
if main_syntax == 'qml'
unlet main_syntax
endif
endif

View File

@@ -82,7 +82,7 @@ syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedPare
syn cluster rubyRegexpSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment
" Numbers and ASCII Codes
syn match rubyASCIICode "\%(\w\|[]})\"'/]\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)"
syn match rubyASCIICode "\%(\w\|[]})\"'/\.]\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)"
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[xX]\x\+\%(_\x\+\)*\>" display
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)\>" display
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[oO]\=\o\+\%(_\o\+\)*\>" display
@@ -131,14 +131,12 @@ syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomx
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial fold
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold
" Normal String and Shell Command Output
if exists('ruby_spellcheck_strings')
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial,@Spell fold
syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape,@Spell fold
else
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold
syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold
endif
" Normal String
let s:spell_cluster = exists('ruby_spellcheck_strings') ? ',@Spell' : ''
exe 'syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" fold contains=@rubyStringSpecial' . s:spell_cluster
exe 'syn region rubyString matchgroup=rubyStringDelimiter start="''" end="''" skip="\\\\\|\\''" fold contains=rubyQuoteEscape' . s:spell_cluster
" Shell Command Output
syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold
" Generalized Single Quoted String, Symbol and Array of Strings

View File

@@ -1,9 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
{ [Error: ENOENT, no such file or directory 'dom-document.yml']
errno: -2,
code: 'ENOENT',
path: 'dom-document.yml',
syscall: 'open' }
endif

View File

@@ -1,9 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
{ [Error: ENOENT, no such file or directory 'dom-elem.yml']
errno: -2,
code: 'ENOENT',
path: 'dom-elem.yml',
syscall: 'open' }
endif

View File

@@ -1,9 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
{ [Error: ENOENT, no such file or directory 'dom-event.yml']
errno: -2,
code: 'ENOENT',
path: 'dom-event.yml',
syscall: 'open' }
endif

View File

@@ -1,9 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
{ [Error: ENOENT, no such file or directory 'dom-node.yml']
errno: -2,
code: 'ENOENT',
path: 'dom-node.yml',
syscall: 'open' }
endif

View File

@@ -1,9 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
{ [Error: ENOENT, no such file or directory 'dom-storage.yml']
errno: -2,
code: 'ENOENT',
path: 'dom-storage.yml',
syscall: 'open' }
endif