This commit is contained in:
Adam Stankiewicz 2016-07-05 09:53:49 +02:00
parent a5857b81c2
commit bf188c4a51
No known key found for this signature in database
GPG Key ID: A62480DCEAC884DF
17 changed files with 121 additions and 92 deletions

View File

@ -99,12 +99,22 @@ au BufNewFile,BufRead *.elm set filetype=elm
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
if !exists('g:vim_ember_script')
let g:vim_ember_script = 1
endif
autocmd BufNewFile,BufRead *.em set filetype=ember-script
autocmd FileType ember-script set tabstop=2|set shiftwidth=2|set expandtab
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
autocmd BufNewFile,BufRead *.emblem set filetype=emblem
if !exists('g:vim_emblem')
let g:vim_emblem = 1
endif
if exists('g:vim_ember_script')
autocmd BufNewFile,BufRead *.emblem set filetype=emblem
else
autocmd BufNewFile,BufRead *.em,*.emblem set filetype=emblem
endif
autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1

View File

@ -11,6 +11,8 @@ endif
runtime! ftplugin/html.vim
let b:did_ftplugin = 1
setlocal iskeyword+=@-@
setlocal suffixesadd=.blade.php,.php
setlocal includeexpr=substitute(v:fname,'\\.','/','g')
setlocal path+=resources/views;
endif

View File

@ -15,7 +15,7 @@ call coffee#CoffeeSetUpVariables()
setlocal formatoptions-=t formatoptions+=croql
setlocal comments=:# commentstring=#\ %s
setlocal omnifunc=javascriptcomplete#CompleteJS
setlocal suffixesadd+=coffee
setlocal suffixesadd+=.coffee
" Create custom augroups.
augroup CoffeeBufUpdate | augroup END

View File

@ -56,6 +56,6 @@ let &l:path =
setlocal includeexpr=GetElixirFilename(v:fname)
setlocal suffixesadd=.ex,.exs,.eex,.erl,.yrl,.hrl
setlocal formatoptions-=t formatoptions+=croqlj
silent! setlocal formatoptions-=t formatoptions+=croqlj
endif

View File

@ -1,10 +1,10 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
" Language: ember-script
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
" URL: http://github.com/heartsentwined/vim-ember-script
" Version: 1.0.1
" Last Change: 2013 Apr 17
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>>
" URL: http://github.com/yalesov/vim-ember-script
" Version: 1.0.3
" Last Change: 2016 Jul 5
" License: GPL-3.0
setlocal tabstop=2
@ -14,7 +14,11 @@ setlocal smarttab
setlocal expandtab
setlocal smartindent
setlocal formatoptions-=t formatoptions+=croqlj
if v:version < 703
setlocal formatoptions-=t formatoptions+=croql
else
setlocal formatoptions-=t formatoptions+=croqlj
endif
setlocal comments=:#
setlocal commentstring=#\ %s

View File

@ -1,10 +1,10 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
" Language: emblem
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
" URL: http://github.com/heartsentwined/vim-emblem
" Version: 1.2.0
" Last Change: 2013 Apr 22
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>
" URL: http://github.com/yalesov/vim-emblem
" Version: 2.0.0
" Last Change: 2016 Jul 5
" License: GPL-3.0
setlocal tabstop=2

View File

@ -77,20 +77,20 @@ function! s:query_path(root) abort
let prefix = ''
endif
if &shellxquote == "'"
let path_check = prefix.'ruby -e "' . code . '"'
let path_check = prefix.'ruby -e --disable-gems"' . code . '"'
else
let path_check = prefix."ruby -e '" . code . "'"
let path_check = prefix."ruby -e --disable-gems'" . code . "'"
endif
let cd = haslocaldir() ? 'lcd' : 'cd'
let cwd = getcwd()
let cwd = fnameescape(getcwd())
try
exe cd fnameescape(a:root)
let path = split(system(path_check),',')
exe cd fnameescape(cwd)
exe cd cwd
return path
finally
exe cd fnameescape(cwd)
exe cd cwd
endtry
endfunction

View File

