Compare commits

...

2 Commits

Author SHA1 Message Date
Adam Stankiewicz
4071c094c6 Update 2014-12-09 23:09:20 +01:00
Adam Stankiewicz
617b01a5b6 Update 2014-11-11 02:37:21 +01:00
57 changed files with 1037 additions and 497 deletions

View File

@@ -1,5 +1,5 @@
" Language: CoffeeScript " Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com> " Maintainer: Mick Koch <mick@kochm.co>
" URL: http://github.com/kchmck/vim-coffee-script " URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL " License: WTFPL

View File

@@ -1,10 +1,13 @@
" Vim syntax file " Vim syntax file
" Language: C Additions " Language: C Additions
" Maintainer: Jon Haggblad <jon@haeggblad.com> " Maintainer: Jon Haggblad <jon@haeggblad.com>
" Contributor: Mikhail Wolfson <mywolfson@gmail.com>
" URL: http://www.haeggblad.com " URL: http://www.haeggblad.com
" Last Change: 9 Aug 2014 " Last Change: 6 Sep 2014
" Version: 0.1 " Version: 0.3
" Changelog: " Changelog:
" 0.3 - integration of aftersyntaxc.vim
" 0.2 - Cleanup
" 0.1 - initial version. " 0.1 - initial version.
" "
" Syntax highlighting for functions in C. " Syntax highlighting for functions in C.
@@ -13,15 +16,279 @@
" http://stackoverflow.com/questions/736701/class-function-names-highlighting-in-vim " http://stackoverflow.com/questions/736701/class-function-names-highlighting-in-vim
" ----------------------------------------------------------------------------- " -----------------------------------------------------------------------------
" Highlight Class and Function names. " Highlight function names.
" ----------------------------------------------------------------------------- " -----------------------------------------------------------------------------
syn match cCustomParen "(" contains=cParen contains=cCppParen syn match cCustomParen "(" contains=cParen contains=cCppParen
syn match cCustomFunc "\w\+\s*(\@=" contains=cCustomParen syn match cCustomFunc "\w\+\s*(\@=" contains=cCustomParen
syn match cCustomScope "::"
syn match cCustomClass "\w\+\s*::" contains=cCustomScope
hi def link cCustomFunc Function hi def link cCustomFunc Function
" -----------------------------------------------------------------------------
" Source: aftersyntaxc.vim
" -----------------------------------------------------------------------------
" Common ANSI-standard functions
syn keyword cAnsiFunction MULU_ DIVU_ MODU_ MUL_ DIV_ MOD_
syn keyword cAnsiFunction main typeof
syn keyword cAnsiFunction open close read write lseek dup dup2
syn keyword cAnsiFunction fcntl ioctl
syn keyword cAnsiFunction wctrans towctrans towupper
syn keyword cAnsiFunction towlower wctype iswctype
syn keyword cAnsiFunction iswxdigit iswupper iswspace
syn keyword cAnsiFunction iswpunct iswprint iswlower
syn keyword cAnsiFunction iswgraph iswdigit iswcntrl
syn keyword cAnsiFunction iswalpha iswalnum wcsrtombs
syn keyword cAnsiFunction mbsrtowcs wcrtomb mbrtowc
syn keyword cAnsiFunction mbrlen mbsinit wctob
syn keyword cAnsiFunction btowc wcsfxtime wcsftime
syn keyword cAnsiFunction wmemset wmemmove wmemcpy
syn keyword cAnsiFunction wmemcmp wmemchr wcstok
syn keyword cAnsiFunction wcsstr wcsspn wcsrchr
syn keyword cAnsiFunction wcspbrk wcslen wcscspn
syn keyword cAnsiFunction wcschr wcsxfrm wcsncmp
syn keyword cAnsiFunction wcscoll wcscmp wcsncat
syn keyword cAnsiFunction wcscat wcsncpy wcscpy
syn keyword cAnsiFunction wcstoull wcstoul wcstoll
syn keyword cAnsiFunction wcstol wcstold wcstof
syn keyword cAnsiFunction wcstod ungetwc putwchar
syn keyword cAnsiFunction putwc getwchar getwc
syn keyword cAnsiFunction fwide fputws fputwc
syn keyword cAnsiFunction fgetws fgetwc wscanf
syn keyword cAnsiFunction wprintf vwscanf vwprintf
syn keyword cAnsiFunction vswscanf vswprintf vfwscanf
syn keyword cAnsiFunction vfwprintf swscanf swprintf
syn keyword cAnsiFunction fwscanf fwprintf zonetime
syn keyword cAnsiFunction strfxtime strftime localtime
syn keyword cAnsiFunction gmtime ctime asctime
syn keyword cAnsiFunction time mkxtime mktime
syn keyword cAnsiFunction difftime clock strlen
syn keyword cAnsiFunction strerror memset strtok
syn keyword cAnsiFunction strstr strspn strrchr
syn keyword cAnsiFunction strpbrk strcspn strchr
syn keyword cAnsiFunction memchr strxfrm strncmp
syn keyword cAnsiFunction strcoll strcmp memcmp
syn keyword cAnsiFunction strncat strcat strncpy
syn keyword cAnsiFunction strcpy memmove memcpy
syn keyword cAnsiFunction wcstombs mbstowcs wctomb
syn keyword cAnsiFunction mbtowc mblen lldiv
syn keyword cAnsiFunction ldiv div llabs
syn keyword cAnsiFunction labs abs qsort
syn keyword cAnsiFunction bsearch system getenv
syn keyword cAnsiFunction exit atexit abort
syn keyword cAnsiFunction realloc malloc free
syn keyword cAnsiFunction calloc srand rand
syn keyword cAnsiFunction strtoull strtoul strtoll
syn keyword cAnsiFunction strtol strtold strtof
syn keyword cAnsiFunction strtod atoll atol
syn keyword cAnsiFunction atoi atof perror
syn keyword cAnsiFunction ferror feof clearerr
syn keyword cAnsiFunction rewind ftell fsetpos
syn keyword cAnsiFunction fseek fgetpos fwrite
syn keyword cAnsiFunction fread ungetc puts
syn keyword cAnsiFunction putchar putc gets
syn keyword cAnsiFunction getchar getc fputs
syn keyword cAnsiFunction fputc fgets fgetc
syn keyword cAnsiFunction vsscanf vsprintf vsnprintf
syn keyword cAnsiFunction vscanf vprintf vfscanf
syn keyword cAnsiFunction vfprintf sscanf sprintf
syn keyword cAnsiFunction snprintf scanf printf
syn keyword cAnsiFunction fscanf fprintf setvbuf
syn keyword cAnsiFunction setbuf freopen fopen
syn keyword cAnsiFunction fflush fclose tmpnam
syn keyword cAnsiFunction tmpfile rename remove
syn keyword cAnsiFunction offsetof va_start va_end
syn keyword cAnsiFunction va_copy va_arg raise signal
syn keyword cAnsiFunction longjmp setjmp isunordered
syn keyword cAnsiFunction islessgreater islessequal isless
syn keyword cAnsiFunction isgreaterequal isgreater fmal
syn keyword cAnsiFunction fmaf fma fminl
syn keyword cAnsiFunction fminf fmin fmaxl
syn keyword cAnsiFunction fmaxf fmax fdiml
syn keyword cAnsiFunction fdimf fdim nextafterxl
syn keyword cAnsiFunction nextafterxf nextafterx nextafterl
syn keyword cAnsiFunction nextafterf nextafter nanl
syn keyword cAnsiFunction nanf nan copysignl
syn keyword cAnsiFunction copysignf copysign remquol
syn keyword cAnsiFunction remquof remquo remainderl
syn keyword cAnsiFunction remainderf remainder fmodl
syn keyword cAnsiFunction fmodf fmod truncl
syn keyword cAnsiFunction truncf trunc llroundl
syn keyword cAnsiFunction llroundf llround lroundl
syn keyword cAnsiFunction lroundf lround roundl
syn keyword cAnsiFunction roundf round llrintl
syn keyword cAnsiFunction llrintf llrint lrintl
syn keyword cAnsiFunction lrintf lrint rintl
syn keyword cAnsiFunction rintf rint nearbyintl
syn keyword cAnsiFunction nearbyintf nearbyint floorl
syn keyword cAnsiFunction floorf floor ceill
syn keyword cAnsiFunction ceilf ceil tgammal
syn keyword cAnsiFunction tgammaf tgamma lgammal
syn keyword cAnsiFunction lgammaf lgamma erfcl
syn keyword cAnsiFunction erfcf erfc erfl
syn keyword cAnsiFunction erff erf sqrtl
syn keyword cAnsiFunction sqrtf sqrt powl
syn keyword cAnsiFunction powf pow hypotl
syn keyword cAnsiFunction hypotf hypot fabsl
syn keyword cAnsiFunction fabsf fabs cbrtl
syn keyword cAnsiFunction cbrtf cbrt scalblnl
syn keyword cAnsiFunction scalblnf scalbln scalbnl
syn keyword cAnsiFunction scalbnf scalbn modfl
syn keyword cAnsiFunction modff modf logbl
syn keyword cAnsiFunction logbf logb log2l
syn keyword cAnsiFunction log2f log2 log1pl
syn keyword cAnsiFunction log1pf log1p log10l
syn keyword cAnsiFunction log10f log10 logl
syn keyword cAnsiFunction logf log ldexpl
syn keyword cAnsiFunction ldexpf ldexp ilogbl
syn keyword cAnsiFunction ilogbf ilogb frexpl
syn keyword cAnsiFunction frexpf frexp expm1l
syn keyword cAnsiFunction expm1f expm1 exp2l
syn keyword cAnsiFunction exp2f exp2 expl
syn keyword cAnsiFunction expf exp tanhl
syn keyword cAnsiFunction tanhf tanh sinhl
syn keyword cAnsiFunction sinhf sinh coshl
syn keyword cAnsiFunction coshf cosh atanhl
syn keyword cAnsiFunction atanhf atanh asinhl
syn keyword cAnsiFunction asinhf asinh acoshl
syn keyword cAnsiFunction acoshf acosh tanl
syn keyword cAnsiFunction tanf tan sinl
syn keyword cAnsiFunction sinf sin cosl
syn keyword cAnsiFunction cosf cos atan2l
syn keyword cAnsiFunction atan2f atan2 atanl
syn keyword cAnsiFunction atanf atan asinl
syn keyword cAnsiFunction asinf asin acosl
syn keyword cAnsiFunction acosf acos signbit
syn keyword cAnsiFunction isnormal isnan isinf
syn keyword cAnsiFunction isfinite fpclassify localeconv
syn keyword cAnsiFunction setlocale wcstoumax wcstoimax
syn keyword cAnsiFunction strtoumax strtoimax feupdateenv
syn keyword cAnsiFunction fesetenv feholdexcept fegetenv
syn keyword cAnsiFunction fesetround fegetround fetestexcept
syn keyword cAnsiFunction fesetexceptflag feraiseexcept fegetexceptflag
syn keyword cAnsiFunction feclearexcept toupper tolower
syn keyword cAnsiFunction isxdigit isupper isspace
syn keyword cAnsiFunction ispunct isprint islower
syn keyword cAnsiFunction isgraph isdigit iscntrl
syn keyword cAnsiFunction isalpha isalnum creall
syn keyword cAnsiFunction crealf creal cprojl
syn keyword cAnsiFunction cprojf cproj conjl
syn keyword cAnsiFunction conjf conj cimagl
syn keyword cAnsiFunction cimagf cimag cargl
syn keyword cAnsiFunction cargf carg csqrtl
syn keyword cAnsiFunction csqrtf csqrt cpowl
syn keyword cAnsiFunction cpowf cpow cabsl
syn keyword cAnsiFunction cabsf cabs clogl
syn keyword cAnsiFunction clogf clog cexpl
syn keyword cAnsiFunction cexpf cexp ctanhl
syn keyword cAnsiFunction ctanhf ctanh csinhl
syn keyword cAnsiFunction csinhf csinh ccoshl
syn keyword cAnsiFunction ccoshf ccosh catanhl
syn keyword cAnsiFunction catanhf catanh casinhl
syn keyword cAnsiFunction casinhf casinh cacoshl
syn keyword cAnsiFunction cacoshf cacosh ctanl
syn keyword cAnsiFunction ctanf ctan csinl
syn keyword cAnsiFunction csinf csin ccosl
syn keyword cAnsiFunction ccosf ccos catanl
syn keyword cAnsiFunction catanf catan casinl
syn keyword cAnsiFunction casinf casin cacosl
syn keyword cAnsiFunction cacosf cacos assert
syn keyword cAnsiFunction UINTMAX_C INTMAX_C UINT64_C
syn keyword cAnsiFunction UINT32_C UINT16_C UINT8_C
syn keyword cAnsiFunction INT64_C INT32_C INT16_C INT8_C
" Common ANSI-standard Names
syn keyword cAnsiName PRId8 PRIi16 PRIo32 PRIu64
syn keyword cAnsiName PRId16 PRIi32 PRIo64 PRIuLEAST8
syn keyword cAnsiName PRId32 PRIi64 PRIoLEAST8 PRIuLEAST16
syn keyword cAnsiName PRId64 PRIiLEAST8 PRIoLEAST16 PRIuLEAST32
syn keyword cAnsiName PRIdLEAST8 PRIiLEAST16 PRIoLEAST32 PRIuLEAST64
syn keyword cAnsiName PRIdLEAST16 PRIiLEAST32 PRIoLEAST64 PRIuFAST8
syn keyword cAnsiName PRIdLEAST32 PRIiLEAST64 PRIoFAST8 PRIuFAST16
syn keyword cAnsiName PRIdLEAST64 PRIiFAST8 PRIoFAST16 PRIuFAST32
syn keyword cAnsiName PRIdFAST8 PRIiFAST16 PRIoFAST32 PRIuFAST64
syn keyword cAnsiName PRIdFAST16 PRIiFAST32 PRIoFAST64 PRIuMAX
syn keyword cAnsiName PRIdFAST32 PRIiFAST64 PRIoMAX PRIuPTR
syn keyword cAnsiName PRIdFAST64 PRIiMAX PRIoPTR PRIx8
syn keyword cAnsiName PRIdMAX PRIiPTR PRIu8 PRIx16
syn keyword cAnsiName PRIdPTR PRIo8 PRIu16 PRIx32
syn keyword cAnsiName PRIi8 PRIo16 PRIu32 PRIx64
syn keyword cAnsiName PRIxLEAST8 SCNd8 SCNiFAST32 SCNuLEAST32
syn keyword cAnsiName PRIxLEAST16 SCNd16 SCNiFAST64 SCNuLEAST64
syn keyword cAnsiName PRIxLEAST32 SCNd32 SCNiMAX SCNuFAST8
syn keyword cAnsiName PRIxLEAST64 SCNd64 SCNiPTR SCNuFAST16
syn keyword cAnsiName PRIxFAST8 SCNdLEAST8 SCNo8 SCNuFAST32
syn keyword cAnsiName PRIxFAST16 SCNdLEAST16 SCNo16 SCNuFAST64
syn keyword cAnsiName PRIxFAST32 SCNdLEAST32 SCNo32 SCNuMAX
syn keyword cAnsiName PRIxFAST64 SCNdLEAST64 SCNo64 SCNuPTR
syn keyword cAnsiName PRIxMAX SCNdFAST8 SCNoLEAST8 SCNx8
syn keyword cAnsiName PRIxPTR SCNdFAST16 SCNoLEAST16 SCNx16
syn keyword cAnsiName PRIX8 SCNdFAST32 SCNoLEAST32 SCNx32
syn keyword cAnsiName PRIX16 SCNdFAST64 SCNoLEAST64 SCNx64
syn keyword cAnsiName PRIX32 SCNdMAX SCNoFAST8 SCNxLEAST8
syn keyword cAnsiName PRIX64 SCNdPTR SCNoFAST16 SCNxLEAST16
syn keyword cAnsiName PRIXLEAST8 SCNi8 SCNoFAST32 SCNxLEAST32
syn keyword cAnsiName PRIXLEAST16 SCNi16 SCNoFAST64 SCNxLEAST64
syn keyword cAnsiName PRIXLEAST32 SCNi32 SCNoMAX SCNxFAST8
syn keyword cAnsiName PRIXLEAST64 SCNi64 SCNoPTR SCNxFAST16
syn keyword cAnsiName PRIXFAST8 SCNiLEAST8 SCNu8 SCNxFAST32
syn keyword cAnsiName PRIXFAST16 SCNiLEAST16 SCNu16 SCNxFAST64
syn keyword cAnsiName PRIXFAST32 SCNiLEAST32 SCNu32 SCNxMAX
syn keyword cAnsiName PRIXFAST64 SCNiLEAST64 SCNu64 SCNxPTR
syn keyword cAnsiName PRIXMAX SCNiFAST8 SCNuLEAST8
syn keyword cAnsiName PRIXPTR SCNiFAST16 SCNuLEAST16
syn keyword cAnsiName errno environ
syn keyword cAnsiName STDC CX_LIMITED_RANGE
syn keyword cAnsiName STDC FENV_ACCESS
syn keyword cAnsiName STDC FP_CONTRACT
syn keyword cAnsiName and bitor not_eq xor
syn keyword cAnsiName and_eq compl or xor_eq
syn keyword cAnsiName bitand not or_eq
hi def link cAnsiFunction cFunction
hi def link cAnsiName cIdentifier
hi def link cFunction Function
hi def link cIdentifier Identifier
" Booleans
syn keyword cBoolean true false TRUE FALSE
hi def link cBoolean Boolean
" -----------------------------------------------------------------------------
" Additional optional highlighting
" -----------------------------------------------------------------------------
" Operators
"syn match cOperator "\(<<\|>>\|[-+*/%&^|<>!=]\)="
"syn match cOperator "<<\|>>\|&&\|||\|++\|--\|->"
"syn match cOperator "[.!~*&%<>^|=,+-]"
"syn match cOperator "/[^/*=]"me=e-1
"syn match cOperator "/$"
"syn match cOperator "&&\|||"
"syn match cOperator "[][]"
"
"" Preprocs
"syn keyword cDefined defined contained containedin=cDefine
"hi def link cDefined cDefine
"" Functions
"syn match cUserFunction "\<\h\w*\>\(\s\|\n\)*("me=e-1 contains=cType,cDelimiter,cDefine
"syn match cUserFunctionPointer "(\s*\*\s*\h\w*\s*)\(\s\|\n\)*(" contains=cDelimiter,cOperator
"
"hi def link cUserFunction cFunction
"hi def link cUserFunctionPointer cFunction
"
"" Delimiters
"syn match cDelimiter "[();\\]"
"" foldmethod=syntax fix, courtesy of Ivan Freitas
"syn match cBraces display "[{}]"
" Links
"hi def link cDelimiter Delimiter
" foldmethod=syntax fix, courtesy of Ivan Freitas
"hi def link cBraces Delimiter
" 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

@@ -2,16 +2,18 @@
" Language: C++ Additions " Language: C++ Additions
" Maintainer: Jon Haggblad <jon@haeggblad.com> " Maintainer: Jon Haggblad <jon@haeggblad.com>
" URL: http://www.haeggblad.com " URL: http://www.haeggblad.com
" Last Change: 21 Apr 2014 " Last Change: 21 Sep 2014
" Version: 0.3 " Version: 0.5
" Changelog: " Changelog:
" 0.1 - initial version. " 0.1 - initial version.
" 0.2 - C++14 " 0.2 - C++14
" 0.3 - Incorporate lastest changes from Mizuchi/STL-Syntax " 0.3 - Incorporate lastest changes from Mizuchi/STL-Syntax
" 0.4 - Add template function highlight
" 0.5 - Redo template function highlight to be more robust. Add options.
" "
" Additional Vim syntax highlighting for C++ (including C++11) " Additional Vim syntax highlighting for C++ (including C++11/14)
" "
" This file contains additional syntax highlighting that I use for my C++11/14 " This file contains additional syntax highlighting that I use for C++11/14
" development in Vim. Compared to the standard syntax highlighting for C++ it " development in Vim. Compared to the standard syntax highlighting for C++ it
" adds highlighting of (user defined) functions and the containers and types " adds highlighting of (user defined) functions and the containers and types
" in the standard library / boost. " in the standard library / boost.
@@ -29,21 +31,35 @@
" Based on the discussion in: " Based on the discussion in:
" http://stackoverflow.com/questions/736701/class-function-names-highlighting-in-vim " http://stackoverflow.com/questions/736701/class-function-names-highlighting-in-vim
" ----------------------------------------------------------------------------- " -----------------------------------------------------------------------------
syn match cCustomParen "(" contains=cParen contains=cCppParen
syn match cCustomFunc "\w\+\s*(\@=" contains=cCustomParen
syn match cCustomScope "::"
syn match cCustomClass "\w\+\s*::" contains=cCustomScope
" Functions
syn match cCustomParen "(" contains=cParen contains=cCppParen
syn match cCustomFunc "\w\+\s*(\@=" contains=cCustomParen
hi def link cCustomFunc Function hi def link cCustomFunc Function
" Uncomment this to also highlight 'class::' and 'namespace::' " Template functions
"hi def link cCustomClass Function if exists('g:cpp_experimental_template_highlight') && g:cpp_experimental_template_highlight
syn region cCustomAngleBrackets matchgroup=AngleBracketContents start="\v%(<operator\_s*)@<!%(%(\_i|template\_s*)@<=\<[<=]@!|\<@<!\<[[:space:]<=]@!)" end='>' contains=@cppSTLgroup,cppStructure,cType,cCustomClass,cCustomAngleBrackets,cNumbers
syn match cCustomBrack "<\|>" contains=cCustomAngleBrackets
syn match cCustomTemplateFunc "\w\+\s*<.*>(\@=" contains=cCustomBrack,cCustomAngleBrackets
hi def link cCustomTemplateFunc Function
endif
" Class and namespace scope
if exists('g:cpp_class_scope_highlight') && g:cpp_class_scope_highlight
syn match cCustomScope "::"
syn match cCustomClass "\w\+\s*::" contains=cCustomScope
hi def link cCustomClass Function " disabled for now
endif
" Alternative syntax that is used in: " Alternative syntax that is used in:
" http://www.vim.org/scripts/script.php?script_id=3064 " http://www.vim.org/scripts/script.php?script_id=3064
"syn match cUserFunction "\<\h\w*\>\(\s\|\n\)*("me=e-1 contains=cType,cDelimiter,cDefine "syn match cUserFunction "\<\h\w*\>\(\s\|\n\)*("me=e-1 contains=cType,cDelimiter,cDefine
"hi def link cCustomFunc Function "hi def link cCustomFunc Function
" Cluster for all the stdlib functions defined below
syn cluster cppSTLgroup contains=cppSTLfunction,cppSTLfunctional,cppSTLconstant,cppSTLnamespace,cppSTLtype,cppSTLexception,cppSTLiterator,cppSTLiterator_tagcppSTLenumcppSTLioscppSTLcast
" ----------------------------------------------------------------------------- " -----------------------------------------------------------------------------
" Standard library types and functions. " Standard library types and functions.
" "
@@ -1294,6 +1310,10 @@ if !exists("cpp_no_cpp11")
syntax keyword cppSTLtype minutes syntax keyword cppSTLtype minutes
syntax keyword cppSTLtype hours syntax keyword cppSTLtype hours
"raw string literals
syntax region cppRawString matchgroup=cppRawDelimiter start=@\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(@ end=/)\z1"/ contains=@Spell
syn match cNumber "0b[01]\+"
endif " C++11 endif " C++11
if !exists("cpp_no_cpp14") if !exists("cpp_no_cpp14")
@@ -1338,5 +1358,7 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
HiLink cppSTLenum Typedef HiLink cppSTLenum Typedef
HiLink cppSTLios Function HiLink cppSTLios Function
HiLink cppSTLcast Statement " be consistent with official syntax HiLink cppSTLcast Statement " be consistent with official syntax
HiLink cppRawString String
HiLink cppRawDelimiter Delimiter
delcommand HiLink delcommand HiLink
endif endif

View File

@@ -1,5 +1,5 @@
" Language: CoffeeScript " Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com> " Maintainer: Mick Koch <mick@kochm.co>
" URL: http://github.com/kchmck/vim-coffee-script " URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL " License: WTFPL
@@ -18,8 +18,10 @@ if !g:less_html_style_tags
endif endif
" Unset (but preserve) so that less will run. " Unset (but preserve) so that less will run.
let s:pre_less_cur_syn = b:current_syntax if exists("b:current_syntax")
unlet b:current_syntax let s:pre_less_cur_syn = b:current_syntax
unlet b:current_syntax
endif
" Inspired by code from github.com/kchmck/vim-coffee-script " Inspired by code from github.com/kchmck/vim-coffee-script
" and the html syntax file included with vim 7.4. " and the html syntax file included with vim 7.4.
@@ -30,7 +32,9 @@ syn include @htmlLess syntax/less.vim
syn region lessStyle start=+<style [^>]*type *=[^>]*text/less[^>]*>+ keepend end=+</style>+ contains=@htmlLess,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc containedin=htmlHead 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. " Reset since 'less' isn't really the current_syntax.
let b:current_syntax = s:pre_less_cur_syn if exists("s:pre_less_cur_syn")
let b:current_syntax = s:pre_less_cur_syn
endif
" 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,11 @@
if !( has('gui_running') || &t_Co==256 ) | finish | endif if !( has('gui_running') || &t_Co==256 ) | finish | endif
call css_color#init('css', 'lessVariableValue,lessDefinition,lessComment') " variable | property | multiline | end-of-line | plugin
" -----------------------+----------------+----------------+-------------+---------
" lessCssAttribute | lessCssComment | lessComment | https://github.com/genoma/vim-less
" lessAttribute | lessCssComment | lessComment | https://github.com/KohPoll/vim-less
" lessVariableValue | lessDefinition | cssComment | lessComment | https://github.com/groenewege/vim-less
" lessVariableDefinition | cssDefinition | cssComment | lessComment | https://github.com/lunaru/vim-less
call css_color#init('css', 'lessVariableValue,lessVariableDefinition,lessDefinition,lessCssAttribute,lessAttribute,cssDefinition,cssComment,lessCssComment,lessComment')

6
after/syntax/scss.vim Normal file
View File

@@ -0,0 +1,6 @@
" Language: Colorful CSS Color Preview
" Author: Aristotle Pagaltzis <pagaltzis@gmx.de>
if !( has('gui_running') || &t_Co==256 ) | finish | endif
call css_color#init('css', 'scssAttribute,scssComment,scssVariableValue,sassCssAttribute,cssComment')

View File

@@ -1,5 +1,5 @@
" Language: CoffeeScript " Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com> " Maintainer: Mick Koch <mick@kochm.co>
" URL: http://github.com/kchmck/vim-coffee-script " URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL " License: WTFPL

View File

@@ -1,8 +1,7 @@
" Language: Colorful CSS Color Preview " Language: Colorful CSS Color Preview
" Author: Aristotle Pagaltzis <pagaltzis@gmx.de> " Author: Aristotle Pagaltzis <pagaltzis@gmx.de>
" Last Change: 2014-01-14 " Commit: $Format:%H$
" Licence: No Warranties. WTFPL. But please tell me! " Licence: The MIT License (MIT)
" Version: 1.0
if v:version < 700 if v:version < 700
echoerr printf('Vim 7 is required for css-color (this is only %d.%d)',v:version/100,v:version%100) echoerr printf('Vim 7 is required for css-color (this is only %d.%d)',v:version/100,v:version%100)
@@ -206,28 +205,34 @@ function! s:create_syn_match()
return '' return ''
endfunction endfunction
function! s:update_matches() function! s:clear_matches()
call filter(b:color_match_id, 'matchdelete(v:val)') if exists('w:color_match_id')
if &l:cursorline call filter(w:color_match_id, 'matchdelete(v:val)')
" adds matches based that duplicate the highlighted colors on the current line unlet w:color_match_id
let lnr = line('.')
let group = ''
let groupstart = 0
let endcol = col('$')
for col in range( 1, endcol )
let nextgroup = col < endcol ? synIDattr( synID( lnr, col, 1 ), 'name' ) : ''
if group == nextgroup | continue | endif
if group =~ '^BG\x\{6}$'
let regex = '\%'.lnr.'l\%'.groupstart.'c'.repeat( '.', col - groupstart )
let match = matchadd( group, regex, -1 )
let b:color_match_id += [ match ]
endif
let group = nextgroup
let groupstart = col
endfor
endif endif
endfunction endfunction
function! s:create_matches()
if ! &l:cursorline | return | endif
" adds matches based that duplicate the highlighted colors on the current line
let lnr = line('.')
let group = ''
let groupstart = 0
let endcol = col('$')
let w:color_match_id = []
for col in range( 1, endcol )
let nextgroup = col < endcol ? synIDattr( synID( lnr, col, 1 ), 'name' ) : ''
if group == nextgroup | continue | endif
if group =~ '^BG\x\{6}$'
let regex = '\%'.lnr.'l\%'.groupstart.'c'.repeat( '.', col - groupstart )
let match = matchadd( group, regex, -1 )
let w:color_match_id += [ match ]
endif
let group = nextgroup
let groupstart = col
endfor
endfunction
let s:_hexcolor = '#\(\x\{3}\|\x\{6}\)\>' " submatch 1 let s:_hexcolor = '#\(\x\{3}\|\x\{6}\)\>' " submatch 1
let s:_funcname = '\(rgb\|hsl\)a\?' " submatch 2 let s:_funcname = '\(rgb\|hsl\)a\?' " submatch 2
let s:_numval = '\(\d\{1,3}%\?\)' " submatch 3,4,5 let s:_numval = '\(\d\{1,3}%\?\)' " submatch 3,4,5
@@ -242,11 +247,13 @@ let s:_csscolor = s:_hexcolor . '\|' . s:_funcexpr
" scan without examining the start of the string over and over " scan without examining the start of the string over and over
function! s:parse_css_screen() function! s:parse_css_screen()
call substitute( join( getline('w0','w$'), "\n" ), s:_csscolor, '\=s:create_syn_match()', 'g' ) call substitute( join( getline('w0','w$'), "\n" ), s:_csscolor, '\=s:create_syn_match()', 'g' )
call s:update_matches() call s:clear_matches()
call s:create_matches()
endfunction endfunction
function! s:parse_any_screen() function! s:parse_any_screen()
call substitute( join( getline('w0','w$'), "\n" ), s:_hexcolor, '\=s:create_syn_match()', 'g' ) call substitute( join( getline('w0','w$'), "\n" ), s:_hexcolor, '\=s:create_syn_match()', 'g' )
call s:update_matches() call s:clear_matches()
call s:create_matches()
endfunction endfunction
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -256,14 +263,15 @@ function! css_color#init(type, groups)
let b:has_color_hi = {} let b:has_color_hi = {}
let b:has_pattern_syn = {} let b:has_pattern_syn = {}
let b:color_match_id = []
augroup CSSColor augroup CSSColor
autocmd! * <buffer> autocmd! * <buffer>
exe 'autocmd CursorMoved,CursorMovedI <buffer> call s:parse_'.a:type.'_screen()' exe 'autocmd CursorMoved,CursorMovedI <buffer> call s:parse_'.a:type.'_screen()'
autocmd BufWinEnter <buffer> call s:create_matches()
autocmd BufWinLeave <buffer> call s:clear_matches()
augroup END augroup END
do CSSColor CursorMoved <buffer> exe 'call s:parse_'.a:type.'_screen()'
if a:type != 'css' | return | endif if a:type != 'css' | return | endif

View File

@@ -178,14 +178,14 @@ function! s:WithPath(func, ...)
call mkdir(tmpdir) call mkdir(tmpdir)
let save_cwd = getcwd() let save_cwd = getcwd()
silent exe 'lcd' tmpdir silent exe 'lcd' fnameescape(tmpdir)
let path = 'unnamed.rs' let path = 'unnamed.rs'
let save_mod = &mod let save_mod = &mod
set nomod set nomod
silent exe 'keepalt write! ' . path silent exe 'keepalt write! ' . fnameescape(path)
if pathisempty if pathisempty
silent keepalt 0file silent keepalt 0file
endif endif
@@ -195,10 +195,10 @@ function! s:WithPath(func, ...)
call call(a:func, [path] + a:000) call call(a:func, [path] + a:000)
finally finally
if exists("save_mod") | let &mod = save_mod | endif if exists("save_mod") | let &mod = save_mod | endif
if exists("save_write") | let &write = save_write | endif if exists("save_write") | let &write = save_write | endif
if exists("save_cwd") | silent exe 'lcd' save_cwd | endif if exists("save_cwd") | silent exe 'lcd' fnameescape(save_cwd) | endif
if exists("tmpdir") | silent call s:RmDir(tmpdir) | endif if exists("tmpdir") | silent call s:RmDir(tmpdir) | endif
endtry endtry
endfunction endfunction

View File

@@ -324,7 +324,7 @@ endif
" Ref: http://dev.w3.org/html5/markup/ " Ref: http://dev.w3.org/html5/markup/
" Version: Draft 05 April 2011 " Version: Draft 05 April 2011
let phrasing_elements = ['a', 'em', 'strong', 'small', 'mark', 'abbr', 'dfn', 'i', 'b', 'u', 'code', 'var', 'samp', 'kbd', 'sup', 'sub', 'q', 'cite', 'span', 'bdo', 'bdi', 'br', 'wbr', 'ins', 'del', 'img', 'embed', 'object', 'iframe', 'map', 'area', 'script', 'noscript', 'ruby', 'video', 'audio', 'input', 'textarea', 'select', 'button', 'label', 'output', 'datalist', 'keygen', 'progress', 'command', 'canvas', 'time', 'meter', 'data', 'content', 'shadow'] let phrasing_elements = ['a', 'em', 'strong', 'small', 'mark', 'abbr', 'dfn', 'i', 'b', 'u', 'code', 'var', 'samp', 'kbd', 'sup', 'sub', 'q', 'cite', 'span', 'bdo', 'bdi', 'br', 'wbr', 'ins', 'del', 'img', 'picture', 'embed', 'object', 'iframe', 'map', 'area', 'script', 'noscript', 'ruby', 'video', 'audio', 'input', 'textarea', 'select', 'button', 'label', 'output', 'datalist', 'keygen', 'progress', 'command', 'canvas', 'time', 'meter', 'data', 'content', 'shadow']
let metadata_elements = ['link', 'style', 'meta', 'script', 'noscript', 'command'] let metadata_elements = ['link', 'style', 'meta', 'script', 'noscript', 'command']
@@ -643,6 +643,10 @@ let g:xmldata_html5 = {
\ [], \ [],
\ extend(copy(global_attributes), {'name': [], 'value': []}) \ extend(copy(global_attributes), {'name': [], 'value': []})
\ ], \ ],
\ 'picture': [
\ flow_elements + ['source'],
\ global_attributes
\ ],
\ 'pre': [ \ 'pre': [
\ phrasing_elements, \ phrasing_elements,
\ global_attributes \ global_attributes
@@ -693,7 +697,7 @@ let g:xmldata_html5 = {
\ ], \ ],
\ 'source': [ \ 'source': [
\ [], \ [],
\ extend(copy(global_attributes), {'src': [], 'type': [], 'media': []}) \ extend(copy(global_attributes), {'src': [], 'type': [], 'media': [], 'srcset': [], 'sizes': []})
\ ], \ ],
\ 'span': [ \ 'span': [
\ phrasing_elements, \ phrasing_elements,

View File

@@ -1,5 +1,5 @@
" Language: CoffeeScript " Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com> " Maintainer: Mick Koch <mick@kochm.co>
" URL: http://github.com/kchmck/vim-coffee-script " URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL " License: WTFPL

65
compiler/cargo.vim Normal file
View File

@@ -0,0 +1,65 @@
" Vim compiler file
" Compiler: Cargo Compiler
" Maintainer: Damien Radtke <damienradtke@gmail.com>
" Latest Revision: 2014 Sep 24
if exists('current_compiler')
finish
endif
runtime compiler/rustc.vim
let current_compiler = "cargo"
if exists(':CompilerSet') != 2
command -nargs=* CompilerSet setlocal <args>
endif
if exists('g:cargo_makeprg_params')
execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*'
else
CompilerSet makeprg=cargo\ $*
endif
" Allow a configurable global Cargo.toml name. This makes it easy to
" support variations like 'cargo.toml'.
let s:cargo_manifest_name = get(g:, 'cargo_manifest_name', 'Cargo.toml')
function! s:is_absolute(path)
return a:path[0] == '/' || a:path =~ '[A-Z]\+:'
endfunction
let s:local_manifest = findfile(s:cargo_manifest_name, '.;')
if s:local_manifest != ''
let s:local_manifest = fnamemodify(s:local_manifest, ':p:h').'/'
augroup cargo
au!
au QuickfixCmdPost make call s:FixPaths()
augroup END
" FixPaths() is run after Cargo, and is used to change the file paths
" to be relative to the current directory instead of Cargo.toml.
function! s:FixPaths()
let qflist = getqflist()
let manifest = s:local_manifest
for qf in qflist
if !qf.valid
let m = matchlist(qf.text, '(file://\(.*\))$')
if !empty(m)
let manifest = m[1].'/'
" Manually strip another slash if needed; usually just an
" issue on Windows.
if manifest =~ '^/[A-Z]\+:/'
let manifest = manifest[1:]
endif
endif
continue
endif
let filename = bufname(qf.bufnr)
if s:is_absolute(filename)
continue
endif
let qf.filename = simplify(manifest.filename)
call remove(qf, 'bufnr')
endfor
call setqflist(qflist, 'r')
endfunction
endif

View File

@@ -1,5 +1,5 @@
" Language: CoffeeScript " Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com> " Maintainer: Mick Koch <mick@kochm.co>
" URL: http://github.com/kchmck/vim-coffee-script " URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL " License: WTFPL

View File

@@ -19,7 +19,7 @@ CompilerSet makeprg=cucumber
CompilerSet errorformat= CompilerSet errorformat=
\%W%m\ (Cucumber::Undefined), \%W%m\ (Cucumber::Undefined),
\%E%m\ (%.%#), \%E%m\ (%\\S%#),
\%Z%f:%l, \%Z%f:%l,
\%Z%f:%l:%.%# \%Z%f:%l:%.%#

View File

@@ -3,6 +3,11 @@ if exists("current_compiler")
endif endif
let current_compiler = "typescript" let current_compiler = "typescript"
CompilerSet makeprg=tsc\ $*\ % if !exists("g:typescript_compiler_options")
let g:typescript_compiler_options = ""
endif
let &l:makeprg='tsc' . g:typescript_compiler_options . ' $* %'
CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m

View File

@@ -1,5 +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 au BufNewFile,BufRead *.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
@@ -18,6 +18,12 @@ au BufRead,BufNewFile *.eex set filetype=eelixir
au FileType eelixir setl sw=2 sts=2 et iskeyword+=!,? 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+=!,?
function! s:DetectElixir()
if getline(1) =~ '^#!.*\<elixir\>'
set filetype=elixir
endif
endfunction
autocmd BufNewFile,BufRead * call s:DetectElixir()
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 BufNewFile,BufRead *.emblem set filetype=emblem
@@ -104,7 +110,8 @@ autocmd BufRead *.html
\ set filetype=mason | \ set filetype=mason |
\ endif \ endif
if has("autocmd") if has("autocmd")
au BufNewFile,BufRead *.mustache,*.handlebars,*.hbs,*.hogan,*.hulk,*.hjs set filetype=html syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim au BufNewFile,BufRead *.mustache,*.hogan,*.hulk,*.hjs set filetype=html.mustache syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim
au BufNewFile,BufRead *.handlebars,*.hbs set filetype=html.handlebars syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim
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

View File

@@ -1,5 +1,5 @@
" Language: CoffeeScript " Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com> " Maintainer: Mick Koch <mick@kochm.co>
" URL: http://github.com/kchmck/vim-coffee-script " URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL " License: WTFPL
@@ -13,6 +13,7 @@ call coffee#CoffeeSetUpVariables()
setlocal formatoptions-=t formatoptions+=croql setlocal formatoptions-=t formatoptions+=croql
setlocal comments=:# commentstring=#\ %s setlocal comments=:# commentstring=#\ %s
setlocal omnifunc=javascriptcomplete#CompleteJS setlocal omnifunc=javascriptcomplete#CompleteJS
setlocal suffixesadd+=coffee
" Create custom augroups. " Create custom augroups.
augroup CoffeeBufUpdate | augroup END augroup CoffeeBufUpdate | augroup END
@@ -330,7 +331,7 @@ function! s:CoffeeLint(startline, endline, bang, args)
endif endif
let output = system(g:coffee_linter . let output = system(g:coffee_linter .
\ ' -s --csv' . \ ' -s --reporter csv' .
\ ' ' . b:coffee_litcoffee . \ ' ' . b:coffee_litcoffee .
\ ' ' . g:coffee_lint_options . \ ' ' . g:coffee_lint_options .
\ ' ' . a:args . \ ' ' . a:args .
@@ -394,11 +395,11 @@ if !exists('b:coffee_run_buf')
call s:CoffeeRunResetVars() call s:CoffeeRunResetVars()
endif endif
command! -range=% -bar -nargs=* -complete=customlist,s:CoffeeComplete command! -buffer -range=% -bar -nargs=* -complete=customlist,s:CoffeeComplete
\ CoffeeCompile call s:CoffeeCompile(<line1>, <line2>, <q-args>) \ CoffeeCompile call s:CoffeeCompile(<line1>, <line2>, <q-args>)
command! -bar -nargs=* -complete=customlist,s:CoffeeComplete command! -buffer -bar -nargs=* -complete=customlist,s:CoffeeComplete
\ CoffeeWatch call s:CoffeeWatch(<q-args>) \ CoffeeWatch call s:CoffeeWatch(<q-args>)
command! -range=% -bar -nargs=* CoffeeRun command! -buffer -range=% -bar -nargs=* CoffeeRun
\ call s:CoffeeRun(<line1>, <line2>, <q-args>) \ call s:CoffeeRun(<line1>, <line2>, <q-args>)
command! -range=% -bang -bar -nargs=* CoffeeLint command! -buffer -range=% -bang -bar -nargs=* CoffeeLint
\ call s:CoffeeLint(<line1>, <line2>, <q-bang>, <q-args>) \ call s:CoffeeLint(<line1>, <line2>, <q-bang>, <q-args>)

View File

@@ -11,6 +11,20 @@
" though, implementation differs. " though, implementation differs.
" Plugin folklore "{{{2 " Plugin folklore "{{{2
fu! <sid>DetermineSID()
let s:SID = matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_DetermineSID$')
endfu
call s:DetermineSID()
delf s:DetermineSID
fu! CSVArrangeCol(first, last, bang, limit) range "{{{2
if &ft =~? 'csv'
call <sid>ArrangeCol(a:first, a:last, a:bang, a:limit)
else
finish
endif
endfu
if v:version < 700 || exists('b:did_ftplugin') if v:version < 700 || exists('b:did_ftplugin')
finish finish
endif endif
@@ -20,7 +34,6 @@ let s:cpo_save = &cpo
set cpo&vim set cpo&vim
" Function definitions: "{{{2 " Function definitions: "{{{2
"
" Script specific functions "{{{2 " Script specific functions "{{{2
fu! <sid>Warn(mess) "{{{3 fu! <sid>Warn(mess) "{{{3
echohl WarningMsg echohl WarningMsg
@@ -239,35 +252,6 @@ fu! <sid>DoAutoCommands() "{{{3
let b:undo_ftplugin .= '| exe "sil! au! CSV_HI CursorMoved <buffer> "' let b:undo_ftplugin .= '| exe "sil! au! CSV_HI CursorMoved <buffer> "'
let b:undo_ftplugin .= '| exe "sil! aug! CSV_HI" |exe "sil! HiColumn!"' let b:undo_ftplugin .= '| exe "sil! aug! CSV_HI" |exe "sil! HiColumn!"'
" Visually arrange columns when opening a csv file
if exists("g:csv_autocmd_arrange") &&
\ !exists("#CSV_Edit#BufReadPost")
aug CSV_Edit
au!
au BufReadPost,BufWritePost *.csv,*.dat :sil %ArrangeColumn
au BufWritePre *.csv,*.dat :sil %UnArrangeColumn
aug end
elseif exists("#CSV_Edit#BufReadPost")
aug CSV_Edit
au!
aug end
aug! CSV_Edit
endif
" undo autocommand:
let b:undo_ftplugin .= '| exe "sil! au! CSV_Edit "'
let b:undo_ftplugin .= '| exe "sil! aug! CSV_Edit"'
" if !exists("#CSV_ColorScheme#ColorScheme")
" " Make sure, syntax highlighting is applied
" " after changing the colorscheme
" augroup CSV_ColorScheme
" au!
" au ColorScheme *.csv,*.dat,*.tsv,*.tab do Syntax
" augroup end
" endif
" let b:undo_ftplugin .= '| exe "sil! au! CSV_ColorScheme "'
" let b:undo_ftplugin .= '| exe "sil! aug! CSV_ColorScheme"'
if has("gui_running") && !exists("#CSV_Menu#FileType") if has("gui_running") && !exists("#CSV_Menu#FileType")
augroup CSV_Menu augroup CSV_Menu
au! au!
@@ -276,10 +260,6 @@ fu! <sid>DoAutoCommands() "{{{3
au BufLeave <buffer> call <sid>Menu(0) " disable au BufLeave <buffer> call <sid>Menu(0) " disable
au BufNewFile,BufNew * call <sid>Menu(0) au BufNewFile,BufNew * call <sid>Menu(0)
augroup END augroup END
"let b:undo_ftplugin .= '| sil! amenu disable CSV'
"
" b:undo_ftplugin does not support calling <sid> Functions
"let b:undo_ftplugin .= '| sil! call <sid>Menu(0)'
endif endif
endfu endfu
@@ -348,11 +328,6 @@ fu! <sid>SearchColumn(arg) "{{{3
throw "E684" throw "E684"
endif endif
endif endif
" let colnr=arglist[0]
" let pat=substitute(arglist[1], '^\(.\)\(.*\)\1$', '\2', '')
" if pat == arglist[1]
" throw "E684"
" endif
endif endif
"catch /^Vim\%((\a\+)\)\=:E684/ "catch /^Vim\%((\a\+)\)\=:E684/
catch /E684/ " catch error index out of bounds catch /E684/ " catch error index out of bounds
@@ -364,7 +339,7 @@ fu! <sid>SearchColumn(arg) "{{{3
call <SID>Warn("There exists no column " . colnr) call <SID>Warn("There exists no column " . colnr)
return 1 return 1
endif endif
let @/ = <sid>GetPat(colnr, maxcolnr, pat) let @/ = <sid>GetPat(colnr, maxcolnr, '\%('.pat. '\)')
try try
norm! n norm! n
catch /^Vim\%((\a\+)\)\=:E486/ catch /^Vim\%((\a\+)\)\=:E486/
@@ -517,7 +492,13 @@ fu! <sid>WColumn(...) "{{{3
" Return on which column the cursor is " Return on which column the cursor is
let _cur = getpos('.') let _cur = getpos('.')
if !exists("b:csv_fixed_width_cols") if !exists("b:csv_fixed_width_cols")
let line=getline('.') if line('.') > 1 && mode('') != 'n'
" in insert mode, get line from above, just in case the current
" line is empty
let line = getline(line('.')-1)
else
let line=getline('.')
endif
" move cursor to end of field " move cursor to end of field
"call search(b:col, 'ec', line('.')) "call search(b:col, 'ec', line('.'))
call search(b:col, 'ec') call search(b:col, 'ec')
@@ -637,7 +618,7 @@ fu! <sid>ColWidth(colnr) "{{{3
endif endif
endfu endfu
fu! <sid>ArrangeCol(first, last, bang) range "{{{3 fu! <sid>ArrangeCol(first, last, bang, limit) range "{{{3
"TODO: Why doesn't that work? "TODO: Why doesn't that work?
" is this because of the range flag? " is this because of the range flag?
" It's because of the way, Vim works with " It's because of the way, Vim works with
@@ -649,11 +630,16 @@ fu! <sid>ArrangeCol(first, last, bang) range "{{{3
return return
endif endif
let cur=winsaveview() let cur=winsaveview()
if a:bang || !exists("b:col_width") if a:bang
if a:bang if a:bang
" Force recalculating the Column width " Force recalculating the Column width
unlet! b:csv_list unlet! b:csv_list b:col_width
endif endif
elseif a:limit > -1 && a:limit < getfsize(fnamemodify(bufname(''), ':p'))
return
endif
if !exists("b:col_width")
" Force recalculation of Column width " Force recalculation of Column width
call <sid>CalculateColumnWidth() call <sid>CalculateColumnWidth()
endif endif
@@ -889,7 +875,7 @@ fu! <sid>SplitHeaderLine(lines, bang, hor) "{{{3
syn clear syn clear
noa 0 noa 0
let b:csv_SplitWindow = winnr() let b:csv_SplitWindow = winnr()
sil :call <sid>ArrangeCol(1,line('$'), 1) sil :call <sid>ArrangeCol(1,line('$'), 1, -1)
exe "vert res" . len(split(getline(1), '\zs')) exe "vert res" . len(split(getline(1), '\zs'))
call matchadd("CSVHeaderLine", b:col) call matchadd("CSVHeaderLine", b:col)
setl scrollopt=ver winfixwidth setl scrollopt=ver winfixwidth
@@ -1586,12 +1572,6 @@ fu! <sid>DisableFolding() "{{{3
endif endif
endfu endfu
fu! <sid>DetermineSID()
let s:SID = matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_DetermineSID$')
endfu
call s:DetermineSID()
delf s:DetermineSID
fu! <sid>NumberFormat() "{{{3 fu! <sid>NumberFormat() "{{{3
let s:nr_format = [',', '.'] let s:nr_format = [',', '.']
if exists("b:csv_thousands_sep") if exists("b:csv_thousands_sep")
@@ -1886,7 +1866,7 @@ fu! <sid>CommandDefinitions() "{{{3
call <sid>LocalCmd("DeleteColumn", ':call <sid>DeleteColumn(<q-args>)', call <sid>LocalCmd("DeleteColumn", ':call <sid>DeleteColumn(<q-args>)',
\ '-nargs=? -complete=custom,<sid>SortComplete') \ '-nargs=? -complete=custom,<sid>SortComplete')
call <sid>LocalCmd("ArrangeColumn", call <sid>LocalCmd("ArrangeColumn",
\ ':call <sid>ArrangeCol(<line1>, <line2>, <bang>0)', \ ':call <sid>ArrangeCol(<line1>, <line2>, <bang>0, -1)',
\ '-range -bang') \ '-range -bang')
call <sid>LocalCmd("UnArrangeColumn", call <sid>LocalCmd("UnArrangeColumn",
\':call <sid>PrepUnArrangeCol(<line1>, <line2>)', \':call <sid>PrepUnArrangeCol(<line1>, <line2>)',
@@ -2242,7 +2222,7 @@ fu! <sid>Tabularize(bang, first, last) "{{{3
else else
" don't clear column width variable, might have been set in the " don't clear column width variable, might have been set in the
" plugin! " plugin!
sil call <sid>ArrangeCol(a:first, a:last, 0) sil call <sid>ArrangeCol(a:first, a:last, 0, -1)
endif endif
if empty(b:col_width) if empty(b:col_width)
@@ -2398,6 +2378,9 @@ fu! csv#EvalColumn(nr, func, first, last) range "{{{3
call <sid>CheckHeaderLine() call <sid>CheckHeaderLine()
let nr = matchstr(a:nr, '^\-\?\d\+') let nr = matchstr(a:nr, '^\-\?\d\+')
let col = (empty(nr) ? <sid>WColumn() : nr) let col = (empty(nr) ? <sid>WColumn() : nr)
if col == 0
let col = 1
endif
" don't take the header line into consideration " don't take the header line into consideration
let start = a:first - 1 + s:csv_fold_headerline let start = a:first - 1 + s:csv_fold_headerline
let stop = a:last - 1 + s:csv_fold_headerline let stop = a:last - 1 + s:csv_fold_headerline
@@ -2517,7 +2500,17 @@ fu! CSV_CloseBuffer(buffer) "{{{3
endtry endtry
endfu endfu
fu! CSVSum(col, fmt, first, last) "{{{3
let first = a:first
let last = a:last
if empty(first)
let first = 1
endif
if empty(last)
let last = line('$')
endif
return csv#EvalColumn(a:col, '<sid>SumColumn', first, last)
endfu
" Initialize Plugin "{{{2 " Initialize Plugin "{{{2
let b:csv_start = exists("b:csv_start") ? b:csv_start : 1 let b:csv_start = exists("b:csv_start") ? b:csv_start : 1
let b:csv_end = exists("b:csv_end") ? b:csv_end : line('$') let b:csv_end = exists("b:csv_end") ? b:csv_end : line('$')

View File

@@ -39,6 +39,9 @@ function s:SetErlangOptions()
setlocal omnifunc=erlangcomplete#Complete setlocal omnifunc=erlangcomplete#Complete
endif endif
setlocal comments=:%%%,:%%,:%
setlocal commentstring=%%s
setlocal foldmethod=expr setlocal foldmethod=expr
setlocal foldexpr=GetErlangFold(v:lnum) setlocal foldexpr=GetErlangFold(v:lnum)
setlocal foldtext=ErlangFoldText() setlocal foldtext=ErlangFoldText()

View File

@@ -27,7 +27,7 @@ elseif !exists("b:eruby_subtype")
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
if b:eruby_subtype == '' if b:eruby_subtype == ''
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+$') let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+\%(\ze+\w\+\)\=$')
endif endif
if b:eruby_subtype == 'rhtml' if b:eruby_subtype == 'rhtml'
let b:eruby_subtype = 'html' let b:eruby_subtype = 'html'

View File

@@ -4,4 +4,4 @@
" License: MIT " License: MIT
" Changes: Add - to keyword " Changes: Add - to keyword
setlocal iskeyword+=- " setlocal iskeyword+=-

View File

@@ -367,6 +367,7 @@ function! s:ExtractLabels()
" Ignore cref entries (because they are duplicates) " Ignore cref entries (because they are duplicates)
if curname =~# "@cref$" if curname =~# "@cref$"
let [lblline, lblbegin] = searchpos( '\\newlabel{', 'ecW' )
continue continue
endif endif

View File

@@ -156,7 +156,7 @@ let s:notcomment = '\%(\%(\\\@<!\%(\\\\\)*\)\@<=%.*\)\@<!'
let s:envbeginpattern = s:notcomment . s:notbslash . '\\begin\s*{.\{-}}' let s:envbeginpattern = s:notcomment . s:notbslash . '\\begin\s*{.\{-}}'
let s:envendpattern = s:notcomment . s:notbslash . '\\end\s*{.\{-}}' let s:envendpattern = s:notcomment . s:notbslash . '\\end\s*{.\{-}}'
let s:foldparts = '^\s*\\\%(' . join(g:LatexBox_fold_parts, '\|') . '\)' let s:foldparts = '^\s*\\\%(' . join(g:LatexBox_fold_parts, '\|') . '\)'
let s:folded = '\(% Fake\|\\\(document\|begin\|end\|' let s:folded = '\(% Fake\|\\\(document\|begin\|end\|paragraph\|'
\ . 'front\|main\|back\|app\|sub\|section\|chapter\|part\)\)' \ . 'front\|main\|back\|app\|sub\|section\|chapter\|part\)\)'
function! LatexBox_FoldLevel(lnum) function! LatexBox_FoldLevel(lnum)
@@ -193,26 +193,31 @@ function! LatexBox_FoldLevel(lnum)
endif endif
" Fold environments " Fold environments
if line =~# s:envbeginpattern if line =~# s:envbeginpattern && line =~# s:envendpattern
if g:LatexBox_fold_envs == 1 " If the begin and end pattern are on the same line , do not fold
return "a1" return "="
else else
let env = matchstr(line,'\\begin\*\?{\zs\w*\*\?\ze}') if line =~# s:envbeginpattern
if index(g:LatexBox_fold_envs_force, env) >= 0 if g:LatexBox_fold_envs == 1
return "a1" return "a1"
else else
return "=" let env = matchstr(line,'\\begin\*\?{\zs\w*\*\?\ze}')
if index(g:LatexBox_fold_envs_force, env) >= 0
return "a1"
else
return "="
endif
endif endif
endif elseif line =~# s:envendpattern
elseif line =~# s:envendpattern if g:LatexBox_fold_envs == 1
if g:LatexBox_fold_envs == 1
return "s1"
else
let env = matchstr(line,'\\end\*\?{\zs\w*\*\?\ze}')
if index(g:LatexBox_fold_envs_force, env) >= 0
return "s1" return "s1"
else else
return "=" let env = matchstr(line,'\\end\*\?{\zs\w*\*\?\ze}')
if index(g:LatexBox_fold_envs_force, env) >= 0
return "s1"
else
return "="
endif
endif endif
endif endif
endif endif
@@ -288,7 +293,7 @@ function! LatexBox_FoldText_title()
endif endif
" Parts, sections and fakesections " Parts, sections and fakesections
let sections = '\(\(sub\)*section\|part\|chapter\)' let sections = '\(\(sub\)*\(section\|paragraph\)\|part\|chapter\)'
let secpat1 = '^\s*\\' . sections . '\*\?\s*{' let secpat1 = '^\s*\\' . sections . '\*\?\s*{'
let secpat2 = '^\s*\\' . sections . '\*\?\s*\[' let secpat2 = '^\s*\\' . sections . '\*\?\s*\['
if line =~ '\\frontmatter' if line =~ '\\frontmatter'

View File

@@ -23,6 +23,9 @@ endif
if ! exists('g:LatexBox_quickfix') if ! exists('g:LatexBox_quickfix')
let g:LatexBox_quickfix = 1 let g:LatexBox_quickfix = 1
endif endif
if ! exists('g:LatexBox_personal_latexmkrc')
let g:LatexBox_personal_latexmkrc = 0
endif
" }}} " }}}
@@ -177,7 +180,9 @@ function! LatexBox_Latexmk(force)
let cmd = 'cd ' . texroot . ' && ' let cmd = 'cd ' . texroot . ' && '
endif endif
let cmd .= env . ' latexmk' let cmd .= env . ' latexmk'
let cmd .= ' -' . g:LatexBox_output_type if ! g:LatexBox_personal_latexmkrc
let cmd .= ' -' . g:LatexBox_output_type
endif
let cmd .= ' -quiet ' let cmd .= ' -quiet '
let cmd .= g:LatexBox_latexmk_options let cmd .= g:LatexBox_latexmk_options
if a:force if a:force

View File

@@ -87,8 +87,12 @@ function! s:TOCActivate(close)
endfor endfor
" Find section in buffer (or inputted files) " Find section in buffer (or inputted files)
call s:TOCFindMatch('\\' . entry['level'] . '\_\s*{' . titlestr . '}', if entry['level'] == 'label'
\ duplicates, files) let re = '\(\\label\_\s*{\|label\s*=\s*\)' . titlestr . '\>'
else
let re = '\\' . entry['level'] . '\_\s*{' . titlestr . '}'
endif
call s:TOCFindMatch(re, duplicates, files)
if a:close if a:close
if g:LatexBox_split_resize if g:LatexBox_split_resize

View File

@@ -1,3 +1,8 @@
if exists('g:loaded_mustache_handlebars') && g:loaded_mustache_handlebars
finish
endif
let g:loaded_mustache_handlebars = 1
let s:cpo_save = &cpo let s:cpo_save = &cpo
set cpo&vim set cpo&vim

View File

@@ -277,12 +277,12 @@ function! RubyBalloonexpr()
endfunction endfunction
function! s:searchsyn(pattern,syn,flags,mode) function! s:searchsyn(pattern,syn,flags,mode)
let cnt = v:count1
norm! m' norm! m'
if a:mode ==# 'v' if a:mode ==# 'v'
norm! gv norm! gv
endif endif
let i = 0 let i = 0
let cnt = v:count ? v:count : 1
while i < cnt while i < cnt
let i = i + 1 let i = i + 1
let line = line('.') let line = line('.')

View File

@@ -35,9 +35,10 @@ silent! setlocal formatoptions+=j
" otherwise it's better than nothing. " otherwise it's better than nothing.
setlocal smartindent nocindent setlocal smartindent nocindent
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab if !exists("g:rust_recommended_style") || g:rust_recommended_style == 1
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
setlocal textwidth=99 setlocal textwidth=99
endif
" 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')

View File

@@ -1,10 +1,2 @@
compiler typescript compiler typescript
setlocal autoindent
setlocal smartindent
setlocal indentexpr&
setlocal cindent
setlocal cino=j1J1
setlocal commentstring=//\ %s setlocal commentstring=//\ %s

View File

@@ -1,12 +0,0 @@
" 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

View File

@@ -1,5 +1,5 @@
" Language: CoffeeScript " Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com> " Maintainer: Mick Koch <mick@kochm.co>
" URL: http://github.com/kchmck/vim-coffee-script " URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL " License: WTFPL

View File

@@ -11,7 +11,7 @@ let b:did_indent = 1
setlocal nosmartindent setlocal nosmartindent
setlocal indentexpr=GetElixirIndent() setlocal indentexpr=GetElixirIndent()
setlocal indentkeys+==end,=else:,=match:,=elsif:,=catch:,=after:,=rescue: setlocal indentkeys+=0=end,0=else,0=match,0=elsif,0=catch,0=after,0=rescue
if exists("*GetElixirIndent") if exists("*GetElixirIndent")
finish finish
@@ -67,10 +67,17 @@ function! GetElixirIndent()
let ind += &sw let ind += &sw
endif endif
" if line starts with pipeline
" and last line contains pipeline(s)
" align them
if last_line =~ '|>.*$' &&
\ current_line =~ s:pipeline
let ind = float2nr(match(last_line, '|>') / &sw) * &sw
" if line starts with pipeline " if line starts with pipeline
" and last line is an attribution " and last line is an attribution
" indents pipeline in same level as attribution " indents pipeline in same level as attribution
if current_line =~ s:pipeline && elseif current_line =~ s:pipeline &&
\ last_line =~ '^[^=]\+=.\+$' \ last_line =~ '^[^=]\+=.\+$'
let b:old_ind = ind let b:old_ind = ind
let ind = float2nr(matchend(last_line, '=\s*[^ ]') / &sw) * &sw let ind = float2nr(matchend(last_line, '=\s*[^ ]') / &sw) * &sw

View File

@@ -42,6 +42,13 @@ if exists("*GetErubyIndent")
endif endif
function! GetErubyIndent(...) function! GetErubyIndent(...)
" The value of a single shift-width
if exists('*shiftwidth')
let sw = shiftwidth()
else
let sw = &sw
endif
if a:0 && a:1 == '.' if a:0 && a:1 == '.'
let v:lnum = line('.') let v:lnum = line('.')
elseif a:0 && a:1 =~ '^\d' elseif a:0 && a:1 =~ '^\d'
@@ -70,24 +77,24 @@ function! GetErubyIndent(...)
let line = getline(lnum) let line = getline(lnum)
let cline = getline(v:lnum) let cline = getline(v:lnum)
if cline =~# '^\s*<%[-=]\=\s*\%(}\|end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%([-=]\=%>\|$\)' if cline =~# '^\s*<%[-=]\=\s*\%(}\|end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%([-=]\=%>\|$\)'
let ind = ind - &sw let ind = ind - sw
endif endif
if line =~# '\S\s*<%[-=]\=\s*\%(}\|end\).\{-\}\s*\%([-=]\=%>\|$\)' if line =~# '\S\s*<%[-=]\=\s*\%(}\|end\).\{-\}\s*\%([-=]\=%>\|$\)'
let ind = ind - &sw let ind = ind - sw
endif endif
if line =~# '\%({\|\<do\)\%(\s*|[^|]*|\)\=\s*[-=]\=%>' if line =~# '\%({\|\<do\)\%(\s*|[^|]*|\)\=\s*[-=]\=%>'
let ind = ind + &sw let ind = ind + sw
elseif line =~# '<%[-=]\=\s*\%(module\|class\|def\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\)\>.*%>' elseif line =~# '<%[-=]\=\s*\%(module\|class\|def\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\)\>.*%>'
let ind = ind + &sw let ind = ind + sw
endif endif
if line =~# '^\s*<%[=#-]\=\s*$' && cline !~# '^\s*end\>' if line =~# '^\s*<%[=#-]\=\s*$' && cline !~# '^\s*end\>'
let ind = ind + &sw let ind = ind + sw
endif endif
if line !~# '^\s*<%' && line =~# '%>\s*$' if line !~# '^\s*<%' && line =~# '%>\s*$'
let ind = ind - &sw let ind = ind - sw
endif endif
if cline =~# '^\s*[-=]\=%>\s*$' if cline =~# '^\s*[-=]\=%>\s*$'
let ind = ind - &sw let ind = ind - sw
endif endif
return ind return ind
endfunction endfunction

View File

@@ -55,7 +55,7 @@ function! HIndent(lnum)
" This is the wrong thing if you are deeply indented already and want to put " This is the wrong thing if you are deeply indented already and want to put
" a where clause on the top-level construct, but there isn't much that can " a where clause on the top-level construct, but there isn't much that can
" be done about that case... " be done about that case...
if thisl =~ '^\s*where\s*$' if thisl =~ '^\s*where\s*'
return previ + &sw return previ + &sw
endif endif
@@ -175,11 +175,11 @@ function! HIndent(lnum)
return previ - &sw return previ - &sw
endif endif
" On the other hand, if the previous line is a where with some bindings " On the other hand, if the previous line is a do or where with some bindings
" following it on the same line, accommodate and align with the first non-ws " following it on the same line, accommodate and align with the first non-ws
" char after the where " char after the where
if prevl =~ '\Wwhere\s\+\w' if prevl =~ '\W\(do\|where\)\s\+\w'
let bindStart = match(prevl, '\(\Wwhere\s\+\)\@<=\w') let bindStart = match(prevl, '\(\W\(do\|where\)\s\+\)\@<=\w')
if bindStart != -1 if bindStart != -1
return bindStart return bindStart
endif endif
@@ -248,7 +248,7 @@ function! s:GetAndStripTrailingComments(lnum)
let aline = getline(a:lnum) let aline = getline(a:lnum)
" We can't just remove the string literal since that leaves us with a " We can't just remove the string literal since that leaves us with a
" trailing operator (=), so replace it with a fake identifier " trailing operator (=), so replace it with a fake identifier
let noStrings = substitute(aline, '"\([^"]\|\\"\)*"', 's', '') let noStrings = substitute(aline, '"\([^"]\|\\"\)*"', '\=repeat("s", len(submatch(0)))', '')
let noLineCom = substitute(noStrings, '--.*$', '', '') let noLineCom = substitute(noStrings, '--.*$', '', '')
" If there are no fancy block comments involved, skip some of this extra " If there are no fancy block comments involved, skip some of this extra

View File

@@ -127,10 +127,12 @@ call add(s:tags, 'meter')
call add(s:tags, 'nav') call add(s:tags, 'nav')
call add(s:tags, 'output') call add(s:tags, 'output')
call add(s:tags, 'progress') call add(s:tags, 'progress')
call add(s:tags, 'picture')
call add(s:tags, 'rp') call add(s:tags, 'rp')
call add(s:tags, 'rt') call add(s:tags, 'rt')
call add(s:tags, 'ruby') call add(s:tags, 'ruby')
call add(s:tags, 'section') call add(s:tags, 'section')
call add(s:tags, 'source')
call add(s:tags, 'summary') call add(s:tags, 'summary')
call add(s:tags, 'time') call add(s:tags, 'time')
call add(s:tags, 'video') call add(s:tags, 'video')
@@ -187,6 +189,7 @@ if exists('g:html_exclude_tags')
endfor endfor
endif endif
let s:html_indent_tags = join(s:tags, '\|') let s:html_indent_tags = join(s:tags, '\|')
let s:html_indent_tags = s:html_indent_tags.'\|\w\+\(-\w\+\)\+'
if exists('g:html_indent_tags') if exists('g:html_indent_tags')
let s:html_indent_tags = s:html_indent_tags.'\|'.g:html_indent_tags let s:html_indent_tags = s:html_indent_tags.'\|'.g:html_indent_tags
endif endif
@@ -281,7 +284,7 @@ fun! HtmlIndentGet(lnum)
if 0 < searchpair(js, '', jse, 'nWb') if 0 < searchpair(js, '', jse, 'nWb')
\ && 0 < searchpair(js, '', jse, 'nW') \ && 0 < searchpair(js, '', jse, 'nW')
" we're inside javascript " we're inside javascript
if getline(searchpair(js, '', '</script>', 'nWb')) !~ '<script [^>]*type=["'']\?text\/\(html\|template\)' if getline(searchpair(js, '', '</script>', 'nWb')) !~ '<script [^>]*type=["'']\?text\/\(html\|\(ng-\)\?template\)'
\ && getline(lnum) !~ js && getline(a:lnum) !~ jse \ && getline(lnum) !~ js && getline(a:lnum) !~ jse
if restore_ic == 0 if restore_ic == 0
setlocal noic setlocal noic

View File

@@ -15,6 +15,7 @@ setlocal nosmartindent
" Now, set up our indentation expression and keys that trigger it. " Now, set up our indentation expression and keys that trigger it.
setlocal indentexpr=GetJavascriptIndent() setlocal indentexpr=GetJavascriptIndent()
setlocal formatexpr=Fixedgq(v:lnum,v:count)
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e
" Only define the function once. " Only define the function once.
@@ -437,3 +438,58 @@ endfunction
let &cpo = s:cpo_save let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save
function! Fixedgq(lnum, count)
let l:tw = &tw ? &tw : 80;
let l:count = a:count
if mode() == 'i' " gq was not pressed, but tw was set
return 1
endif
if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq
return 1
endif
" Put all the lines on one line and do normal spliting after that
if l:count > 1
while l:count > 1
let l:count -= 1
normal J
endwhile
endif
let l:winview = winsaveview()
call cursor(a:lnum, l:tw + 1)
let orig_breakpoint = searchpairpos(' ', '', '\.', 'bcW', '', a:lnum)
call cursor(a:lnum, l:tw + 1)
let breakpoint = searchpairpos(' ', '', '\.', 'bcW', s:skip_expr, a:lnum)
" No need for special treatment, normal gq handles edgecases better
if breakpoint[1] == orig_breakpoint[1]
call winrestview(l:winview)
return 1
endif
" Try breaking after string
if breakpoint[1] <= indent(a:lnum)
call cursor(a:lnum, l:tw + 1)
let breakpoint = searchpairpos('\.', '', ' ', 'cW', s:skip_expr, a:lnum)
endif
if breakpoint[1] != 0
call feedkeys("r\<CR>")
else
let l:count = l:count - 1
endif
" run gq on new lines
if l:count == 1
call feedkeys("gqq")
endif
return 0
endfunction

View File

@@ -369,6 +369,13 @@ function GetRubyIndent(...)
" 3.1. Setup {{{2 " 3.1. Setup {{{2
" ---------- " ----------
" The value of a single shift-width
if exists('*shiftwidth')
let sw = shiftwidth()
else
let sw = &sw
endif
" For the current line, use the first argument if given, else v:lnum " For the current line, use the first argument if given, else v:lnum
let clnum = a:0 ? a:1 : v:lnum let clnum = a:0 ? a:1 : v:lnum
@@ -388,7 +395,7 @@ function GetRubyIndent(...)
if s:Match(clnum, s:access_modifier_regex) if s:Match(clnum, s:access_modifier_regex)
let class_line = s:FindContainingClass() let class_line = s:FindContainingClass()
if class_line > 0 if class_line > 0
return indent(class_line) + &sw return indent(class_line) + sw
endif endif
endif endif
elseif g:ruby_indent_access_modifier_style == 'outdent' elseif g:ruby_indent_access_modifier_style == 'outdent'
@@ -458,7 +465,7 @@ function GetRubyIndent(...)
" If the current line starts with a leading operator, add a level of indent. " If the current line starts with a leading operator, add a level of indent.
if s:Match(clnum, s:leading_operator_regex) if s:Match(clnum, s:leading_operator_regex)
return indent(s:GetMSL(clnum)) + &sw return indent(s:GetMSL(clnum)) + sw
endif endif
" 3.3. Work on the previous line. {{{2 " 3.3. Work on the previous line. {{{2
@@ -485,23 +492,23 @@ function GetRubyIndent(...)
" If the previous line was a private/protected keyword, add a " If the previous line was a private/protected keyword, add a
" level of indent. " level of indent.
if s:Match(lnum, s:indent_access_modifier_regex) if s:Match(lnum, s:indent_access_modifier_regex)
return indent(lnum) + &sw return indent(lnum) + sw
endif endif
elseif g:ruby_indent_access_modifier_style == 'outdent' elseif g:ruby_indent_access_modifier_style == 'outdent'
" If the previous line was a private/protected/public keyword, add " If the previous line was a private/protected/public keyword, add
" a level of indent, since the keyword has been out-dented. " a level of indent, since the keyword has been out-dented.
if s:Match(lnum, s:access_modifier_regex) if s:Match(lnum, s:access_modifier_regex)
return indent(lnum) + &sw return indent(lnum) + sw
endif endif
endif endif
if s:Match(lnum, s:continuable_regex) && s:Match(lnum, s:continuation_regex) if s:Match(lnum, s:continuable_regex) && s:Match(lnum, s:continuation_regex)
return indent(s:GetMSL(lnum)) + &sw + &sw return indent(s:GetMSL(lnum)) + sw + sw
endif 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
endif endif
" If the previous line started with a leading operator, use its MSL's level " If the previous line started with a leading operator, use its MSL's level
@@ -512,7 +519,7 @@ function GetRubyIndent(...)
" If the previous line ended with the "*" of a splat, add a level of indent " If the previous line ended with the "*" of a splat, add a level of indent
if line =~ s:splat_regex if line =~ s:splat_regex
return indent(lnum) + &sw return indent(lnum) + sw
endif endif
" If the previous line contained unclosed opening brackets and we are still " If the previous line contained unclosed opening brackets and we are still
@@ -527,20 +534,20 @@ function GetRubyIndent(...)
if opening.pos != -1 if opening.pos != -1
if opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0 if opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
if col('.') + 1 == col('$') if col('.') + 1 == col('$')
return ind + &sw return ind + sw
else else
return virtcol('.') return virtcol('.')
endif endif
else else
let nonspace = matchend(line, '\S', opening.pos + 1) - 1 let nonspace = matchend(line, '\S', opening.pos + 1) - 1
return nonspace > 0 ? nonspace : ind + &sw return nonspace > 0 ? nonspace : ind + sw
endif endif
elseif closing.pos != -1 elseif closing.pos != -1
call cursor(lnum, closing.pos + 1) call cursor(lnum, closing.pos + 1)
normal! % normal! %
if s:Match(line('.'), s:ruby_indent_keywords) if s:Match(line('.'), s:ruby_indent_keywords)
return indent('.') + &sw return indent('.') + sw
else else
return indent('.') return indent('.')
endif endif
@@ -569,7 +576,7 @@ function GetRubyIndent(...)
let col = s:Match(lnum, s:ruby_indent_keywords) let col = s:Match(lnum, s:ruby_indent_keywords)
if col > 0 if col > 0
call cursor(lnum, col) call cursor(lnum, col)
let ind = virtcol('.') - 1 + &sw let ind = virtcol('.') - 1 + sw
" TODO: make this better (we need to count them) (or, if a searchpair " TODO: make this better (we need to count them) (or, if a searchpair
" fails, we know that something is lacking an end and thus we indent a " fails, we know that something is lacking an end and thus we indent a
" level " level
@@ -606,9 +613,9 @@ function GetRubyIndent(...)
" TODO: this does not take into account contrived things such as " TODO: this does not take into account contrived things such as
" module Foo; class Bar; end " module Foo; class Bar; end
if s:Match(lnum, s:ruby_indent_keywords) if s:Match(lnum, s:ruby_indent_keywords)
let ind = msl_ind + &sw let ind = msl_ind + sw
if s:Match(lnum, s:end_end_regex) if s:Match(lnum, s:end_end_regex)
let ind = ind - &sw let ind = ind - sw
endif endif
return ind return ind
endif endif
@@ -617,7 +624,7 @@ function GetRubyIndent(...)
" closing bracket, indent one extra level. " closing bracket, indent one extra level.
if s:Match(lnum, s:non_bracket_continuation_regex) && !s:Match(lnum, '^\s*\([\])}]\|end\)') if s:Match(lnum, s:non_bracket_continuation_regex) && !s:Match(lnum, '^\s*\([\])}]\|end\)')
if lnum == p_lnum if lnum == p_lnum
let ind = msl_ind + &sw let ind = msl_ind + sw
else else
let ind = msl_ind let ind = msl_ind
endif endif

View File

@@ -1,7 +1,7 @@
" Vim indent file " Vim indent file
" Language: Rust " Language: Rust
" Author: Chris Morgan <me@chrismorgan.info> " Author: Chris Morgan <me@chrismorgan.info>
" Last Change: 2013 Oct 29 " Last Change: 2014 Sep 13
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
if exists("b:did_indent") if exists("b:did_indent")
@@ -10,7 +10,7 @@ endif
let b:did_indent = 1 let b:did_indent = 1
setlocal cindent setlocal cindent
setlocal cinoptions=L0,(0,Ws,JN,j1 setlocal cinoptions=L0,(0,Ws,J1,j1
setlocal cinkeys=0{,0},!^F,o,O,0[,0] setlocal cinkeys=0{,0},!^F,o,O,0[,0]
" Don't think cinwords will actually do anything at all... never mind " Don't think cinwords will actually do anything at all... never mind
setlocal cinwords=for,if,else,while,loop,impl,mod,unsafe,trait,struct,enum,fn,extern setlocal cinwords=for,if,else,while,loop,impl,mod,unsafe,trait,struct,enum,fn,extern
@@ -151,40 +151,42 @@ function GetRustIndent(lnum)
" "
" There are probably other cases where we don't want to do this as " There are probably other cases where we don't want to do this as
" well. Add them as needed. " well. Add them as needed.
return GetRustIndent(a:lnum - 1) return indent(prevlinenum)
endif endif
" cindent doesn't do the module scope well at all; e.g.:: if !has("patch-7.4.355")
" " cindent before 7.4.355 doesn't do the module scope well at all; e.g.::
" static FOO : &'static [bool] = [ "
" true, " static FOO : &'static [bool] = [
" false, " true,
" false, " false,
" true, " false,
" ]; " true,
" " ];
" uh oh, next statement is indented further! "
" uh oh, next statement is indented further!
" Note that this does *not* apply the line continuation pattern properly; " Note that this does *not* apply the line continuation pattern properly;
" that's too hard to do correctly for my liking at present, so I'll just " that's too hard to do correctly for my liking at present, so I'll just
" start with these two main cases (square brackets and not returning to " start with these two main cases (square brackets and not returning to
" column zero) " column zero)
call cursor(a:lnum, 1) call cursor(a:lnum, 1)
if searchpair('{\|(', '', '}\|)', 'nbW', if searchpair('{\|(', '', '}\|)', 'nbW',
\ 's:is_string_comment(line("."), col("."))') == 0
if searchpair('\[', '', '\]', 'nbW',
\ 's:is_string_comment(line("."), col("."))') == 0 \ 's:is_string_comment(line("."), col("."))') == 0
" Global scope, should be zero if searchpair('\[', '', '\]', 'nbW',
return 0 \ 's:is_string_comment(line("."), col("."))') == 0
else " Global scope, should be zero
" At the module scope, inside square brackets only
"if getline(a:lnum)[0] == ']' || search('\[', '', '\]', 'nW') == a:lnum
if line =~ "^\\s*]"
" It's the closing line, dedent it
return 0 return 0
else else
return &shiftwidth " At the module scope, inside square brackets only
"if getline(a:lnum)[0] == ']' || search('\[', '', '\]', 'nW') == a:lnum
if line =~ "^\\s*]"
" It's the closing line, dedent it
return 0
else
return &shiftwidth
endif
endif endif
endif endif
endif endif

View File

@@ -90,4 +90,35 @@ function! LatexBox_TexIndent()
endfunction endfunction
" }}} " }}}
" Restore cursor position, window position, and last search after running a
" command.
function! Latexbox_CallIndent()
" Save the current cursor position.
let cursor = getpos('.')
" Save the current window position.
normal! H
let window = getpos('.')
call setpos('.', cursor)
" Execute the command.
execute 'normal! =='
" Restore the previous window position.
call setpos('.', window)
normal! zt
" Restore the previous cursor position.
call setpos('.', cursor)
endfunction
" autocmd to call indent after completion
" 7.3.598
if v:version > 703 || (v:version == 703 && has('patch598'))
augroup LatexBox_Completion
autocmd!
autocmd CompleteDone <buffer> call Latexbox_CallIndent()
augroup END
endif
" vim:fdm=marker:ff=unix:noet:ts=4:sw=4 " vim:fdm=marker:ff=unix:noet:ts=4:sw=4

View File

@@ -1,35 +1,41 @@
" Language: Blade (Laravel) " Language: Blade
" Maintainer: xsbeats <jwalton512@gmail.com> " Maintainer: Jason Walton <jwalton512@gmail.com>
" URL: http://github.com/xsbeats/vim-blade " URL: https://github.com/xsbeats/vim-blade
" License: WTFPL " License: DBAD
if exists("b:current_syntax") " Check if our syntax is already loaded
if exists('b:current_syntax') && b:current_syntax == 'blade'
finish finish
endif endif
runtime! syntax/html.vim " Include PHP
unlet b:current_syntax
runtime! syntax/php.vim runtime! syntax/php.vim
unlet b:current_syntax silent! 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 " Echos
syn region bladeUnescapedEcho matchgroup=bladeEchoDelim start=/@\@<!\s*{!!/ end=/!!}\s*/ oneline contains=@phpClTop containedin=ALLBUT,bladeComment
syn region bladeEscapedEcho matchgroup=bladeEchoDelim start=/@\@<!\s*{{{\@!/ end=/}}\s*/ oneline contains=@phpClTop containedin=ALLBUT,bladeComment
syn region bladeEscapedEcho matchgroup=bladeEchoDelim start=/@\@<!\s*{{{{\@!/ end=/}}}/ oneline contains=@phpClTop containedin=ALLBUT,bladeComment
syn match bladeKeyword /@\(else\|endfor\|endforeach\|endif\|endsection\|endunless\|endwhile\|overwrite\|parent\|show\|stop\)\>/ containedin=ALL,bladeComment " Structures
syn match bladeStructure /\s*@\(else\|empty\|endfor\|endforeach\|endforelse\|endif\|endpush\|endsection\|endunless\|endwhile\|overwrite\|show\|stop\)\>/
syn match bladeStructure /\s*@\(append\|choice\|each\|elseif\|extends\|for\|foreach\|forelse\|if\|include\|lang\|push\|section\|stack\|unless\|while\|yield\|\)\>\s*/ nextgroup=bladeParens
syn region bladeParens matchgroup=bladeParen start=/(/ end=/)/ contained contains=@bladeAll,@phpClTop
syn region bladeCommentBlock start="{{--" end="--}}" contains=bladeComment keepend containedin=TOP " Comments
syn match bladeComment /.*/ contained containedin=bladeCommentBlock syn region bladeComments start=/\s*{{--/ end=/--}}/ contains=bladeComment keepend
syn match bladeComment /.*/ contained containedin=bladeComments
syn region bladeEchoUnescaped matchgroup=bladeEchoDelim start="\([@|{]\)\@<!{{\(--\)\@!" end="}}" contains=@phpClInside containedin=ALLBUT,bladeComment " Clusters
syn region bladeEchoEscaped matchgroup=bladeEchoDelim start="\(@\)\@<!{{{" end="}}}" contains=@phpClInside containedin=ALLBUT,bladeComment syn cluster bladeAll contains=bladeStructure,bladeParens
syn cluster bladeStatement contains=bladeConditional,bladeKeyword " Highlighting
hi def link bladeComment Comment
hi def link bladeEchoDelim Delimiter
hi def link bladeParen Delimiter
hi def link bladeStructure Keyword
syn region bladeParenBlock start="(" end=")" contained oneline contains=bladeParenBlock,@phpClInside,@bladeStatement extend keepend
hi def link bladeComment Comment if !exists('b:current_syntax')
hi def link bladeConditional Conditional let b:current_syntax = 'blade'
hi def link bladeKeyword Keyword endif
hi def link bladeEchoDelim Delimiter
let b:current_syntax = 'blade'

View File

@@ -1,5 +1,5 @@
" Language: CoffeeScript " Language: CoffeeScript
" Maintainer: Mick Koch <kchmck@gmail.com> " Maintainer: Mick Koch <mick@kochm.co>
" URL: http://github.com/kchmck/vim-coffee-script " URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL " License: WTFPL

View File

@@ -6,7 +6,7 @@
" Nikolai Weibull (Add CSS2 support) " Nikolai Weibull (Add CSS2 support)
" Maintainer: Jules Wang <w.jq0722@gmail.com> " Maintainer: Jules Wang <w.jq0722@gmail.com>
" URL: https://github.com/JulesWang/css.vim " URL: https://github.com/JulesWang/css.vim
" Last Change: 2013 Nov.27 " Last Change: 2014 Oct.28
" For version 5.x: Clear all syntax items " For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded " For version 6.x: Quit when a syntax file was already loaded
@@ -26,18 +26,19 @@ set cpo&vim
syn case ignore syn case ignore
" All HTML4 tags " HTML4 tags
syn keyword cssTagName abbr acronym address applet area a b base syn keyword cssTagName abbr address area a b base
syn keyword cssTagName basefont bdo big blockquote body br button syn keyword cssTagName bdo blockquote body br button
syn keyword cssTagName caption center cite code col colgroup dd del syn keyword cssTagName caption cite code col colgroup dd del
syn keyword cssTagName dfn dir div dl dt em fieldset font form frame syn keyword cssTagName dfn div dl dt em fieldset form
syn keyword cssTagName frameset h1 h2 h3 h4 h5 h6 head hr html img i syn keyword cssTagName 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 iframe input ins isindex kbd label legend li
syn keyword cssTagName link map menu meta noframes noscript ol optgroup syn keyword cssTagName link map menu meta noscript ol optgroup
syn keyword cssTagName option p param pre q s samp script select small syn keyword cssTagName option p param pre q s samp script small
syn keyword cssTagName span strike strong style sub sup table tbody td syn keyword cssTagName span strong sub sup tbody td
syn keyword cssTagName textarea tfoot th thead title tr tt ul u var syn keyword cssTagName textarea tfoot th thead title tr ul u var
syn keyword cssTagName object svg syn keyword cssTagName object svg
syn match cssTagName /\<select\>\|\<style\>\|\<table\>/
" 34 HTML5 tags " 34 HTML5 tags
syn keyword cssTagName article aside audio bdi canvas command data syn keyword cssTagName article aside audio bdi canvas command data
@@ -47,8 +48,8 @@ syn keyword cssTagName output progress rt rp ruby section
syn keyword cssTagName source summary time track video wbr syn keyword cssTagName source summary time track video wbr
" Tags not supported in HTML5 " Tags not supported in HTML5
syn keyword cssDeprecated acronym applet basefont big center dir " acronym applet basefont big center dir
syn keyword cssDeprecated font frame frameset noframes strike tt " font frame frameset noframes strike tt
syn match cssTagName "\*" syn match cssTagName "\*"
@@ -70,10 +71,10 @@ endtry
" digits " digits
syn match cssValueInteger contained "[-+]\=\d\+" contains=cssUnitDecorators syn match cssValueInteger contained "[-+]\=\d\+" contains=cssUnitDecorators
syn match cssValueNumber contained "[-+]\=\d\+\(\.\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 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 cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)\>" contains=cssUnitDecorators
syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)" contains=cssUnitDecorators syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)\>" contains=cssUnitDecorators
syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)" contains=cssUnitDecorators syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)\>" contains=cssUnitDecorators
syn match cssIncludeKeyword /@\(-[a-z]\+-\)\=\(media\|keyframes\|import\|charset\|namespace\|page\)/ contained syn match cssIncludeKeyword /@\(-[a-z]\+-\)\=\(media\|keyframes\|import\|charset\|namespace\|page\)/ contained
@@ -116,15 +117,27 @@ syn region cssInclude start=/@namespace\>/ end=/\ze;/ transparent contains=cssSt
" @font-face " @font-face
" http://www.w3.org/TR/css3-fonts/#at-font-face-rule " http://www.w3.org/TR/css3-fonts/#at-font-face-rule
syn match cssFontDescriptor "@font-face\>" nextgroup=cssFontDescriptorBlock skipwhite skipnl 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 region cssFontDescriptorBlock contained transparent matchgroup=cssBraces start="{" end="}" contains=cssComment,cssError,cssUnicodeEscape,cssCommonAttr,cssFontDescriptorProp,cssValue.*,cssFontDescriptorFunction,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 match cssFontDescriptorProp contained "\<font-family\>"
syn keyword cssFontDescriptorProp contained src syn keyword cssFontDescriptorProp contained src
syn match cssFontDescriptorProp contained "\<font-\(style\|weight\|stretch\)\>"
syn match cssFontDescriptorProp contained "\<unicode-range\>" syn match cssFontDescriptorProp contained "\<unicode-range\>"
syn keyword cssFontDescriptorAttr contained all syn match cssFontDescriptorProp contained "\<font-\(variant\|feature-settings\)\>"
" src functions
syn region cssFontDescriptorFunction contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline keepend 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?]\+" " font-sytle and font-weight attributes
syn match cssUnicodeRange contained "U+\x\+-\x\+" syn keyword cssFontDescriptorAttr contained normal italic oblique bold
" font-stretch attributes
syn match cssFontDescriptorAttr contained "\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>"
" unicode-range attributes
syn match cssFontDescriptorAttr contained "U+[0-9A-Fa-f?]\+"
syn match cssFontDescriptorAttr contained "U+\x\+-\x\+"
" font-feature-settings attributes
syn keyword cssFontDescriptorAttr contained on off
" The 16 basic color names " The 16 basic color names
syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow
@@ -133,23 +146,23 @@ syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon na
syn keyword cssColor contained aliceblue antiquewhite aquamarine azure syn keyword cssColor contained aliceblue antiquewhite aquamarine azure
syn keyword cssColor contained beige bisque blanchedalmond blueviolet brown burlywood syn keyword cssColor contained beige bisque blanchedalmond blueviolet brown burlywood
syn keyword cssColor contained cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan 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\(blue\|cyan\|goldenrod\|gray\|green\|grey\|khaki\)\>/
syn match cssColor contained /dark\(magenta\|olivegreen\|orange\|orchid\|red\|salmon\|seagreen\)/ syn match cssColor contained /\<dark\(magenta\|olivegreen\|orange\|orchid\|red\|salmon\|seagreen\)\>/
syn match cssColor contained /darkslate\(blue\|gray\|grey\)/ syn match cssColor contained /\<darkslate\(blue\|gray\|grey\)\>/
syn match cssColor contained /dark\(turquoise\|violet\)/ syn match cssColor contained /\<dark\(turquoise\|violet\)\>/
syn keyword cssColor contained deeppink deepskyblue dimgray dimgrey dodgerblue firebrick syn keyword cssColor contained deeppink deepskyblue dimgray dimgrey dodgerblue firebrick
syn keyword cssColor contained floralwhite forestgreen gainsboro ghostwhite gold syn keyword cssColor contained floralwhite forestgreen gainsboro ghostwhite gold
syn keyword cssColor contained goldenrod greenyellow grey honeydew hotpink syn keyword cssColor contained goldenrod greenyellow grey honeydew hotpink
syn keyword cssColor contained indianred indigo ivory khaki lavender lavenderblush lawngreen syn keyword cssColor contained indianred indigo ivory khaki lavender lavenderblush lawngreen
syn keyword cssColor contained lemonchiffon limegreen linen magenta syn keyword cssColor contained lemonchiffon limegreen linen magenta
syn match cssColor contained /light\(blue\|coral\|cyan\|goldenrodyellow\|gray\|green\)/ 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\(grey\|pink\|salmon\|seagreen\|skyblue\|yellow\)\>/
syn match cssColor contained /light\(slategray\|slategrey\|steelblue\)/ syn match cssColor contained /\<light\(slategray\|slategrey\|steelblue\)\>/
syn match cssColor contained /medium\(aquamarine\|blue\|orchid\|purple\|seagreen\)/ syn match cssColor contained /\<medium\(aquamarine\|blue\|orchid\|purple\|seagreen\)\>/
syn match cssColor contained /medium\(slateblue\|springgreen\|turquoise\|violetred\)/ syn match cssColor contained /\<medium\(slateblue\|springgreen\|turquoise\|violetred\)\>/
syn keyword cssColor contained midnightblue mintcream mistyrose moccasin navajowhite syn keyword cssColor contained midnightblue mintcream mistyrose moccasin navajowhite
syn keyword cssColor contained oldlace olivedrab orange orangered orchid syn keyword cssColor contained oldlace olivedrab orange orangered orchid
syn match cssColor contained /pale\(goldenrod\|green\|turquoise\|violetred\)/ syn match cssColor contained /\<pale\(goldenrod\|green\|turquoise\|violetred\)\>/
syn keyword cssColor contained papayawhip peachpuff peru pink plum powderblue syn keyword cssColor contained papayawhip peachpuff peru pink plum powderblue
syn keyword cssColor contained rosybrown royalblue saddlebrown salmon sandybrown syn keyword cssColor contained rosybrown royalblue saddlebrown salmon sandybrown
syn keyword cssColor contained seagreen seashell sienna skyblue slateblue syn keyword cssColor contained seagreen seashell sienna skyblue slateblue
@@ -265,6 +278,7 @@ syn match cssFlexibleBoxAttr contained "\<\(inline\|block\)-axis\>"
" CSS Fonts Module Level 3 " CSS Fonts Module Level 3
" http://www.w3.org/TR/css-fonts-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\)\)\=\>" 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 " font attributes
syn keyword cssFontAttr contained icon menu caption syn keyword cssFontAttr contained icon menu caption
syn match cssFontAttr contained "\<small-\(caps\|caption\)\>" syn match cssFontAttr contained "\<small-\(caps\|caption\)\>"
@@ -272,27 +286,21 @@ syn match cssFontAttr contained "\<message-box\>"
syn match cssFontAttr contained "\<status-bar\>" syn match cssFontAttr contained "\<status-bar\>"
syn keyword cssFontAttr contained larger smaller syn keyword cssFontAttr contained larger smaller
syn match cssFontAttr contained "\<\(x\{1,2\}-\)\=\(large\|small\)\>" syn match cssFontAttr contained "\<\(x\{1,2\}-\)\=\(large\|small\)\>"
" font-family attributes " font-family attributes
syn match cssFontAttr contained "\<\(sans-\)\=serif\>" 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 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 Verdana Webdings Wingdings York Zapf
syn keyword cssFontAttr contained cursive fantasy monospace syn keyword cssFontAttr contained cursive fantasy monospace
" font-feature-settings attributes " font-feature-settings attributes
syn keyword cssFontAttr contained on off syn keyword cssFontAttr contained on off
" font-stretch attributes " font-stretch attributes
syn match cssFontAttr contained "\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>" syn match cssFontAttr contained "\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>"
" font-style attributes " font-style attributes
syn keyword cssFontAttr contained italic oblique syn keyword cssFontAttr contained italic oblique
" font-synthesis attributes
" font-variant-caps attributes syn keyword cssFontAttr contained weight style
syn match cssFontAttr contained "\<\(all-\)\=\(small-\|petite-\|titling-\)caps\>"
syn keyword cssFontAttr contained unicase
" font-weight attributes " font-weight attributes
syn keyword cssFontAttr contained bold bolder lighter syn keyword cssFontAttr contained bold bolder lighter
" TODO: font-variant-* attributes
"------------------------------------------------ "------------------------------------------------
" Webkit specific property/attributes " Webkit specific property/attributes

View File

@@ -139,35 +139,6 @@ fu! <sid>DoSyntaxDefinitions() "{{{3
hi def link CSVColumnHeaderEven WarningMsg hi def link CSVColumnHeaderEven WarningMsg
hi def link CSVColumnOdd DiffAdd hi def link CSVColumnOdd DiffAdd
hi def link CSVColumnEven DiffChange hi def link CSVColumnEven DiffChange
" Old Version
if 0
if &t_Co < 88
if !exists("b:csv_fixed_width_cols")
hi default CSVColumnHeaderOdd ctermfg=DarkRed ctermbg=15
\ guibg=grey80 guifg=black term=underline cterm=standout,bold
\ gui=bold,underline
endif
hi default CSVColumnOdd ctermfg=DarkRed ctermbg=15 guibg=grey80
\ guifg=black term=underline cterm=bold gui=underline
else
if !exists("b:csv_fixed_width_cols")
hi default CSVColumnHeaderOdd ctermfg=darkblue ctermbg=white
\ guibg=grey80 guifg=black cterm=standout,underline
\ gui=bold,underline
endif
hi default CSVColumnOdd ctermfg=darkblue ctermbg=white guibg=grey80
\ guifg=black cterm=reverse,underline gui=underline
endif
" ctermbg=8 should be safe, even in 8 color terms
if !exists("b:csv_fixed_width_cols")
hi default CSVColumnHeaderEven ctermfg=white ctermbg=darkgrey
\ guibg=grey50 guifg=black term=bold cterm=standout,underline
\ gui=bold,underline
endif
hi default CSVColumnEven ctermfg=white ctermbg=darkgrey guibg=grey50
\ guifg=black term=bold cterm=underline gui=bold,underline
endif
endfun endfun
" Main: {{{2 " Main: {{{2

View File

@@ -7,8 +7,6 @@ if exists("b:current_syntax")
finish finish
endif endif
let b:current_syntax = "dockerfile"
syntax case ignore syntax case ignore
syntax match dockerfileKeyword /\v^\s*(FROM|MAINTAINER|RUN|CMD|EXPOSE|ENV|ADD)\s/ syntax match dockerfileKeyword /\v^\s*(FROM|MAINTAINER|RUN|CMD|EXPOSE|ENV|ADD)\s/
@@ -20,3 +18,14 @@ highlight link dockerfileString String
syntax match dockerfileComment "\v^\s*#.*$" syntax match dockerfileComment "\v^\s*#.*$"
highlight link dockerfileComment Comment highlight link dockerfileComment Comment
syntax include @DockerSh syntax/sh.vim
try
syntax include @DockerSh after/syntax/sh.vim
catch
endtry
syntax region dockerShSnip matchgroup=DockerShGroup start="^\s*\%(RUN\|CMD\)\s\+" end="$" contains=@DockerSh
highlight link DockerShGroup dockerfileKeyword
let b:current_syntax = "dockerfile"

View File

@@ -22,6 +22,8 @@ syn keyword elixirKeyword quote unquote super
syn keyword elixirInclude import require alias use syn keyword elixirInclude import require alias use
syn keyword elixirSelf self
syn match elixirId '\<[_a-zA-Z]\w*[!?]\?\>' syn match elixirId '\<[_a-zA-Z]\w*[!?]\?\>'
" This unfortunately also matches function names in function calls " This unfortunately also matches function names in function calls
@@ -63,14 +65,14 @@ syn match elixirRegexQuantifier "[*?+][?+]\=" contained display
syn match elixirRegexQuantifier "{\d\+\%(,\d*\)\=}?\=" contained display syn match elixirRegexQuantifier "{\d\+\%(,\d*\)\=}?\=" contained display
syn match elixirRegexCharClass "\[:\(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|xdigit\):\]" contained display syn match elixirRegexCharClass "\[:\(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|xdigit\):\]" contained display
syn region elixirRegex matchgroup=elixirDelimiter start="%r/" end="/[uiomxfr]*" skip="\\\\" contains=@elixirRegexSpecial syn region elixirRegex matchgroup=elixirRegexDelimiter start="%r/" end="/[uiomxfr]*" skip="\\\\" contains=@elixirRegexSpecial
syn cluster elixirRegexSpecial contains=elixirRegexEscape,elixirRegexCharClass,elixirRegexQuantifier,elixirRegexEscapePunctuation syn cluster elixirRegexSpecial contains=elixirRegexEscape,elixirRegexCharClass,elixirRegexQuantifier,elixirRegexEscapePunctuation
syn cluster elixirStringContained contains=elixirInterpolation,elixirRegexEscape,elixirRegexCharClass syn cluster elixirStringContained contains=elixirInterpolation,elixirRegexEscape,elixirRegexCharClass
syn region elixirString matchgroup=elixirDelimiter start="'" end="'" skip="\\'" syn region elixirString matchgroup=elixirStringDelimiter start="'" end="'" skip="\\'|\\\\"
syn region elixirString matchgroup=elixirDelimiter start='"' end='"' skip='\\"' contains=@elixirStringContained syn region elixirString matchgroup=elixirStringDelimiter start='"' end='"' skip='\\"' contains=@elixirStringContained
syn region elixirInterpolation matchgroup=elixirDelimiter start="#{" end="}" contained contains=ALLBUT,elixirComment,@elixirNotTop syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,elixirComment,@elixirNotTop
syn region elixirDocStringStart matchgroup=elixirDocString start=+"""+ end=+$+ oneline contains=ALLBUT,@elixirNotTop syn region elixirDocStringStart matchgroup=elixirDocString start=+"""+ end=+$+ oneline contains=ALLBUT,@elixirNotTop
syn region elixirDocStringStart matchgroup=elixirDocString start=+'''+ end=+$+ oneline contains=ALLBUT,@elixirNotTop syn region elixirDocStringStart matchgroup=elixirDocString start=+'''+ end=+$+ oneline contains=ALLBUT,@elixirNotTop
@@ -83,25 +85,25 @@ syn match elixirString "\(\w\)\@<!?\%(\\\(x\d{1,2}\|\h{1,2}\h\@!\>\|
syn region elixirBlock matchgroup=elixirKeyword start="\<do\>\(:\)\@!" end="\<end\>" contains=ALLBUT,@elixirNotTop fold syn region elixirBlock matchgroup=elixirKeyword start="\<do\>\(:\)\@!" end="\<end\>" contains=ALLBUT,@elixirNotTop fold
syn region elixirAnonymousFunction matchgroup=elixirKeyword start="\<fn\>" end="\<end\>" contains=ALLBUT,@elixirNotTop fold syn region elixirAnonymousFunction matchgroup=elixirKeyword start="\<fn\>" end="\<end\>" contains=ALLBUT,@elixirNotTop fold
syn region elixirArguments start="(" end=")" contained contains=elixirOperator,elixirAtom,elixirPseudoVariable,elixirAlias,elixirBoolean,elixirVariable,elixirUnusedVariable,elixirNumber,elixirDocString,elixirAtomInterpolated,elixirRegex,elixirString,elixirDelimiter syn region elixirArguments start="(" end=")" contained contains=elixirOperator,elixirAtom,elixirPseudoVariable,elixirAlias,elixirBoolean,elixirVariable,elixirUnusedVariable,elixirNumber,elixirDocString,elixirAtomInterpolated,elixirRegex,elixirString,elixirStringDelimiter,elixirRegexDelimiter,elixirInterpolationDelimiter,elixirSigilDelimiter
syn match elixirDelimEscape "\\[(<{\[)>}\]/\"'|]" transparent display contained contains=NONE syn match elixirDelimEscape "\\[(<{\[)>}\]/\"'|]" transparent display contained contains=NONE
syn region elixirSigil matchgroup=elixirDelimiter start="\~\u\z(/\|\"\|'\||\)" end="\z1" skip="\\\\\|\\\z1" contains=elixirDelimEscape fold syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\u\z(/\|\"\|'\||\)" end="\z1" skip="\\\\\|\\\z1" contains=elixirDelimEscape fold
syn region elixirSigil matchgroup=elixirDelimiter start="\~\u{" end="}" skip="\\\\\|\\}" contains=elixirDelimEscape fold syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\u{" end="}" skip="\\\\\|\\}" contains=elixirDelimEscape fold
syn region elixirSigil matchgroup=elixirDelimiter start="\~\u<" end=">" skip="\\\\\|\\>" contains=elixirDelimEscape fold syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\u<" end=">" skip="\\\\\|\\>" contains=elixirDelimEscape fold
syn region elixirSigil matchgroup=elixirDelimiter start="\~\u\[" end="\]" skip="\\\\\|\\\]" contains=elixirDelimEscape fold syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\u\[" end="\]" skip="\\\\\|\\\]" contains=elixirDelimEscape fold
syn region elixirSigil matchgroup=elixirDelimiter start="\~\u(" end=")" skip="\\\\\|\\)" contains=elixirDelimEscape fold syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\u(" end=")" skip="\\\\\|\\)" contains=elixirDelimEscape fold
syn region elixirSigil matchgroup=elixirDelimiter start="\~\l\z(/\|\"\|'\||\)" end="\z1" skip="\\\\\|\\\z1" fold syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l\z(/\|\"\|'\||\)" end="\z1" skip="\\\\\|\\\z1" fold
syn region elixirSigil matchgroup=elixirDelimiter start="\~\l{" end="}" skip="\\\\\|\\}" fold contains=@elixirStringContained,elixirRegexEscapePunctuation syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l{" end="}" skip="\\\\\|\\}" fold contains=@elixirStringContained,elixirRegexEscapePunctuation
syn region elixirSigil matchgroup=elixirDelimiter start="\~\l<" end=">" skip="\\\\\|\\>" fold contains=@elixirStringContained,elixirRegexEscapePunctuation syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l<" end=">" skip="\\\\\|\\>" fold contains=@elixirStringContained,elixirRegexEscapePunctuation
syn region elixirSigil matchgroup=elixirDelimiter start="\~\l\[" end="\]" skip="\\\\\|\\\]" fold contains=@elixirStringContained,elixirRegexEscapePunctuation syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l\[" end="\]" skip="\\\\\|\\\]" fold contains=@elixirStringContained,elixirRegexEscapePunctuation
syn region elixirSigil matchgroup=elixirDelimiter start="\~\l(" end=")" skip="\\\\\|\\)" fold contains=@elixirStringContained,elixirRegexEscapePunctuation syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l(" end=")" skip="\\\\\|\\)" fold contains=@elixirStringContained,elixirRegexEscapePunctuation
" Sigils surrounded with docString " Sigils surrounded with docString
syn region elixirSigil matchgroup=elixirDelimiter start=+\~\a\z("""\)+ end=+^\s*\zs\z1+ skip=+\\"+ fold syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z("""\)+ end=+^\s*\zs\z1+ skip=+\\"+ fold
syn region elixirSigil matchgroup=elixirDelimiter start=+\~\a\z('''\)+ end=+^\s*\zs\z1+ skip=+\\'+ fold syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z('''\)+ end=+^\s*\zs\z1+ skip=+\\'+ fold
" Defines " Defines
syn keyword elixirDefine def nextgroup=elixirFunctionDeclaration skipwhite skipnl syn keyword elixirDefine def nextgroup=elixirFunctionDeclaration skipwhite skipnl
@@ -160,6 +162,7 @@ hi def link elixirPseudoVariable Constant
hi def link elixirAlias Type hi def link elixirAlias Type
hi def link elixirBoolean Boolean hi def link elixirBoolean Boolean
hi def link elixirVariable Identifier hi def link elixirVariable Identifier
hi def link elixirSelf Identifier
hi def link elixirUnusedVariable Comment hi def link elixirUnusedVariable Comment
hi def link elixirNumber Number hi def link elixirNumber Number
hi def link elixirDocString String hi def link elixirDocString String
@@ -172,4 +175,7 @@ hi def link elixirRegexQuantifier elixirSpecial
hi def link elixirSpecial Special hi def link elixirSpecial Special
hi def link elixirString String hi def link elixirString String
hi def link elixirSigil String hi def link elixirSigil String
hi def link elixirDelimiter Delimiter hi def link elixirStringDelimiter Delimiter
hi def link elixirRegexDelimiter Delimiter
hi def link elixirInterpolationDelimiter Delimiter
hi def link elixirSigilDelimiter Delimiter