@ -36,10 +36,11 @@ function! GetBladeIndent()
let line = substitute(substitute(getline(lnum), '\s\+$', '', ''), '^\s\+', '', '')
let cline = substitute(substitute(getline(v:lnum), '\s\+$', '', ''), '^\s\+', '', '')
let indent = indent(lnum)
let cindent = indent(v:lnum)
if cline =~# '@\%(else\|elseif\|empty\|end\|show\|stop\)' ||
\ cline =~# '\%(<?.*\)\@<!?>\|\%({{.*\)\@<!}}\|\%({!!.*\)\@<!!!}'
let indent = indent - &sw
elseif line =~# '<?\%(.*?>\)\@!'
let indent = indent + &sw
else
if exists("*GetBladeIndentCustom")
let hindent = GetBladeIndentCustom()
@ -56,17 +57,12 @@ function! GetBladeIndent()
endif
endif
let increase = indent + &sw
if indent = indent(lnum)
let indent = cindent <= indent ? -1 : increase
endif
if line =~# '@\%(section\)\%(.*@end\)\@!' && line !~# '@\%(section\)\s*([^,]*)'
return indent
elseif line =~# '@\%(if\|elseif\|else\|unless\|foreach\|forelse\|for\|while\|empty\|push\|section\|can\|hasSection\)\%(.*@end\|.*@stop\)\@!' ||
\ line =~# '{{\%(.*}}\)\@!' || line =~# '{!!\%(.*!!}\)\@!'
return increase
elseif line =~# '<?\%(.*?>\)\@!'
return indent(lnum-1) == -1 ? increase : indent(lnum) + increase
else
return indent
endif

View File

@ -1,10 +1,10 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
" Language: ember-script
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
" URL: http://github.com/heartsentwined/vim-ember-script
" Version: 1.0.1
" Last Change: 2013 Apr 17
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>>
" URL: http://github.com/yalesov/vim-ember-script
" Version: 1.0.3
" Last Change: 2016 Jul 5
" License: GPL-3.0
if exists('b:did_indent')

View File

@ -1,10 +1,10 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
" Language: emblem
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
" URL: http://github.com/heartsentwined/vim-emblem
" Version: 1.2.0
" Last Change: 2013 Apr 22
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>
" URL: http://github.com/yalesov/vim-emblem
" Version: 2.0.0
" Last Change: 2016 Jul 5
" License: GPL-3.0
endif

View File

@ -21,6 +21,12 @@ unlet! b:current_syntax
syn case match
syn clear htmlError
if has('patch-7.4.1142')
syn iskeyword @,48-57,_,192-255,@-@
else
setlocal iskeyword+=@-@
endif
syn region bladeEcho matchgroup=bladeDelimiter start="@\@<!{{" end="}}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend
syn region bladeEcho matchgroup=bladeDelimiter start="{!!" end="!!}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend
syn region bladeComment matchgroup=bladeDelimiter start="{{--" end="--}}" contains=bladeTodo containedin=ALLBUT,@bladeExempt keepend

View File

@ -1,10 +1,10 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
" Language: ember-script
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
" URL: http://github.com/heartsentwined/vim-ember-script
" Version: 1.0.1
" Last Change: 2013 Apr 17
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>>
" URL: http://github.com/yalesov/vim-ember-script
" Version: 1.0.3
" Last Change: 2016 Jul 5
" License: GPL-3.0
if exists('b:current_syntax') && b:current_syntax == 'ember-script'

View File