View File

@@ -22,7 +22,7 @@ elseif !exists("b:eruby_subtype") && main_syntax == 'eruby'
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
if b:eruby_subtype == '' if b:eruby_subtype == ''
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+$') let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+\%(\ze+\w\+\)\=$')
endif endif
if b:eruby_subtype == 'rhtml' if b:eruby_subtype == 'rhtml'
let b:eruby_subtype = 'html' let b:eruby_subtype = 'html'

View File

@@ -10,7 +10,9 @@
" let OPTION_NAME = 0 " let OPTION_NAME = 0
" in your ~/.vimrc file to disable particular options. You can also write: " in your ~/.vimrc file to disable particular options. You can also write:
" let OPTION_NAME = 1 " let OPTION_NAME = 1
" to enable particular options. At present, all options default to on. " to enable particular options.
" At present, all options default to on, except highlight of:
" functions, methods and structs.
" "
" - go_highlight_array_whitespace_error " - go_highlight_array_whitespace_error
" Highlights white space after "[]". " Highlights white space after "[]".
@@ -29,40 +31,40 @@ if exists("b:current_syntax")
finish finish
endif endif
if !exists("go_highlight_array_whitespace_error") if !exists("g:go_highlight_array_whitespace_error")
let go_highlight_array_whitespace_error = 1 let g:go_highlight_array_whitespace_error = 1
endif endif
if !exists("go_highlight_chan_whitespace_error") if !exists("g:go_highlight_chan_whitespace_error")
let go_highlight_chan_whitespace_error = 1 let g:go_highlight_chan_whitespace_error = 1
endif endif
if !exists("go_highlight_extra_types") if !exists("g:go_highlight_extra_types")
let go_highlight_extra_types = 1 let g:go_highlight_extra_types = 1
endif endif
if !exists("go_highlight_space_tab_error") if !exists("g:go_highlight_space_tab_error")
let go_highlight_space_tab_error = 1 let g:go_highlight_space_tab_error = 1
endif endif
if !exists("go_highlight_trailing_whitespace_error") if !exists("g:go_highlight_trailing_whitespace_error")
let go_highlight_trailing_whitespace_error = 1 let g:go_highlight_trailing_whitespace_error = 1
endif endif
if !exists("go_highlight_operators") if !exists("g:go_highlight_operators")
let go_highlight_operators = 0 let g:go_highlight_operators = 1
endif endif
if !exists("go_highlight_functions") if !exists("g:go_highlight_functions")
let go_highlight_functions = 0 let g:go_highlight_functions = 0
endif endif
if !exists("go_highlight_methods") if !exists("g:go_highlight_methods")
let go_highlight_methods = 0 let g:go_highlight_methods = 0
endif endif
if !exists("go_highlight_structs") if !exists("g:go_highlight_structs")
let go_highlight_structs = 0 let g:go_highlight_structs = 0
endif endif
syn case match syn case match
@@ -107,10 +109,10 @@ 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
syn keyword goBuiltins make new panic print println real recover syn keyword goBuiltins make new panic print println real recover
syn keyword goConstants iota true false nil syn keyword goBoolean iota true false nil
hi def link goBuiltins Keyword hi def link goBuiltins Keyword
hi def link goConstants Keyword hi def link goBoolean Boolean
" Comments; their contents " Comments; their contents
syn keyword goTodo contained TODO FIXME XXX BUG syn keyword goTodo contained TODO FIXME XXX BUG
@@ -141,9 +143,11 @@ hi def link goEscapeError Error
syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
syn region goRawString start=+`+ end=+`+ syn region goRawString start=+`+ end=+`+
syn match goFormatSpecifier /%[#0\-\ \+\*]*[vTtbcdoqxXUeEfgGsp]/ contained containedin=goString
hi def link goString String hi def link goString String
hi def link goRawString String hi def link goRawString String
hi def link goFormatSpecifier goSpecialString
" Characters; their contents " Characters; their contents
syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU
@@ -182,12 +186,12 @@ syn match goImaginary "\<\d\+[Ee][-+]\d\+i\>"
hi def link goImaginary Number hi def link goImaginary Number
" Spaces after "[]" " Spaces after "[]"
if go_highlight_array_whitespace_error != 0 if g:go_highlight_array_whitespace_error != 0
syn match goSpaceError display "\(\[\]\)\@<=\s\+" syn match goSpaceError display "\(\[\]\)\@<=\s\+"
endif endif
" Spacing errors around the 'chan' keyword " Spacing errors around the 'chan' keyword
if go_highlight_chan_whitespace_error != 0 if g:go_highlight_chan_whitespace_error != 0
" receive-only annotation on chan type " receive-only annotation on chan type
syn match goSpaceError display "\(<-\)\@<=\s\+\(chan\>\)\@=" syn match goSpaceError display "\(<-\)\@<=\s\+\(chan\>\)\@="
" send-only annotation on chan type " send-only annotation on chan type
@@ -197,20 +201,20 @@ if go_highlight_chan_whitespace_error != 0
endif endif
" Extra types commonly seen " Extra types commonly seen
if go_highlight_extra_types != 0 if g:go_highlight_extra_types != 0
syn match goExtraType /\<bytes\.\(Buffer\)\>/ syn match goExtraType /\<bytes\.\(Buffer\)\>/
syn match goExtraType /\<io\.\(Reader\|Writer\|ReadWriter\|ReadWriteCloser\)\>/ syn match goExtraType /\<io\.\(Reader\|ReadSeeker\|ReadWriter\|ReadCloser\|ReadWriteCloser\|Writer\|WriteCloser\|Seeker\)\>/
syn match goExtraType /\<reflect\.\(Kind\|Type\|Value\)\>/ syn match goExtraType /\<reflect\.\(Kind\|Type\|Value\)\>/
syn match goExtraType /\<unsafe\.Pointer\>/ syn match goExtraType /\<unsafe\.Pointer\>/
endif endif
" Space-tab error " Space-tab error
if go_highlight_space_tab_error != 0 if g:go_highlight_space_tab_error != 0
syn match goSpaceError display " \+\t"me=e-1 syn match goSpaceError display " \+\t"me=e-1
endif endif
" Trailing white space error " Trailing white space error
if go_highlight_trailing_whitespace_error != 0 if g:go_highlight_trailing_whitespace_error != 0
syn match goSpaceError display excludenl "\s\+$" syn match goSpaceError display excludenl "\s\+$"
endif endif
@@ -227,7 +231,7 @@ hi def link goTodo Todo
" Operators; " Operators;
if go_highlight_operators != 0 if g:go_highlight_operators != 0
syn match goOperator /:=/ syn match goOperator /:=/
syn match goOperator />=/ syn match goOperator />=/
syn match goOperator /<=/ syn match goOperator /<=/
@@ -246,20 +250,20 @@ endif
hi def link goOperator Operator hi def link goOperator Operator
" Functions; " Functions;
if go_highlight_functions != 0 if g:go_highlight_functions != 0
syn match goFunction /\(func\s\+\)\@<=\w\+\((\)\@=/ syn match goFunction /\(func\s\+\)\@<=\w\+\((\)\@=/
syn match goFunction /\()\s\+\)\@<=\w\+\((\)\@=/ syn match goFunction /\()\s\+\)\@<=\w\+\((\)\@=/
endif endif
hi def link goFunction Function hi def link goFunction Function
" Methods; " Methods;
if go_highlight_methods != 0 if g:go_highlight_methods != 0
syn match goMethod /\(\.\)\@<=\w\+\((\)\@=/ syn match goMethod /\(\.\)\@<=\w\+\((\)\@=/
endif endif
hi def link goMethod Type hi def link goMethod Type
" Structs; " Structs;
if go_highlight_structs != 0 if g:go_highlight_structs != 0
syn match goStruct /\(.\)\@<=\w\+\({\)\@=/ syn match goStruct /\(.\)\@<=\w\+\({\)\@=/
syn match goStructDef /\(type\s\+\)\@<=\w\+\(\s\+struct\s\+{\)\@=/ syn match goStructDef /\(type\s\+\)\@<=\w\+\(\s\+struct\s\+{\)\@=/
endif endif

View File

@@ -24,6 +24,7 @@ syn keyword htmlTagName contained header hgroup keygen main mark meter menu nav
syn keyword htmlTagName contained progress ruby rt rp section source summary time track video data syn keyword htmlTagName contained progress ruby rt rp section source summary time track video data
syn keyword htmlTagName contained template content shadow syn keyword htmlTagName contained template content shadow
syn keyword htmlTagName contained wbr bdi syn keyword htmlTagName contained wbr bdi
syn keyword htmlTagName contained picture
" SVG tags " SVG tags
" http://www.w3.org/TR/SVG/ " http://www.w3.org/TR/SVG/
@@ -68,13 +69,15 @@ syn keyword htmlArg contained autoplay preload controls loop poster media kind c
" <form>, <input>, <button> " <form>, <input>, <button>
syn keyword htmlArg contained form autocomplete autofocus list min max step syn keyword htmlArg contained form autocomplete autofocus list min max step
syn keyword htmlArg contained formaction autofocus formenctype formmethod formtarget formnovalidate syn keyword htmlArg contained formaction autofocus formenctype formmethod formtarget formnovalidate
syn keyword htmlArg contained required placeholder syn keyword htmlArg contained required placeholder pattern
" <command>, <details>, <time> " <command>, <details>, <time>
syn keyword htmlArg contained label icon open datetime pubdate syn keyword htmlArg contained label icon open datetime pubdate
" <script> " <script>
syn keyword htmlArg contained async syn keyword htmlArg contained async
" <content> " <content>
syn keyword htmlArg contained select syn keyword htmlArg contained select
" <picture>
syn keyword htmlArg contained srcset sizes
" Custom Data Attributes " Custom Data Attributes
" http://dev.w3.org/html5/spec/elements.html#embedding-custom-non-visible-data " http://dev.w3.org/html5/spec/elements.html#embedding-custom-non-visible-data

View File

@@ -35,6 +35,7 @@ syntax keyword jsOperator delete instanceof typeof void new in
syntax match jsOperator /\(!\||\|&\|+\|-\|<\|>\|=\|%\|\/\|*\|\~\|\^\)/ syntax match jsOperator /\(!\||\|&\|+\|-\|<\|>\|=\|%\|\/\|*\|\~\|\^\)/
syntax keyword jsBooleanTrue true syntax keyword jsBooleanTrue true
syntax keyword jsBooleanFalse false syntax keyword jsBooleanFalse false
syntax keyword jsCommonJS require module exports
"" JavaScript comments "" JavaScript comments
syntax keyword jsCommentTodo TODO FIXME XXX TBD contained syntax keyword jsCommentTodo TODO FIXME XXX TBD contained
@@ -55,15 +56,15 @@ if !exists("javascript_ignore_javaScriptdoc")
syntax region jsDocComment matchgroup=jsComment start="/\*\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold syntax region jsDocComment matchgroup=jsComment start="/\*\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold
" tags containing a param " tags containing a param
syntax match jsDocTags contained "@\(alias\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|file\|fires\|kind\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|throws\|var\|variation\|version\)\>" nextgroup=jsDocParam skipwhite syntax match jsDocTags contained "@\(alias\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|file\|fires\|kind\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" nextgroup=jsDocParam skipwhite
" tags containing type and param " tags containing type and param
syntax match jsDocTags contained "@\(arg\|argument\|param\|property\)\>" nextgroup=jsDocType skipwhite syntax match jsDocTags contained "@\(arg\|argument\|param\|property\)\>" nextgroup=jsDocType skipwhite
" tags containing type but no param " tags containing type but no param
syntax match jsDocTags contained "@\(callback\|enum\|external\|this\|type\|typedef\|return\|returns\)\>" nextgroup=jsDocTypeNoParam skipwhite syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|typedef\|return\|returns\)\>" nextgroup=jsDocTypeNoParam skipwhite
" tags containing references " tags containing references
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" nextgroup=jsDocSeeTag skipwhite syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" nextgroup=jsDocSeeTag skipwhite
" other tags (no extra syntax) " other tags (no extra syntax)
syntax match jsDocTags contained "@\(abstract\|access\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|event\|example\|file[oO]verview\|function\|global\|ignore\|inner\|instance\|license\|method\|mixin\|overview\|private\|protected\|public\|readonly\|since\|static\|todo\|summary\|undocumented\|virtual\)\>" syntax match jsDocTags contained "@\(abstract\|access\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|dict\|event\|example\|file[oO]verview\|final\|function\|global\|ignore\|inheritDoc\|inner\|instance\|interface\|license\|method\|mixin\|nosideeffects\|override\|overview\|preserve\|private\|protected\|public\|readonly\|since\|static\|struct\|todo\|summary\|undocumented\|virtual\)\>"
syntax region jsDocType start="{" end="}" oneline contained nextgroup=jsDocParam skipwhite syntax region jsDocType start="{" end="}" oneline contained nextgroup=jsDocParam skipwhite
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite
@@ -81,9 +82,9 @@ syntax case match
syntax match jsFuncCall /\k\+\%(\s*(\)\@=/ syntax match jsFuncCall /\k\+\%(\s*(\)\@=/
syntax match jsSpecial "\v\\%(0|\\x\x\{2\}\|\\u\x\{4\}\|\c[A-Z]|.)" contained syntax match jsSpecial "\v\\%(0|\\x\x\{2\}\|\\u\x\{4\}\|\c[A-Z]|.)" contained
syntax match jsTemplateVar "\${.\{-}}" contained syntax match jsTemplateVar "\${.\{-}}" contained
syntax region jsStringD start=+"+ skip=+\\\\\|\\$"+ end=+"+ contains=jsSpecial,@htmlPreproc,@Spell syntax region jsStringD start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@htmlPreproc,@Spell
syntax region jsStringS start=+'+ skip=+\\\\\|\\$'+ end=+'+ contains=jsSpecial,@htmlPreproc,@Spell syntax region jsStringS start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@htmlPreproc,@Spell
syntax region jsTemplateString start=+`+ skip=+\\\\\|\\$`+ end=+`+ contains=jsTemplateVar,jsSpecial,@htmlPreproc syntax region jsTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`\|$+ contains=jsTemplateVar,jsSpecial,@htmlPreproc
syntax region jsRegexpCharClass start=+\[+ skip=+\\.+ end=+\]+ contained syntax region jsRegexpCharClass start=+\[+ skip=+\\.+ end=+\]+ contained
syntax match jsRegexpBoundary "\v%(\<@![\^$]|\\[bB])" contained syntax match jsRegexpBoundary "\v%(\<@![\^$]|\\[bB])" contained
syntax match jsRegexpBackRef "\v\\[1-9][0-9]*" contained syntax match jsRegexpBackRef "\v\\[1-9][0-9]*" contained
@@ -91,7 +92,7 @@ syntax match jsRegexpQuantifier "\v\\@<!%([?*+]|\{\d+%(,|,\d+)?})\??" containe
syntax match jsRegexpOr "\v\<@!\|" contained syntax match jsRegexpOr "\v\<@!\|" contained
syntax match jsRegexpMod "\v\(@<=\?[:=!>]" contained syntax match jsRegexpMod "\v\(@<=\?[:=!>]" contained
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
syntax region jsRegexpGroup start="\\\@<!(" end="\\\@<!)" contained contains=jsRegexpCharClass,@jsRegexpSpecial keepend syntax region jsRegexpGroup start="\\\@<!(" skip="\\.\|\[\(\\.\|[^]]\)*\]" end="\\\@<!)" contained contains=jsRegexpCharClass,@jsRegexpSpecial keepend
syntax region jsRegexpString start=+\(\(\(return\|case\)\s\+\)\@<=\|\(\([)\]"']\|\d\|\w\)\s*\)\@<!\)/\(\*\|/\)\@!+ skip=+\\.\|\[\(\\.\|[^]]\)*\]+ end=+/[gimy]\{,4}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial,@htmlPreproc oneline keepend syntax region jsRegexpString start=+\(\(\(return\|case\)\s\+\)\@<=\|\(\([)\]"']\|\d\|\w\)\s*\)\@<!\)/\(\*\|/\)\@!+ skip=+\\.\|\[\(\\.\|[^]]\)*\]+ end=+/[gimy]\{,4}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial,@htmlPreproc oneline keepend
syntax match jsNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/ syntax match jsNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
syntax keyword jsNumber Infinity syntax keyword jsNumber Infinity
@@ -99,28 +100,19 @@ syntax match jsFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-
syntax match jsObjectKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\(\s*:\)\@=/ contains=jsFunctionKey contained syntax match jsObjectKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\(\s*:\)\@=/ contains=jsFunctionKey contained
syntax match jsFunctionKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\(\s*:\s*function\s*\)\@=/ contained syntax match jsFunctionKey /\<[a-zA-Z_$][0-9a-zA-Z_$]*\(\s*:\s*function\s*\)\@=/ contained
if g:javascript_conceal == 1 exe 'syntax keyword jsNull null '.(exists('g:javascript_conceal_null') ? 'conceal cchar='.g:javascript_conceal_null : '')
syntax keyword jsNull null conceal cchar=ø exe 'syntax keyword jsReturn return '.(exists('g:javascript_conceal_return') ? 'conceal cchar='.g:javascript_conceal_return : '')
syntax keyword jsThis this conceal cchar=@ exe 'syntax keyword jsUndefined undefined '.(exists('g:javascript_conceal_undefined') ? 'conceal cchar='.g:javascript_conceal_undefined : '')
syntax keyword jsReturn return conceal cchar= exe 'syntax keyword jsNan NaN '.(exists('g:javascript_conceal_NaN') ? 'conceal cchar='.g:javascript_conceal_NaN : '')
syntax keyword jsUndefined undefined conceal cchar=¿ exe 'syntax keyword jsPrototype prototype '.(exists('g:javascript_conceal_prototype') ? 'conceal cchar='.g:javascript_conceal_prototype : '')
syntax keyword jsNan NaN conceal cchar= exe 'syntax keyword jsThis this '.(exists('g:javascript_conceal_this') ? 'conceal cchar='.g:javascript_conceal_this : '')
syntax keyword jsPrototype prototype conceal cchar=
else
syntax keyword jsNull null
syntax keyword jsThis this
syntax keyword jsReturn return
syntax keyword jsUndefined undefined
syntax keyword jsNan NaN
syntax keyword jsPrototype prototype
endif
"" Statement Keywords "" Statement Keywords
syntax keyword jsStatement break continue with syntax keyword jsStatement break continue with
syntax keyword jsConditional if else switch syntax keyword jsConditional if else switch
syntax keyword jsRepeat do while for syntax keyword jsRepeat do while for
syntax keyword jsLabel case default syntax keyword jsLabel case default
syntax keyword jsKeyword yield syntax keyword jsKeyword yield import export default extends class
syntax keyword jsException try catch throw finally syntax keyword jsException try catch throw finally
syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object RegExp String Proxy ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray Intl JSON Math console document window syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object RegExp String Proxy ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray Intl JSON Math console document window
@@ -130,7 +122,7 @@ syntax keyword jsExceptions Error EvalError InternalError RangeError Referen
syntax keyword jsBuiltins decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt uneval syntax keyword jsBuiltins decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt uneval
syntax keyword jsFutureKeys abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws goto private transient debugger implements protected volatile double import public syntax keyword jsFutureKeys abstract enum int short boolean interface static byte long super char final native synchronized float package throws goto private transient debugger implements protected volatile double public
"" DOM/HTML/CSS specified things "" DOM/HTML/CSS specified things
@@ -182,7 +174,7 @@ endif "DOM/HTML/CSS
"" Code blocks "" Code blocks
syntax cluster jsExpression contains=jsComment,jsLineComment,jsDocComment,jsTemplateString,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsBlock,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsStorageClass,jsPrototype,jsBuiltins,jsNoise syntax cluster jsExpression contains=jsComment,jsLineComment,jsDocComment,jsTemplateString,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsBlock,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsStorageClass,jsPrototype,jsBuiltins,jsNoise,jsCommonJS
syntax cluster jsAll contains=@jsExpression,jsLabel,jsConditional,jsRepeat,jsReturn,jsStatement,jsTernaryIf,jsException syntax cluster jsAll contains=@jsExpression,jsLabel,jsConditional,jsRepeat,jsReturn,jsStatement,jsTernaryIf,jsException
syntax region jsBracket matchgroup=jsBrackets start="\[" end="\]" contains=@jsAll,jsParensErrB,jsParensErrC,jsBracket,jsParen,jsBlock,@htmlPreproc fold syntax region jsBracket matchgroup=jsBrackets start="\[" end="\]" contains=@jsAll,jsParensErrB,jsParensErrC,jsBracket,jsParen,jsBlock,@htmlPreproc fold
syntax region jsParen matchgroup=jsParens start="(" end=")" contains=@jsAll,jsParensErrA,jsParensErrC,jsParen,jsBracket,jsBlock,@htmlPreproc fold syntax region jsParen matchgroup=jsParens start="(" end=")" contains=@jsAll,jsParensErrA,jsParensErrC,jsParen,jsBracket,jsBlock,@htmlPreproc fold
@@ -202,11 +194,7 @@ if main_syntax == "javascript"
syntax sync match jsHighlight grouphere jsBlock /{/ syntax sync match jsHighlight grouphere jsBlock /{/
endif endif
if g:javascript_conceal == 1 exe 'syntax match jsFunction /\<function\>/ nextgroup=jsFuncName,jsFuncArgs skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '')
syntax match jsFunction /\<function\>/ nextgroup=jsFuncName,jsFuncArgs skipwhite conceal cchar=ƒ
else
syntax match jsFunction /\<function\>/ nextgroup=jsFuncName,jsFuncArgs skipwhite
endif
syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=jsFuncArgs skipwhite syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=jsFuncArgs skipwhite
syntax region jsFuncArgs contained matchgroup=jsFuncParens start='(' end=')' contains=jsFuncArgCommas,jsFuncArgRest nextgroup=jsFuncBlock keepend skipwhite skipempty syntax region jsFuncArgs contained matchgroup=jsFuncParens start='(' end=')' contains=jsFuncArgCommas,jsFuncArgRest nextgroup=jsFuncBlock keepend skipwhite skipempty
@@ -291,6 +279,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink jsExceptions Special HiLink jsExceptions Special
HiLink jsFutureKeys Special HiLink jsFutureKeys Special
HiLink jsBuiltins Special HiLink jsBuiltins Special
HiLink jsCommonJS Include
HiLink jsDomErrNo Constant HiLink jsDomErrNo Constant
HiLink jsDomNodeConsts Constant HiLink jsDomNodeConsts Constant

View File

@@ -50,8 +50,8 @@ syntax match mustacheHandlebars '{{\|}}' contained containedin=mustacheInside,@h
syntax match mustacheUnescape '{{{\|}}}' contained containedin=mustacheInside,@htmlMustacheContainer syntax match mustacheUnescape '{{{\|}}}' contained containedin=mustacheInside,@htmlMustacheContainer
syntax match mustacheConditionals '\([/#]\(if\|unless\)\|else\)' contained containedin=mustacheInside syntax match mustacheConditionals '\([/#]\(if\|unless\)\|else\)' contained containedin=mustacheInside
syntax match mustacheHelpers '[/#]\(with\|each\)' contained containedin=mustacheSection syntax match mustacheHelpers '[/#]\(with\|each\)' contained containedin=mustacheSection
syntax region mustacheComment start=/{{!/rs=s+2 end=/}}/re=e-2 contains=Todo contained containedin=mustacheInside,@htmlMustacheContainer syntax region mustacheComment start=/{{!/rs=s+2 skip=/{{.\{-}}}/ end=/}}/re=e-2 contains=Todo contained containedin=mustacheInside,@htmlMustacheContainer
syntax region mustacheBlockComment start=/{{!--/rs=s+2 end=/--}}/re=e-2 contains=Todo syntax region mustacheBlockComment start=/{{!--/rs=s+2 skip=/{{.\{-}}}/ end=/--}}/re=e-2 contains=Todo contained extend containedin=mustacheInside,@htmlMustacheContainer
syntax region mustacheQString start=/'/ skip=/\\'/ end=/'/ contained containedin=mustacheInside syntax region mustacheQString start=/'/ skip=/\\'/ end=/'/ contained containedin=mustacheInside
syntax region mustacheDQString start=/"/ skip=/\\"/ end=/"/ contained containedin=mustacheInside syntax region mustacheDQString start=/"/ skip=/\\"/ end=/"/ contained containedin=mustacheInside

View File

@@ -56,15 +56,15 @@ syn keyword clType cl_image_format
syn keyword clCast vec_type_hint work_group_size_hint aligned packed endian syn keyword clCast vec_type_hint work_group_size_hint aligned packed endian
syn match clCast "as_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\)(" syn match clCast "as_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\)"
syn match clCast "as_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\)\(2\|3\|4\|8\|16\)(" syn match clCast "as_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\)\(2\|3\|4\|8\|16\)"
syn match clCast "convert_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\))\(2\|3\|4\|8\|16\)(" syn match clCast "convert_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\))\(2\|3\|4\|8\|16\)"
syn match clCast "convert_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\))\(2\|3\|4\|8\|16\)_sat(" syn match clCast "convert_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\))\(2\|3\|4\|8\|16\)_sat"
syn match clCast "convert_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\))\(2\|3\|4\|8\|16\)_sat_\(rte\|rtz\|rtp\|rtn\)(" syn match clCast "convert_\(uchar\|char\|ushort\|short\|uint\|int\|ulong\|long\|float\|double\))\(2\|3\|4\|8\|16\)_sat_\(rte\|rtz\|rtp\|rtn\)"
" work item functions " work item functions
syn keyword clFunction get_work_dim get_global_size get_global_id get_local_size get_local_id get_num_groups get_group_id get_global_offset syn keyword clFunction get_work_dim get_global_size get_global_id get_local_size get_local_id get_num_groups get_group_id get_global_offset
@@ -105,21 +105,21 @@ syn keyword clFunction isequal isnotequal isgreater isgreaterequal isle
" vector data load and store functions " vector data load and store functions
syn keyword clFunction vload_half vstore_half syn keyword clFunction vload_half vstore_half
syn match clFunction "vload\(2\|3\|4\|8\|16\)(" syn match clFunction "vload\(2\|3\|4\|8\|16\)"
syn match clFunction "vload_half\(2\|3\|4\|8\|16\)(" syn match clFunction "vload_half\(2\|3\|4\|8\|16\)"
syn match clFunction "vloada_half\(2\|3\|4\|8\|16\)(" syn match clFunction "vloada_half\(2\|3\|4\|8\|16\)"
syn match clFunction "vloada_half\(2\|3\|4\|8\|16\)_\(rte\|rtz\|rtp\)(" syn match clFunction "vloada_half\(2\|3\|4\|8\|16\)_\(rte\|rtz\|rtp\)"
syn match clFunction "vstore\(2\|3\|4\|8\|16\)(" syn match clFunction "vstore\(2\|3\|4\|8\|16\)"
syn match clFunction "vstore\(rte\|rtz\|rtp\|rtn\)(" syn match clFunction "vstore\(rte\|rtz\|rtp\|rtn\)"
syn match clFunction "vstore_half\(2\|3\|4\|8\|16\)(" syn match clFunction "vstore_half\(2\|3\|4\|8\|16\)"
syn match clFunction "vstore_half_\(rte\|rtz\|rtp\|rtn\)(" syn match clFunction "vstore_half_\(rte\|rtz\|rtp\|rtn\)"
syn match clFunction "vstore_half\(2\|3\|4\|8\|16\)_\(rte\|rtz\|rtp\|rtn\)(" syn match clFunction "vstore_half\(2\|3\|4\|8\|16\)_\(rte\|rtz\|rtp\|rtn\)"
syn match clFunction "vstorea_half\(2\|3\|4\|8\|16\)(" syn match clFunction "vstorea_half\(2\|3\|4\|8\|16\)"
syn match clFunction "vstorea_half\(2\|3\|4\|8\|16\)_\(rte\|rtz\|rtp\|rtn\)(" syn match clFunction "vstorea_half\(2\|3\|4\|8\|16\)_\(rte\|rtz\|rtp\|rtn\)"
" image read and write functions " image read and write functions
syn match clFunction "read_image\(f\|i\|ui\|h\)(" syn match clFunction "read_image\(f\|i\|ui\|h\)"
syn match clFunction "write_image\(f\|i\|ui\|h\)(" syn match clFunction "write_image\(f\|i\|ui\|h\)"
syn keyword clFunction get_image_width get_image_height get_image_depth get_image_channel_data_type get_image_channel_order get_image_dim syn keyword clFunction get_image_width get_image_height get_image_depth get_image_channel_data_type get_image_channel_order get_image_dim
" explicit memory fence functions " explicit memory fence functions
@@ -129,7 +129,7 @@ syn keyword clFunction barrier mem_fence read_mem_fence write_mem_fence
syn keyword clFunction async_work_group_copy async_work_group__strided_copy wait_group_events prefetch syn keyword clFunction async_work_group_copy async_work_group__strided_copy wait_group_events prefetch
" atomic functions " atomic functions
syn match clFunction "atom_\(add\|sub\|xchg\|inc\|dec\|cmpxchg\|min\|max\|and\|or\|xor\)(" syn match clFunction "atom_\(add\|sub\|xchg\|inc\|dec\|cmpxchg\|min\|max\|and\|or\|xor\)"
syn keyword clConstant MAXFLOAT HUGE_VALF INFINITY NAN syn keyword clConstant MAXFLOAT HUGE_VALF INFINITY NAN
syn keyword clConstant FLT_DIG FLT_MANT_DIG FLT_MAX_10_EXP FLT_MAX_EXP FLT_MIN_10_EXP FLT_MIN_EXP FLT_RADIX FLT_MAX FLT_MIN FLT_EPSILON syn keyword clConstant FLT_DIG FLT_MANT_DIG FLT_MAX_10_EXP FLT_MAX_EXP FLT_MIN_10_EXP FLT_MIN_EXP FLT_RADIX FLT_MAX FLT_MIN FLT_EPSILON

View File

@@ -3,7 +3,7 @@
" "
" {{{ BLOCK: Last-modified " {{{ BLOCK: Last-modified
" Thu, 14 Aug 2014 09:05:56 +0000, PHP 5.6.0RC2 " Thu, 18 Sep 2014 08:32:15 +0000, PHP 5.6.0-1+deb.sury.org~trusty+1
" }}} " }}}
" "
@@ -46,6 +46,8 @@
" php_folding = 1 for folding loops, if/elseif/else, switch, try/catch, classes, and functions based on " 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. " indent, finds a } with an indent matching the structure.
" 2 for folding all { }, ( ), and [ ] pairs. (see known bugs ii) " 2 for folding all { }, ( ), and [ ] pairs. (see known bugs ii)
" php_phpdoc_folding = 0 Don't fold phpDoc comments (default)
" 1 Fold phpDoc comments
" 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
@@ -150,6 +152,11 @@ if !exists("php_folding")
let php_folding = 0 let php_folding = 0
endif endif
" set default for php_phpdoc_folding so we don't have to keep checking its existence.
if !exists("php_phpdoc_folding")
let php_phpdoc_folding = 0
endif
" Folding Support {{{ " Folding Support {{{
" "
if php_folding==1 && has("folding") if php_folding==1 && has("folding")
@@ -158,6 +165,12 @@ else
command! -nargs=+ SynFold <args> command! -nargs=+ SynFold <args>
endif endif
if php_phpdoc_folding==1 && has("folding")
command! -nargs=+ SynFoldDoc <args> fold
else
command! -nargs=+ SynFoldDoc <args>
endif
" }}} " }}}
syn case match syn case match
@@ -246,7 +259,7 @@ syn keyword phpConstants ATTR_AUTOCOMMIT ATTR_CASE ATTR_CLIENT_VERSION ATTR_CONN
endif endif
if index(g:php_syntax_extensions_enabled, "pgsql") >= 0 && index(g:php_syntax_extensions_disabled, "pgsql") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "pgsql") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "pgsql") < 0) if index(g:php_syntax_extensions_enabled, "pgsql") >= 0 && index(g:php_syntax_extensions_disabled, "pgsql") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "pgsql") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "pgsql") < 0)
" pgsql constants " pgsql constants
syn keyword phpConstants PGSQL_ASSOC PGSQL_BAD_RESPONSE PGSQL_BOTH PGSQL_COMMAND_OK PGSQL_CONNECTION_AUTH_OK PGSQL_CONNECTION_AWAITING_RESPONSE PGSQL_CONNECTION_BAD PGSQL_CONNECTION_MADE PGSQL_CONNECTION_OK PGSQL_CONNECTION_SETENV PGSQL_CONNECTION_SSL_STARTUP PGSQL_CONNECTION_STARTED PGSQL_CONNECT_ASYNC PGSQL_CONNECT_FORCE_NEW PGSQL_CONV_FORCE_NULL PGSQL_CONV_IGNORE_DEFAULT PGSQL_CONV_IGNORE_NOT_NULL PGSQL_COPY_IN PGSQL_COPY_OUT PGSQL_DIAG_CONTEXT PGSQL_DIAG_INTERNAL_POSITION PGSQL_DIAG_INTERNAL_QUERY PGSQL_DIAG_MESSAGE_DETAIL PGSQL_DIAG_MESSAGE_HINT PGSQL_DIAG_MESSAGE_PRIMARY PGSQL_DIAG_SEVERITY PGSQL_DIAG_SOURCE_FILE PGSQL_DIAG_SOURCE_FUNCTION PGSQL_DIAG_SOURCE_LINE PGSQL_DIAG_SQLSTATE PGSQL_DIAG_STATEMENT_POSITION PGSQL_DML_ASYNC PGSQL_DML_ESCAPE PGSQL_DML_EXEC PGSQL_DML_NO_CONV PGSQL_DML_STRING PGSQL_EMPTY_QUERY PGSQL_ERRORS_DEFAULT PGSQL_ERRORS_TERSE PGSQL_ERRORS_VERBOSE PGSQL_FATAL_ERROR PGSQL_LIBPQ_VERSION PGSQL_LIBPQ_VERSION_STR PGSQL_NONFATAL_ERROR PGSQL_NUM PGSQL_POLLING_ACTIVE PGSQL_POLLING_FAILED PGSQL_POLLING_OK PGSQL_POLLING_READING PGSQL_POLLING_WRITING PGSQL_SEEK_CUR PGSQL_SEEK_END PGSQL_SEEK_SET PGSQL_STATUS_LONG PGSQL_STATUS_STRING PGSQL_TRANSACTION_ACTIVE PGSQL_TRANSACTION_IDLE PGSQL_TRANSACTION_INERROR PGSQL_TRANSACTION_INTRANS PGSQL_TRANSACTION_UNKNOWN PGSQL_TUPLES_OK contained syn keyword phpConstants PGSQL_ASSOC PGSQL_BAD_RESPONSE PGSQL_BOTH PGSQL_COMMAND_OK PGSQL_CONNECTION_AUTH_OK PGSQL_CONNECTION_AWAITING_RESPONSE PGSQL_CONNECTION_BAD PGSQL_CONNECTION_MADE PGSQL_CONNECTION_OK PGSQL_CONNECTION_SETENV PGSQL_CONNECTION_STARTED PGSQL_CONNECT_ASYNC PGSQL_CONNECT_FORCE_NEW PGSQL_CONV_FORCE_NULL PGSQL_CONV_IGNORE_DEFAULT PGSQL_CONV_IGNORE_NOT_NULL PGSQL_COPY_IN PGSQL_COPY_OUT PGSQL_DIAG_CONTEXT PGSQL_DIAG_INTERNAL_POSITION PGSQL_DIAG_INTERNAL_QUERY PGSQL_DIAG_MESSAGE_DETAIL PGSQL_DIAG_MESSAGE_HINT PGSQL_DIAG_MESSAGE_PRIMARY PGSQL_DIAG_SEVERITY PGSQL_DIAG_SOURCE_FILE PGSQL_DIAG_SOURCE_FUNCTION PGSQL_DIAG_SOURCE_LINE PGSQL_DIAG_SQLSTATE PGSQL_DIAG_STATEMENT_POSITION PGSQL_DML_ASYNC PGSQL_DML_ESCAPE PGSQL_DML_EXEC PGSQL_DML_NO_CONV PGSQL_DML_STRING PGSQL_EMPTY_QUERY PGSQL_ERRORS_DEFAULT PGSQL_ERRORS_TERSE PGSQL_ERRORS_VERBOSE PGSQL_FATAL_ERROR PGSQL_LIBPQ_VERSION PGSQL_LIBPQ_VERSION_STR PGSQL_NONFATAL_ERROR PGSQL_NUM PGSQL_POLLING_ACTIVE PGSQL_POLLING_FAILED PGSQL_POLLING_OK PGSQL_POLLING_READING PGSQL_POLLING_WRITING PGSQL_SEEK_CUR PGSQL_SEEK_END PGSQL_SEEK_SET PGSQL_STATUS_LONG PGSQL_STATUS_STRING PGSQL_TRANSACTION_ACTIVE PGSQL_TRANSACTION_IDLE PGSQL_TRANSACTION_INERROR PGSQL_TRANSACTION_INTRANS PGSQL_TRANSACTION_UNKNOWN PGSQL_TUPLES_OK contained
endif endif
if index(g:php_syntax_extensions_enabled, "phar") >= 0 && index(g:php_syntax_extensions_disabled, "phar") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "phar") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "phar") < 0) if index(g:php_syntax_extensions_enabled, "phar") >= 0 && index(g:php_syntax_extensions_disabled, "phar") < 0 && ( ! exists("b:php_syntax_extensions_enabled") || index(b:php_syntax_extensions_enabled, "phar") >= 0) && ( ! exists("b:php_syntax_extensions_disabled") || index(b:php_syntax_extensions_disabled, "phar") < 0)
" Phar constants " Phar constants
@@ -582,7 +595,7 @@ syn match phpCommentStar contained "^\s*\*$"
if !exists("php_ignore_phpdoc") || !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 SynFoldDoc 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
@@ -818,6 +831,7 @@ endif
" Cleanup: {{{ " Cleanup: {{{
delcommand SynFold delcommand SynFold
delcommand SynFoldDoc
let b:current_syntax = "php" let b:current_syntax = "php"
let &iskeyword = s:iskeyword_save let &iskeyword = s:iskeyword_save

View File

@@ -17,7 +17,7 @@ syn keyword rustConditional match if else
syn keyword rustOperator as syn keyword rustOperator as
syn match rustAssert "\<assert\(\w\)*!" contained syn match rustAssert "\<assert\(\w\)*!" contained
syn match rustFail "\<fail\(\w\)*!" contained syn match rustPanic "\<panic\(\w\)*!" contained
syn keyword rustKeyword break syn keyword rustKeyword break
syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty
syn keyword rustKeyword continue syn keyword rustKeyword continue
@@ -27,14 +27,16 @@ 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 where while syn keyword rustKeyword unsafe virtual where while
syn keyword rustKeyword use nextgroup=rustModPath,rustModPathInUse skipwhite skipempty syn keyword rustKeyword use nextgroup=rustModPath 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 const syn keyword rustStorage move mut ref static const
syn keyword rustInvalidBareKeyword crate syn keyword rustInvalidBareKeyword crate
syn keyword rustExternCrate crate contained nextgroup=rustIdentifier skipwhite skipempty syn keyword rustExternCrate crate contained nextgroup=rustIdentifier,rustExternCrateString skipwhite skipempty
" This is to get the `bar` part of `extern crate "foo" as bar;` highlighting.
syn match rustExternCrateString /".*"\_s*as/ contained nextgroup=rustIdentifier skipwhite transparent skipempty contains=rustString,rustOperator
syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipwhite skipempty syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipwhite skipempty
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
@@ -54,7 +56,7 @@ syn match rustMacroRepeatCount ".\?[*+]" contained
syn match rustMacroVariable "$\w\+" 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 abstract final override
" Built-in types {{{2 " Built-in types {{{2
syn keyword rustType int uint float char bool u8 u16 u32 u64 f32 syn keyword rustType int uint float char bool u8 u16 u32 u64 f32
@@ -64,76 +66,68 @@ syn keyword rustType f64 i8 i16 i32 i64 str Self
" This section is just straight transformation of the contents of the prelude, " This section is just straight transformation of the contents of the prelude,
" to make it easy to update. " to make it easy to update.
" Core operators {{{3 " Reexported core operators {{{3
syn keyword rustTrait Copy Send Sized Sync 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 IndexMut syn keyword rustTrait Shl Shr
syn keyword rustEnum Option syn keyword rustTrait Index IndexMut
syn keyword rustEnumVariant Some None syn keyword rustTrait Slice SliceMut
syn keyword rustEnum Result syn keyword rustTrait Fn FnMut FnOnce
syn keyword rustEnumVariant Ok Err
" Functions {{{3 " Reexported functions {{{3
"syn keyword rustFunction from_str "syn keyword rustFunction range repeat
"syn keyword rustFunction range
"syn keyword rustFunction drop "syn keyword rustFunction drop
"syn keyword rustFunction from_str
" Types and traits {{{3 " Reexported types and traits {{{3
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr
syn keyword rustTrait IntoBytes syn keyword rustTrait IntoBytes
syn keyword rustTrait ToCStr syn keyword rustTrait ToCStr
syn keyword rustTrait Char UnicodeChar syn keyword rustTrait Char UnicodeChar
syn keyword rustTrait Clone syn keyword rustTrait Clone
syn keyword rustTrait PartialEq PartialOrd Eq Ord Equiv syn keyword rustTrait PartialEq PartialOrd Eq Ord
syn keyword rustEnum Ordering syn keyword rustEnum Ordering Equiv
syn keyword rustEnumVariant Less Equal Greater syn keyword rustEnumVariant Less Equal Greater
syn keyword rustTrait Collection Mutable Map MutableMap MutableSeq syn keyword rustTrait FromIterator Extend ExactSize
syn keyword rustTrait Set MutableSet
syn keyword rustTrait FromIterator Extendable ExactSize
syn keyword rustTrait Iterator DoubleEndedIterator syn keyword rustTrait Iterator DoubleEndedIterator
syn keyword rustTrait RandomAccessIterator CloneableIterator syn keyword rustTrait RandomAccessIterator CloneableIterator
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator syn keyword rustTrait OrdIterator MutableDoubleEndedIterator
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul CheckedDiv syn keyword rustTrait ToPrimitive FromPrimitive
syn keyword rustTrait Signed Unsigned Primitive Int Float
syn keyword rustTrait FloatMath ToPrimitive FromPrimitive
syn keyword rustTrait Box syn keyword rustTrait Box
syn keyword rustEnum Option
syn keyword rustEnumVariant Some None
syn keyword rustTrait GenericPath Path PosixPath WindowsPath syn keyword rustTrait GenericPath Path PosixPath WindowsPath
syn keyword rustTrait RawPtr syn keyword rustTrait RawPtr RawMutPtr
syn keyword rustTrait Buffer Writer Reader Seek syn keyword rustEnum Result
syn keyword rustTrait Str StrVector StrSlice syn keyword rustEnumVariant Ok Err
syn keyword rustTrait IntoMaybeOwned StrAllocating UnicodeStrSlice syn keyword rustTrait Buffer Writer Reader Seek BufferPrelude
syn keyword rustTrait ToString IntoStr syn keyword rustTrait Str StrVector StrPrelude
syn keyword rustTrait IntoMaybeOwned StrAllocating UnicodeStrPrelude
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 syn keyword rustTrait SlicePrelude AsSlice CloneSlicePrelude
syn keyword rustTrait MutableCloneableSlice MutableOrdSlice syn keyword rustTrait VectorVector PartialEqSlicePrelude OrdSlicePrelude
syn keyword rustTrait ImmutableSlice MutableSlice syn keyword rustTrait CloneSliceAllocPrelude OrdSliceAllocPrelude SliceAllocPrelude
syn keyword rustTrait ImmutablePartialEqSlice ImmutableOrdSlice syn keyword rustTrait IntoString String ToString
syn keyword rustTrait Slice VectorVector
syn keyword rustTrait MutableSliceAllocating
syn keyword rustTrait String
syn keyword rustTrait Vec syn keyword rustTrait Vec
" Reexported runtime types {{{3
"syn keyword rustFunction sync_channel channel "syn keyword rustFunction sync_channel channel
syn keyword rustTrait SyncSender Sender Receiver syn keyword rustTrait SyncSender Sender Receiver
"syn keyword rustFunction spawn "syn keyword rustFunction spawn
"syn keyword rustConstant GC " Other syntax {{{2
syn keyword rustSelf self syn keyword rustSelf self
syn keyword rustBoolean true false syn keyword rustBoolean true false
" Other syntax {{{2
" 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 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>();
@@ -151,8 +145,8 @@ syn match rustSigil display /[&~@*][^)= \t\r\n]/he=e-1,me=e-1
" Last, because the & in && isn't a sigil " Last, because the & in && isn't a sigil
syn match rustOperator display "&&\|||" syn match rustOperator display "&&\|||"
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustFail syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustPanic
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustFail syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustPanic
syn match rustEscapeError display contained /\\./ syn match rustEscapeError display contained /\\./
syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/ syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/
@@ -172,9 +166,10 @@ syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(8\|16\|32\|64\)\=\)
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\=" syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
" Special case for numbers of the form "1." which are float literals, unless followed by " Special case for numbers of the form "1." which are float literals, unless followed by
" an identifier, which makes them integer literals with a method call or field access. " an identifier, which makes them integer literals with a method call or field access,
" or by another ".", which makes them integer literals followed by the ".." token.
" (This must go first so the others take precedence.) " (This must go first so the others take precedence.)
syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\@!" syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\|\.\)\@!"
" To mark a number as a normal float, it must have at least one of the three things integral values don't have: " To mark a number as a normal float, it must have at least one of the three things integral values don't have:
" a decimal point and more numbers; an exponent; and a type suffix. " a decimal point and more numbers; an exponent; and a type suffix.
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\=" syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\="
@@ -216,7 +211,7 @@ syn keyword rustTodo contained TODO FIXME XXX NB NOTE
" Folding rules {{{2 " Folding rules {{{2
" Trivial folding rules to begin with. " Trivial folding rules to begin with.
" TODO: use the AST to make really good folding " FIXME: use the AST to make really good folding
syn region rustFoldBraces start="{" end="}" transparent fold syn region rustFoldBraces start="{" end="}" transparent fold
" Default highlighting {{{1 " Default highlighting {{{1
@@ -252,7 +247,6 @@ 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
@@ -263,7 +257,7 @@ hi def link rustCommentLineDoc SpecialComment
hi def link rustCommentBlock rustCommentLine hi def link rustCommentBlock rustCommentLine
hi def link rustCommentBlockDoc rustCommentLineDoc hi def link rustCommentBlockDoc rustCommentLineDoc
hi def link rustAssert PreCondit hi def link rustAssert PreCondit
hi def link rustFail PreCondit hi def link rustPanic PreCondit
hi def link rustMacro Macro hi def link rustMacro Macro
hi def link rustType Type hi def link rustType Type
hi def link rustTodo Todo hi def link rustTodo Todo
@@ -282,7 +276,7 @@ hi def link rustBoxPlacementExpr rustKeyword
" hi rustAttribute ctermfg=cyan " hi rustAttribute ctermfg=cyan
" hi rustDeriving ctermfg=cyan " hi rustDeriving ctermfg=cyan
" hi rustAssert ctermfg=yellow " hi rustAssert ctermfg=yellow
" hi rustFail ctermfg=red " hi rustPanic ctermfg=red
" hi rustMacro ctermfg=magenta " hi rustMacro ctermfg=magenta
syn sync minlines=200 syn sync minlines=200

View File

@@ -46,6 +46,7 @@ syn match sdUnitKey contained /^Documentation=/ nextgroup=sdDocURI
syn match sdUnitKey contained /^SourcePath=/ nextgroup=sdFilename,sdErr syn match sdUnitKey contained /^SourcePath=/ nextgroup=sdFilename,sdErr
syn match sdUnitKey contained /^\%(Requires\|RequiresOverridable\|Requisite\|RequisiteOverridable\|Wants\|BindsTo\|PartOf\|Conflicts\|Before\|After\|OnFailure\|Names|PropagatesReloadTo\|ReloadPropagatedFrom\)=/ nextgroup=sdUnitList syn match sdUnitKey contained /^\%(Requires\|RequiresOverridable\|Requisite\|RequisiteOverridable\|Wants\|BindsTo\|PartOf\|Conflicts\|Before\|After\|OnFailure\|Names|PropagatesReloadTo\|ReloadPropagatedFrom\)=/ nextgroup=sdUnitList
syn match sdUnitKey contained /^\%(OnFailureIsolate\|IgnoreOnIsolate\|IgnoreOnSnapshot\|StopWhenUnneeded\|RefuseManualStart\|RefuseManualStop\|AllowIsolate\|DefaultDependencies\)=/ nextgroup=sdBool,sdErr syn match sdUnitKey contained /^\%(OnFailureIsolate\|IgnoreOnIsolate\|IgnoreOnSnapshot\|StopWhenUnneeded\|RefuseManualStart\|RefuseManualStop\|AllowIsolate\|DefaultDependencies\)=/ nextgroup=sdBool,sdErr
syn match sdUnitKey contained /^OnFailureJobMode=/ nextgroup=sdFailJobMode,sdErr
syn match sdUnitKey contained /^JobTimeoutSec=/ nextgroup=sdDuration,sdErr syn match sdUnitKey contained /^JobTimeoutSec=/ nextgroup=sdDuration,sdErr
" ConditionXXX. Note that they all have an optional '|' after the '=' " ConditionXXX. Note that they all have an optional '|' after the '='
syn match sdUnitKey contained /^Condition\(PathExists\|PathExistsGlob\|PathIsDirectory\|PathIsMountPoint\|PathIsReadWrite\|PathIsSymbolicLink\|DirectoryNotEmpty\|FileNotEmpty\|FileIsExecutable\)=|\=!\=/ contains=sdConditionFlag nextgroup=sdFilename,sdErr syn match sdUnitKey contained /^Condition\(PathExists\|PathExistsGlob\|PathIsDirectory\|PathIsMountPoint\|PathIsReadWrite\|PathIsSymbolicLink\|DirectoryNotEmpty\|FileNotEmpty\|FileIsExecutable\)=|\=!\=/ contains=sdConditionFlag nextgroup=sdFilename,sdErr
@@ -59,6 +60,7 @@ syn match sdUnitList contained /.*/ contains=sdUnitName,sdErr
syn match sdConditionFlag contained /[!|]/ syn match sdConditionFlag contained /[!|]/
syn keyword sdVirtType contained nextgroup=sdErr vm container qemu kvm vmware microsoft oracle xen bochs chroot openvz lxc lxc-libvirt systemd-nspawn syn keyword sdVirtType contained nextgroup=sdErr vm container qemu kvm vmware microsoft oracle xen bochs chroot openvz lxc lxc-libvirt systemd-nspawn
syn keyword sdSecurityType contained nextgroup=sdErr selinux syn keyword sdSecurityType contained nextgroup=sdErr selinux
syn keyword sdFailJobMode contained nextgroup=sderr fail replace replace-irreversibly
syn match sdDocUri contained /\%(https\=:\/\/\|file:\|info:\|man:\)\S\+\s*/ nextgroup=sdDocUri,sdErr syn match sdDocUri contained /\%(https\=:\/\/\|file:\|info:\|man:\)\S\+\s*/ nextgroup=sdDocUri,sdErr
" [Install] {{{1 " [Install] {{{1
@@ -94,6 +96,7 @@ syn match sdExecKey contained /^IOSchedulingClass=/ nextgroup=sdIOSchedClass,sdE
syn match sdExecKey contained /^IOSchedulingPriority=/ nextgroup=sdIOSchedPrio,sdErr syn match sdExecKey contained /^IOSchedulingPriority=/ nextgroup=sdIOSchedPrio,sdErr
syn match sdExecKey contained /^CPUSchedulingPolicy=/ nextgroup=sdCPUSchedPol,sdErr syn match sdExecKey contained /^CPUSchedulingPolicy=/ nextgroup=sdCPUSchedPol,sdErr
syn match sdExecKey contained /^MountFlags=/ nextgroup=sdMountFlags,sdErr syn match sdExecKey contained /^MountFlags=/ nextgroup=sdMountFlags,sdErr
syn match sdExecKey contained /^IgnoreSIGPIPE=/ nextgroup=sdBool,sdErr
syn match sdExecKey contained /^Environment=/ nextgroup=sdEnvDefs syn match sdExecKey contained /^Environment=/ nextgroup=sdEnvDefs
syn match sdExecKey contained /^EnvironmentFile=-\=/ contains=sdEnvDashFlag nextgroup=sdFilename,sdErr syn match sdExecKey contained /^EnvironmentFile=-\=/ contains=sdEnvDashFlag nextgroup=sdFilename,sdErr
@@ -248,6 +251,7 @@ hi def link sdSecurityType sdValue
hi def link sdSecureBits sdValue hi def link sdSecureBits sdValue
hi def link sdMountFlags sdValue hi def link sdMountFlags sdValue
hi def link sdKillMode sdValue hi def link sdKillMode sdValue
hi def link sdFailJobMode sdValue
hi def link sdRestartType sdValue hi def link sdRestartType sdValue
hi def link sdSignal sdValue hi def link sdSignal sdValue
hi def link sdStdin sdValue hi def link sdStdin sdValue

View File

@@ -7,10 +7,22 @@ if exists("b:current_syntax")
finish finish
endif endif
syn match tomlEscape /\\[0tnr"\\]/ display syn match tomlEscape /\\[btnfr"/\\]/ display contained
syn match tomlEscape /\\u\x\{4}/ contained
syn match tomlEscape /\\U\x\{8}/ contained
hi def link tomlEscape SpecialChar hi def link tomlEscape SpecialChar
syn region tomlString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=tomlEscape syn match tomlLineEscape /\\$/ contained
hi def link tomlLineEscape SpecialChar
" Basic strings
syn region tomlString oneline start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=tomlEscape
" Multi-line basic strings
syn region tomlString start=/"""/ end=/"""/ contains=tomlEscape,tomlLineEscape
" Literal strings
syn region tomlString oneline start=/'/ end=/'/
" Multi-line literal strings
syn region tomlString start=/'''/ end=/'''/
hi def link tomlString String hi def link tomlString String
syn match tomlInteger /\<-\?\d\+\>/ display syn match tomlInteger /\<-\?\d\+\>/ display
@@ -25,8 +37,11 @@ hi def link tomlBoolean Boolean
syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}T\d\{2\}:\d\{2\}:\d\{2\}Z/ display syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}T\d\{2\}:\d\{2\}:\d\{2\}Z/ display
hi def link tomlDate Constant hi def link tomlDate Constant
syn match tomlKeyGroup /^\s*\[.\+\]\s*\(#.*\)\?$/ contains=tomlComment syn match tomlTable /^\s*\[[^#\[\]]\+\]\s*\(#.*\)\?$/ contains=tomlComment
hi def link tomlKeyGroup Identifier hi def link tomlTable Identifier
syn match tomlTableArray /^\s*\[\[[^#\[\]]\+\]\]\s*\(#.*\)\?$/ contains=tomlComment
hi def link tomlTableArray Identifier
syn keyword tomlTodo TODO FIXME XXX BUG contained syn keyword tomlTodo TODO FIXME XXX BUG contained
hi def link tomlTodo Todo hi def link tomlTodo Todo

View File

@@ -30,7 +30,7 @@ hi link shebang Comment
"" typeScript comments"{{{ "" typeScript comments"{{{
syn keyword typeScriptCommentTodo TODO FIXME XXX TBD contained syn keyword typeScriptCommentTodo TODO FIXME XXX TBD contained
syn match typeScriptLineComment "\/\/.*" contains=@Spell,typeScriptCommentTodo,typeScriptRef syn match typeScriptLineComment "\/\/.*" contains=@Spell,typeScriptCommentTodo,typeScriptRef
syn match typeScriptRef /\/\/\/\s*<reference\s\+.*\/>$/ contains=typeScriptRefD,typeScriptRefS syn match typeScriptRef /\/\/\/<reference\s\+.*\/>$/ contains=typeScriptRefD,typeScriptRefS
syn region typeScriptRefD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ syn region typeScriptRefD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+
syn region typeScriptRefS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ syn region typeScriptRefS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+
@@ -116,7 +116,7 @@ syntax keyword typeScriptGlobalObjects Array Boolean Date Function Infinity Math
syntax keyword typeScriptExceptions try catch throw finally Error EvalError RangeError ReferenceError SyntaxError TypeError URIError syntax keyword typeScriptExceptions try catch throw finally Error EvalError RangeError ReferenceError SyntaxError TypeError URIError
syntax keyword typeScriptReserved constructor declare as interface module abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public syntax keyword typeScriptReserved constructor declare as interface module abstract enum int short export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public type
"}}} "}}}
"" TypeScript/DOM/HTML/CSS specified things"{{{ "" TypeScript/DOM/HTML/CSS specified things"{{{
@@ -126,7 +126,7 @@ syntax keyword typeScriptReserved constructor declare as interface module abstra
syn match typeScriptParameters "([a-zA-Z0-9_?.$][\w?.$]*)\s*:\s*([a-zA-Z0-9_?.$][\w?.$]*)" contained skipwhite syn match typeScriptParameters "([a-zA-Z0-9_?.$][\w?.$]*)\s*:\s*([a-zA-Z0-9_?.$][\w?.$]*)" contained skipwhite
"}}} "}}}
" DOM2 Objects"{{{ " DOM2 Objects"{{{
syntax keyword typeScriptType DOMImplementation DocumentFragment Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction void any string bool number syntax keyword typeScriptType DOMImplementation DocumentFragment Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction void any string boolean number
syntax keyword typeScriptExceptions DOMException syntax keyword typeScriptExceptions DOMException
"}}} "}}}
" DOM2 CONSTANT"{{{ " DOM2 CONSTANT"{{{
@@ -250,7 +250,7 @@ if version >= 508 || !exists("did_typeScript_syn_inits")
HiLink typeScriptIdentifier Identifier HiLink typeScriptIdentifier Identifier
HiLink typeScriptRepeat Repeat HiLink typeScriptRepeat Repeat
HiLink typeScriptStatement Statement HiLink typeScriptStatement Statement
HiLink typeScriptFuncKeyword Function HiLink typeScriptFuncKeyword Type
HiLink typeScriptMessage Keyword HiLink typeScriptMessage Keyword
HiLink typeScriptDeprecated Exception HiLink typeScriptDeprecated Exception
HiLink typeScriptError Error HiLink typeScriptError Error

11
syntax/vimgo.vim Normal file
View File

@@ -0,0 +1,11 @@
if exists("b:current_syntax")
finish
endif
let b:current_syntax = "vimgo"
syn match goInterface /^\S*/
syn region goTitle start="\%1l" end=":"
hi def link goInterface Type
hi def link goTitle Label