@ -1,10 +1,10 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
" Language: emblem
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
" URL: http://github.com/heartsentwined/vim-emblem
" Version: 1.2.0
" Last Change: 2013 Apr 22
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>
" URL: http://github.com/yalesov/vim-emblem
" Version: 2.0.0
" Last Change: 2016 Jul 5
" License: GPL-3.0
" Quit when a syntax file is already loaded.
@ -31,7 +31,7 @@ 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
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
@ -40,7 +40,7 @@ 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 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
@ -48,24 +48,38 @@ hi def link eblHbsHelper eblFunction
hi def link eblHbsTextOp eblOperator
hi def link eblHbsText eblRaw
syn cluster eblHbsHelpers contains=eblHbsHelper,eblHbsCtrlFlowHelper,eblHbsEachHelper
syn cluster eblHbsHelpers contains=eblHbsHelper,eblHbsCtrlFlowHelper,eblHbsEachHelper,eblHbsWithHelper
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 eblHbsCtrlFlowHelper '\v<(else if|if|unless|else)>' 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
syn match eblHbsWithHelper '\v<with>' nextgroup=eblHbsWithArg skipwhite contained display
syn match eblHbsWithArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblHbsAs skipwhite contained display
syn match eblHbsAs '\v<as>' nextgroup=eblHbsAsBlockStartArg skipwhite contained display
syn match eblHbsAsBlockStartArg /\v\|/ nextgroup=eblHbsAsBlockFirstArg skipwhite contained display
syn match eblHbsAsBlockFirstArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblHbsAsBlockSecondArg,eblHbsAsBlockEndArg skipwhite contained display
syn match eblHbsAsBlockSecondArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblHbsAsBlockEndArg skipwhite contained display
syn match eblHbsAsBlockEndArg /\v\|/ 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
hi def link eblHbsWithHelper eblKeyword
hi def link eblHbsWithArg eblLiteral
hi def link eblHbsAs eblKeyword
hi def link eblHbsAsBlockStartArg eblOperator
hi def link eblHbsAsBlockFirstArg eblLiteral
hi def link eblHbsAsBlockSecondArg eblLiteral
hi def link eblHbsAsBlockEndArg eblOperator
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
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
@ -106,6 +120,7 @@ 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
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

View File

@ -73,12 +73,8 @@ if !exists("g:go_highlight_fields")
let g:go_highlight_fields = 0
endif
if !exists("g:go_highlight_structs")
let g:go_highlight_structs = 0
endif
if !exists("g:go_highlight_interfaces")
let g:go_highlight_interfaces = 0
if !exists("g:go_highlight_types")
let g:go_highlight_types = 0
endif
if !exists("g:go_highlight_build_constraints")
@ -100,12 +96,10 @@ endif
syn case match
syn keyword goDirective package import
syn keyword goDeclaration var const type
syn keyword goDeclType struct interface
syn keyword goDeclaration var const
hi def link goDirective Statement
hi def link goDeclaration Keyword
hi def link goDeclType Keyword
" Keywords within functions
syn keyword goStatement defer go goto return break continue fallthrough
@ -131,10 +125,6 @@ hi def link goUnsignedInts Type
hi def link goFloats Type
hi def link goComplexes Type
" Treat func specially: it's a declaration at the start of a line, but a type
" elsewhere. Order matters here.
syn match goDeclaration /\<func\>/
" Predefined functions and values
syn match goBuiltins /\<\v(append|cap|close|complex|copy|delete|imag|len)\ze\(/
@ -303,38 +293,43 @@ hi def link goOperator Operator
" Functions;
if g:go_highlight_functions != 0
syn match goFunction /\(func\s\+\)\@<=\w\+\((\)\@=/
syn match goFunction /\()\s\+\)\@<=\w\+\((\)\@=/
syn match goDeclaration /\<func\>/ nextgroup=goReceiver,goFunction skipwhite skipnl
syn match goReceiver /([^),]\+)/ contained nextgroup=goFunction contains=goReceiverType skipwhite skipnl
syn match goReceiverType /\(\s\|*\)\w\+)/hs=s+1,he=e-1 contained
syn match goFunction /\w\+/ contained
else
syn keyword goDeclaration func
endif
hi def link goReceiverType Type
hi def link goFunction Function
" Methods;
if g:go_highlight_methods != 0
syn match goMethod /\(\.\)\@<=\w\+\((\)\@=/
syn match goMethod /\.\w\+(/hs=s+1,he=e-1
endif
hi def link goMethod Type
" Fields;
if g:go_highlight_fields != 0
syn match goField /\(\.\)\@<=\a\+\([\ \n\r\:\)]\)\@=/
syn match goVarArgs /\.\.\.\w\+\>/
syn match goField /\.\a\+\([\ \n\r\:\)\[]\)\@=/hs=s+1
endif
hi def link goField Type
hi def link goField Identifier
" Structs;
if g:go_highlight_structs != 0
syn match goStruct /\(.\)\@<=\w\+\({\)\@=/
syn match goStructDef /\(type\s\+\)\@<=\w\+\(\s\+struct\s\+{\)\@=/
" Structs & Interfaces;
if g:go_highlight_types != 0
syn match goTypeConstructor /\<\w\+{/he=e-1
syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl
syn match goDeclType /\<interface\|struct\>/ contained skipwhite skipnl
else
syn keyword goDeclType struct interface
syn keyword goDeclaration type
endif
hi def link goStruct Function
hi def link goStructDef Function
" Interfaces;
if g:go_highlight_interfaces != 0
syn match goInterface /\(.\)\@<=\w\+\({\)\@=/
syn match goInterfaceDef /\(type\s\+\)\@<=\w\+\(\s\+interface\s\+{\)\@=/
endif
hi def link goInterface Function
hi def link goInterfaceDef Function
hi def link goTypeConstructor Type
hi def link goTypeName Type
hi def link goTypeDecl Keyword
hi def link goDeclType Keyword
" Build Constraints
if g:go_highlight_build_constraints != 0

View File

@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
" Vim syntax file
" Language: Kotlin
" Maintainer: Alexander Udalov
" Latest Revision: 24 February 2016
" Latest Revision: 4 July 2016
if exists("b:current_syntax")
finish
@ -22,14 +22,14 @@ syn keyword ktInclude import package
syn keyword ktType Any Boolean Byte Char Double Float Int Long Nothing Short Unit
syn keyword ktModifier annotation companion enum inner internal private protected public abstract final open override sealed vararg dynamic
syn keyword ktStructure class object interface fun val var constructor init
syn keyword ktStructure class object interface typealias fun val var constructor init
syn keyword ktReservedKeyword async typealias typeof yield
syn keyword ktReservedKeyword typeof
syn keyword ktBoolean true false
syn keyword ktConstant null
syn keyword ktModifier data tailrec lateinit reified external inline noinline crossinline const operator infix
syn keyword ktModifier data tailrec lateinit reified external inline noinline crossinline const operator infix coroutine suspend
syn keyword ktTodo TODO FIXME XXX contained
syn match ktShebang "\v^#!.*$"

View File

@ -127,6 +127,7 @@ syn match pgsqlKeyword "\<for\_s\+\(search\|order\_s\+by\)\>"
syn match pgsqlKeyword "\<\(no\_s\+\)\?inherit\>"
syn match pgsqlKeyword "\<\(not\_s\+\)\?of\>"
syn match pgsqlKeyword "\<primary\_s\+key\>"
syn match pgsqlKeyword "\<foreign\_s\+key\>"
syn match pgsqlKeyword "\<replica\_s\+identity\>"
syn match pgsqlKeyword "\<using\(\_s\+index\(\_s\+tablespace\)\?\)\?\>"
syn match pgsqlKeyword "\<with\(out\)\?\_s\+function\>"

View File

@ -34,8 +34,8 @@ syn cluster pugTop contains=pugBegin,pugComment,pugHtmlComment,pugJavascript
syn match pugBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=pugTag,pugClassChar,pugIdChar,pugPlainChar,pugJavascript,pugScriptConditional,pugScriptStatement,pugPipedText
syn match pugTag "+\?\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@pugComponent
syn cluster pugComponent contains=pugAttributes,pugIdChar,pugBlockExpansionChar,pugClassChar,pugPlainChar,pugJavascript,pugTagBlockChar,pugTagInlineText
syn match pugComment '\s*\/\/.*$'
syn region pugCommentBlock start="\z(\s*\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" keepend
syn match pugComment '\(\s\+\|^\)\/\/.*$'
syn region pugCommentBlock start="\z(\s\+\|^\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" keepend
syn region pugHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->"
syn region pugAttributes matchgroup=pugAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,pugHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@pugComponent
syn match pugClassChar "\." contained nextgroup=pugClass