mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-09 12:03:53 -05:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acd7ce5950 | ||
|
|
f24fecc338 | ||
|
|
23913e0598 | ||
|
|
1c21231175 | ||
|
|
4541e98466 | ||
|
|
6cd2d5417d | ||
|
|
b7a30b1f1a | ||
|
|
6745c49110 | ||
|
|
1a97304cf6 | ||
|
|
d8eaa50aed | ||
|
|
8e26e6e963 | ||
|
|
676e9dd82e | ||
|
|
23af3f70da | ||
|
|
b79385fecc | ||
|
|
03dd22587a | ||
|
|
bbc6be1099 | ||
|
|
7f2e366334 | ||
|
|
04f868b94a | ||
|
|
4071c094c6 |
13
README.md
13
README.md
@@ -26,20 +26,19 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
|||||||
## Language packs
|
## Language packs
|
||||||
|
|
||||||
- [arduino](https://github.com/sudar/vim-arduino-syntax) (syntax, indent, ftdetect)
|
- [arduino](https://github.com/sudar/vim-arduino-syntax) (syntax, indent, ftdetect)
|
||||||
- [blade](https://github.com/xsbeats/vim-blade) (syntax, indent, ftdetect)
|
- [blade](https://github.com/xsbeats/vim-blade) (syntax, ftdetect)
|
||||||
- [c++11](https://github.com/octol/vim-cpp-enhanced-highlight) (syntax)
|
- [c++11](https://github.com/octol/vim-cpp-enhanced-highlight) (syntax)
|
||||||
- [c/c++](https://github.com/vim-jp/cpp-vim) (syntax)
|
- [c/c++](https://github.com/vim-jp/cpp-vim) (syntax)
|
||||||
- [c-extensions](https://github.com/kergoth/aftersyntaxc.vim) (syntax)
|
- [c-extensions](https://github.com/kergoth/aftersyntaxc.vim) (syntax)
|
||||||
- [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, autoload, ftplugin, ftdetect)
|
- [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, autoload, ftplugin, ftdetect)
|
||||||
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
||||||
- [css](https://github.com/JulesWang/css.vim) (syntax)
|
- [css](https://github.com/JulesWang/css.vim) (syntax)
|
||||||
- [csv](https://github.com/chrisbra/csv.vim) (syntax, ftplugin, ftdetect)
|
|
||||||
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect)
|
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||||
- [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect)
|
- [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect)
|
||||||
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect)
|
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||||
- [emberscript](https://github.com/heartsentwined/vim-ember-script) (syntax, indent, ftplugin, ftdetect)
|
- [emberscript](https://github.com/heartsentwined/vim-ember-script) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [emblem](https://github.com/heartsentwined/vim-emblem) (syntax, indent, ftplugin, ftdetect)
|
- [emblem](https://github.com/heartsentwined/vim-emblem) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [erlang](https://github.com/oscarh/vimerl) (syntax, indent, compiler, autoload, ftplugin)
|
- [erlang](https://github.com/hcs42/vim-erlang-runtime) (syntax, indent)
|
||||||
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect)
|
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [go](https://github.com/fatih/vim-go) (syntax, indent, ftdetect)
|
- [go](https://github.com/fatih/vim-go) (syntax, indent, ftdetect)
|
||||||
- [haml](https://github.com/tpope/vim-haml) (syntax, indent, compiler, ftplugin, ftdetect)
|
- [haml](https://github.com/tpope/vim-haml) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||||
@@ -63,6 +62,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
|||||||
- [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin, ftdetect)
|
- [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [php](https://github.com/StanAngeloff/php.vim) (syntax)
|
- [php](https://github.com/StanAngeloff/php.vim) (syntax)
|
||||||
- [puppet](https://github.com/rodjek/vim-puppet) (syntax, indent, ftplugin, ftdetect)
|
- [puppet](https://github.com/rodjek/vim-puppet) (syntax, indent, ftplugin, ftdetect)
|
||||||
|
- [powershell](https://github.com/Persistent13/vim-ps1) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, ftdetect)
|
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, ftdetect)
|
||||||
- [python](https://github.com/mitsuhiko/vim-python-combined) (syntax, indent)
|
- [python](https://github.com/mitsuhiko/vim-python-combined) (syntax, indent)
|
||||||
- [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin)
|
- [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin)
|
||||||
@@ -76,14 +76,17 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
|||||||
- [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax, ftdetect)
|
- [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax, ftdetect)
|
||||||
- [swift](https://github.com/toyamarinyon/vim-swift) (syntax, indent, ftdetect)
|
- [swift](https://github.com/toyamarinyon/vim-swift) (syntax, indent, ftdetect)
|
||||||
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect)
|
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect)
|
||||||
- [tmux](https://github.com/acustodioo/vim-tmux) (syntax, ftdetect)
|
- [tmux](https://github.com/tejr/vim-tmux) (syntax, ftdetect)
|
||||||
- [tomdoc](https://github.com/duwanis/tomdoc.vim) (syntax)
|
- [tomdoc](https://github.com/duwanis/tomdoc.vim) (syntax)
|
||||||
- [typescript](https://github.com/leafgarland/typescript-vim) (syntax, compiler, ftplugin, ftdetect)
|
- [typescript](https://github.com/leafgarland/typescript-vim) (syntax, compiler, ftplugin, ftdetect)
|
||||||
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
||||||
- [toml](https://github.com/cespare/vim-toml) (syntax, ftdetect)
|
- [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect)
|
||||||
|
- [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin, ftdetect)
|
||||||
- [twig](https://github.com/beyondwords/vim-twig) (syntax, ftplugin, ftdetect)
|
- [twig](https://github.com/beyondwords/vim-twig) (syntax, ftplugin, ftdetect)
|
||||||
- [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax)
|
- [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax)
|
||||||
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
||||||
|
- [vala](https://github.com/tkztmk/vim-vala) (syntax, indent, ftdetect)
|
||||||
|
- [vm](https://github.com/lepture/vim-velocity) (syntax, indent, ftdetect)
|
||||||
- [css-color](https://github.com/ap/vim-css-color) (autoload, syntax)
|
- [css-color](https://github.com/ap/vim-css-color) (autoload, syntax)
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|||||||
@@ -289,282 +289,3 @@ hi def link cBoolean Boolean
|
|||||||
"hi def link cDelimiter Delimiter
|
"hi def link cDelimiter Delimiter
|
||||||
" foldmethod=syntax fix, courtesy of Ivan Freitas
|
" foldmethod=syntax fix, courtesy of Ivan Freitas
|
||||||
"hi def link cBraces Delimiter
|
"hi def link cBraces Delimiter
|
||||||
" Vim syntax file
|
|
||||||
" Language: C Additions
|
|
||||||
" Maintainer: Mikhail Wolfson <mywolfson@gmail.com>
|
|
||||||
" URL: http://web.mit.edu/wolfsonm
|
|
||||||
" Last Change: 2010 Dec. 3
|
|
||||||
" Version: 0.4
|
|
||||||
"
|
|
||||||
" Changelog:
|
|
||||||
" 0.4 - updates and fixes to cDelimiter to fix break with foldmethod=syntax,
|
|
||||||
" entirely suggested and solved by Ivan Freitas
|
|
||||||
" <ivansichfreitas@gmail.com>
|
|
||||||
" 0.3 - updates and fixes to cUserFunctionPointer, thanks to
|
|
||||||
" Alexei <lxmzhv@gmail.com>
|
|
||||||
" 0.2 - change [] to operator
|
|
||||||
" 0.1 - initial upload, modification from vimscript#1201, Extended c.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
|
|
||||||
|
|
||||||
" 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 "[{}]"
|
|
||||||
|
|
||||||
|
|
||||||
" Booleans
|
|
||||||
syn keyword cBoolean true false TRUE FALSE
|
|
||||||
|
|
||||||
|
|
||||||
" Links
|
|
||||||
hi def link cFunction Function
|
|
||||||
hi def link cIdentifier Identifier
|
|
||||||
hi def link cDelimiter Delimiter
|
|
||||||
" foldmethod=syntax fix, courtesy of Ivan Freitas
|
|
||||||
hi def link cBraces Delimiter
|
|
||||||
hi def link cBoolean Boolean
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
" This file describes a very basic syntax for TomDoc comments in a
|
|
||||||
" CoffeeScript file.
|
|
||||||
"
|
|
||||||
" For more information on TomDoc, check it out here: http://tomdoc.org/
|
|
||||||
"
|
|
||||||
|
|
||||||
syn keyword tomdocKeywords Returns containedin=coffeeComment contained
|
|
||||||
syn keyword tomdocKeywords Throws containedin=coffeeComment contained
|
|
||||||
syn keyword tomdocKeywords Examples containedin=coffeeComment contained
|
|
||||||
syn keyword tomdocKeywords Signature containedin=coffeeComment contained
|
|
||||||
|
|
||||||
syn match tomdocArguments +\s*[A-Za-z0-9_\-&\*:]*\(\s*- \)+he=e-3 containedin=coffeeComment contained
|
|
||||||
|
|
||||||
syn match tomdocDescriptions +\s*Public:+he=e-1 containedin=coffeeComment contained
|
|
||||||
syn match tomdocDescriptions +\s*Internal:+he=e-1 containedin=coffeeComment contained
|
|
||||||
syn match tomdocDescriptions +\s*Deprecated:+he=e-1 containedin=coffeeComment contained
|
|
||||||
|
|
||||||
hi default link tomdocDescriptions String
|
|
||||||
hi default link tomdocKeywords String
|
|
||||||
hi default link tomdocArguments HELP
|
|
||||||
@@ -1312,6 +1312,8 @@ if !exists("cpp_no_cpp11")
|
|||||||
|
|
||||||
"raw string literals
|
"raw string literals
|
||||||
syntax region cppRawString matchgroup=cppRawDelimiter start=@\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(@ end=/)\z1"/ contains=@Spell
|
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")
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
||||||
|
|
||||||
call css_color#init('css', 'cssMediaBlock,cssFunction,cssDefinition,cssAttrRegion,cssComment')
|
call css_color#init('css', 'extended', 'cssMediaBlock,cssFunction,cssDefinition,cssAttrRegion,cssComment')
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
let b:current_syntax = ''
|
" Extends standard help syntax with highlighting of Scala code.
|
||||||
unlet b:current_syntax
|
"
|
||||||
|
" Place code between !sc! and !/sc! delimiters. These will be hidden if Vim is
|
||||||
|
" built with conceal support.
|
||||||
|
|
||||||
|
unlet! b:current_syntax
|
||||||
|
|
||||||
syntax include @ScalaCode syntax/scala.vim
|
syntax include @ScalaCode syntax/scala.vim
|
||||||
|
|
||||||
if has('conceal')
|
if has('conceal')
|
||||||
syntax region rgnScala matchgroup=Ignore concealends start='!sc!' end='!/sc!' contains=@ScalaCode
|
syntax region rgnScala matchgroup=Ignore concealends start='!sc!' end='!/sc!' contains=@ScalaCode
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -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', 'extended', 'lessVariableValue,lessVariableDefinition,lessDefinition,lessCssAttribute,lessAttribute,cssDefinition,cssComment,lessCssComment,lessComment')
|
||||||
|
|||||||
6
after/syntax/lua.vim
Normal file
6
after/syntax/lua.vim
Normal 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('hex', 'extended', 'luaComment,luaString')
|
||||||
6
after/syntax/moon.vim
Normal file
6
after/syntax/moon.vim
Normal 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('hex', 'extended', 'moonComment,moonString')
|
||||||
@@ -1,23 +1,3 @@
|
|||||||
" This file describes a very basic syntax for TomDoc comments in a Ruby file.
|
|
||||||
"
|
|
||||||
" For more information on TomDoc, check it out here: http://tomdoc.org/
|
|
||||||
"
|
|
||||||
|
|
||||||
syn keyword tomdocKeywords Returns containedin=rubyComment contained
|
|
||||||
syn keyword tomdocKeywords Yields containedin=rubyComment contained
|
|
||||||
syn keyword tomdocKeywords Raises containedin=rubyComment contained
|
|
||||||
syn keyword tomdocKeywords Examples containedin=rubyComment contained
|
|
||||||
syn keyword tomdocKeywords Signature containedin=rubyComment contained
|
|
||||||
|
|
||||||
syn match tomdocArguments +\s*[A-Za-z0-9_\-&\*:]*\(\s*- \)+he=e-3 containedin=rubyComment contained
|
|
||||||
|
|
||||||
syn match tomdocDescriptions +\s*Public:+he=e-1 containedin=rubyComment contained
|
|
||||||
syn match tomdocDescriptions +\s*Internal:+he=e-1 containedin=rubyComment contained
|
|
||||||
syn match tomdocDescriptions +\s*Deprecated:+he=e-1 containedin=rubyComment contained
|
|
||||||
|
|
||||||
hi default link tomdocDescriptions String
|
|
||||||
hi default link tomdocKeywords String
|
|
||||||
hi default link tomdocArguments HELP
|
|
||||||
" Ruby syntax extensions for highlighting YARD documentation.
|
" Ruby syntax extensions for highlighting YARD documentation.
|
||||||
"
|
"
|
||||||
" Author: Joel Holdbrooks <https://github.com/noprompt>
|
" Author: Joel Holdbrooks <https://github.com/noprompt>
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
||||||
|
|
||||||
call css_color#init('css', 'sassCssAttribute,sassComment,sassCssComment')
|
call css_color#init('css', 'extended', 'sassCssAttribute,sassComment,sassCssComment')
|
||||||
|
|||||||
6
after/syntax/scss.vim
Normal file
6
after/syntax/scss.vim
Normal 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', 'extended', 'scssAttribute,scssComment,scssVariableValue,sassCssAttribute,cssComment')
|
||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
||||||
|
|
||||||
call css_color#init('css', 'stylusCssAttribute,stylusComment,cssComment')
|
call css_color#init('css', 'extended', 'stylusCssAttribute,stylusComment,cssComment')
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
if !( has('gui_running') || &t_Co==256 ) | finish | endif
|
||||||
|
|
||||||
call css_color#init('any', 'vimHiGuiRgb,vimComment,vimLineComment')
|
call css_color#init('hex', 'none', 'vimHiGuiRgb,vimComment,vimLineComment')
|
||||||
|
|||||||
@@ -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,33 +205,39 @@ 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:_ws_ = '\s*'
|
let s:_ws_ = '\s*'
|
||||||
let s:_listsep = s:_ws_ . ',' . s:_ws_
|
let s:_numval = s:_ws_ . '\(\d\{1,3}%\?\)' " submatch 3,4,5
|
||||||
|
let s:_listsep = s:_ws_ . ','
|
||||||
let s:_otherargs_ = '\%(,[^)]*\)\?'
|
let s:_otherargs_ = '\%(,[^)]*\)\?'
|
||||||
let s:_funcexpr = s:_funcname . '[(]' . s:_numval . s:_listsep . s:_numval . s:_listsep . s:_numval . s:_ws_ . s:_otherargs_ . '[)]'
|
let s:_funcexpr = s:_funcname . '[(]' . s:_numval . s:_listsep . s:_numval . s:_listsep . s:_numval . s:_ws_ . s:_otherargs_ . '[)]'
|
||||||
let s:_csscolor = s:_hexcolor . '\|' . s:_funcexpr
|
let s:_csscolor = s:_hexcolor . '\|' . s:_funcexpr
|
||||||
@@ -242,46 +247,84 @@ 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_hex_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
|
||||||
|
|
||||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
function! css_color#init(type, groups)
|
function! css_color#init(type, keywords, groups)
|
||||||
exe 'syn cluster colorableGroup contains=' . a:groups
|
exe 'syn cluster colorableGroup contains=' . a: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:keywords == 'none' | return | endif
|
||||||
|
|
||||||
|
syn case ignore
|
||||||
|
|
||||||
|
" W3C basic colors
|
||||||
|
|
||||||
hi BG000000 guibg=#000000 guifg=#FFFFFF ctermbg=16 ctermfg=231
|
hi BG000000 guibg=#000000 guifg=#FFFFFF ctermbg=16 ctermfg=231
|
||||||
|
hi BGc0c0c0 guibg=#C0C0C0 guifg=#000000 ctermbg=250 ctermfg=16
|
||||||
|
hi BG808080 guibg=#808080 guifg=#000000 ctermbg=244 ctermfg=16
|
||||||
|
hi BGffffff guibg=#FFFFFF guifg=#000000 ctermbg=231 ctermfg=16
|
||||||
|
hi BG800000 guibg=#800000 guifg=#FFFFFF ctermbg=88 ctermfg=231
|
||||||
|
hi BGff0000 guibg=#FF0000 guifg=#FFFFFF ctermbg=196 ctermfg=231
|
||||||
|
hi BG800080 guibg=#800080 guifg=#FFFFFF ctermbg=240 ctermfg=231
|
||||||
|
hi BGff00ff guibg=#FF00FF guifg=#FFFFFF ctermbg=13 ctermfg=231
|
||||||
|
hi BG008000 guibg=#008000 guifg=#FFFFFF ctermbg=2 ctermfg=231
|
||||||
|
hi BG00ff00 guibg=#00FF00 guifg=#000000 ctermbg=10 ctermfg=16
|
||||||
|
hi BG808000 guibg=#808000 guifg=#FFFFFF ctermbg=240 ctermfg=231
|
||||||
|
hi BGffff00 guibg=#FFFF00 guifg=#000000 ctermbg=11 ctermfg=16
|
||||||
hi BG000080 guibg=#000080 guifg=#FFFFFF ctermbg=235 ctermfg=231
|
hi BG000080 guibg=#000080 guifg=#FFFFFF ctermbg=235 ctermfg=231
|
||||||
|
hi BG0000ff guibg=#0000FF guifg=#FFFFFF ctermbg=4 ctermfg=231
|
||||||
|
hi BG008080 guibg=#008080 guifg=#FFFFFF ctermbg=30 ctermfg=231
|
||||||
|
hi BG00ffff guibg=#00FFFF guifg=#000000 ctermbg=51 ctermfg=16
|
||||||
|
|
||||||
|
syn keyword BG000000 black contained containedin=@colorableGroup
|
||||||
|
syn keyword BGc0c0c0 silver contained containedin=@colorableGroup
|
||||||
|
syn keyword BG808080 gray contained containedin=@colorableGroup
|
||||||
|
syn match BGffffff "\c\<white\(-\)\@!\>" contained containedin=@colorableGroup
|
||||||
|
syn keyword BG800000 maroon contained containedin=@colorableGroup
|
||||||
|
syn keyword BGff0000 red contained containedin=@colorableGroup
|
||||||
|
syn keyword BG800080 purple contained containedin=@colorableGroup
|
||||||
|
syn keyword BGff00ff fuchsia contained containedin=@colorableGroup
|
||||||
|
syn keyword BG008000 green contained containedin=@colorableGroup
|
||||||
|
syn keyword BG00ff00 lime contained containedin=@colorableGroup
|
||||||
|
syn keyword BG808000 olive contained containedin=@colorableGroup
|
||||||
|
syn keyword BGffff00 yellow contained containedin=@colorableGroup
|
||||||
|
syn keyword BG000080 navy contained containedin=@colorableGroup
|
||||||
|
syn keyword BG0000ff blue contained containedin=@colorableGroup
|
||||||
|
syn keyword BG008080 teal contained containedin=@colorableGroup
|
||||||
|
syn keyword BG00ffff aqua contained containedin=@colorableGroup
|
||||||
|
|
||||||
|
if a:keywords == 'basic' | return | endif
|
||||||
|
|
||||||
|
" W3C extended colors
|
||||||
|
|
||||||
hi BG00008b guibg=#00008B guifg=#FFFFFF ctermbg=4 ctermfg=231
|
hi BG00008b guibg=#00008B guifg=#FFFFFF ctermbg=4 ctermfg=231
|
||||||
hi BG0000cd guibg=#0000CD guifg=#FFFFFF ctermbg=4 ctermfg=231
|
hi BG0000cd guibg=#0000CD guifg=#FFFFFF ctermbg=4 ctermfg=231
|
||||||
hi BG0000ff guibg=#0000FF guifg=#FFFFFF ctermbg=4 ctermfg=231
|
|
||||||
hi BG006400 guibg=#006400 guifg=#FFFFFF ctermbg=235 ctermfg=231
|
hi BG006400 guibg=#006400 guifg=#FFFFFF ctermbg=235 ctermfg=231
|
||||||
hi BG008000 guibg=#008000 guifg=#FFFFFF ctermbg=2 ctermfg=231
|
|
||||||
hi BG008080 guibg=#008080 guifg=#FFFFFF ctermbg=30 ctermfg=231
|
|
||||||
hi BG008b8b guibg=#008B8B guifg=#FFFFFF ctermbg=30 ctermfg=231
|
hi BG008b8b guibg=#008B8B guifg=#FFFFFF ctermbg=30 ctermfg=231
|
||||||
hi BG00bfff guibg=#00BFFF guifg=#000000 ctermbg=6 ctermfg=16
|
hi BG00bfff guibg=#00BFFF guifg=#000000 ctermbg=6 ctermfg=16
|
||||||
hi BG00ced1 guibg=#00CED1 guifg=#000000 ctermbg=6 ctermfg=16
|
hi BG00ced1 guibg=#00CED1 guifg=#000000 ctermbg=6 ctermfg=16
|
||||||
hi BG00fa9a guibg=#00FA9A guifg=#000000 ctermbg=6 ctermfg=16
|
hi BG00fa9a guibg=#00FA9A guifg=#000000 ctermbg=6 ctermfg=16
|
||||||
hi BG00ff00 guibg=#00FF00 guifg=#000000 ctermbg=10 ctermfg=16
|
|
||||||
hi BG00ff7f guibg=#00FF7F guifg=#000000 ctermbg=6 ctermfg=16
|
hi BG00ff7f guibg=#00FF7F guifg=#000000 ctermbg=6 ctermfg=16
|
||||||
hi BG00ffff guibg=#00FFFF guifg=#000000 ctermbg=51 ctermfg=16
|
|
||||||
hi BG191970 guibg=#191970 guifg=#FFFFFF ctermbg=237 ctermfg=231
|
hi BG191970 guibg=#191970 guifg=#FFFFFF ctermbg=237 ctermfg=231
|
||||||
hi BG1e90ff guibg=#1E90FF guifg=#000000 ctermbg=12 ctermfg=16
|
hi BG1e90ff guibg=#1E90FF guifg=#000000 ctermbg=12 ctermfg=16
|
||||||
hi BG20b2aa guibg=#20B2AA guifg=#000000 ctermbg=37 ctermfg=16
|
hi BG20b2aa guibg=#20B2AA guifg=#000000 ctermbg=37 ctermfg=16
|
||||||
@@ -309,10 +352,6 @@ function! css_color#init(type, groups)
|
|||||||
hi BG7cfc00 guibg=#7CFC00 guifg=#000000 ctermbg=3 ctermfg=16
|
hi BG7cfc00 guibg=#7CFC00 guifg=#000000 ctermbg=3 ctermfg=16
|
||||||
hi BG7fff00 guibg=#7FFF00 guifg=#000000 ctermbg=3 ctermfg=16
|
hi BG7fff00 guibg=#7FFF00 guifg=#000000 ctermbg=3 ctermfg=16
|
||||||
hi BG7fffd4 guibg=#7FFFD4 guifg=#000000 ctermbg=122 ctermfg=16
|
hi BG7fffd4 guibg=#7FFFD4 guifg=#000000 ctermbg=122 ctermfg=16
|
||||||
hi BG800000 guibg=#800000 guifg=#FFFFFF ctermbg=88 ctermfg=231
|
|
||||||
hi BG800080 guibg=#800080 guifg=#FFFFFF ctermbg=240 ctermfg=231
|
|
||||||
hi BG808000 guibg=#808000 guifg=#FFFFFF ctermbg=240 ctermfg=231
|
|
||||||
hi BG808080 guibg=#808080 guifg=#000000 ctermbg=244 ctermfg=16
|
|
||||||
hi BG87ceeb guibg=#87CEEB guifg=#000000 ctermbg=117 ctermfg=16
|
hi BG87ceeb guibg=#87CEEB guifg=#000000 ctermbg=117 ctermfg=16
|
||||||
hi BG87cefa guibg=#87CEFA guifg=#000000 ctermbg=117 ctermfg=16
|
hi BG87cefa guibg=#87CEFA guifg=#000000 ctermbg=117 ctermfg=16
|
||||||
hi BG8a2be2 guibg=#8A2BE2 guifg=#FFFFFF ctermbg=12 ctermfg=231
|
hi BG8a2be2 guibg=#8A2BE2 guifg=#FFFFFF ctermbg=12 ctermfg=231
|
||||||
@@ -339,7 +378,6 @@ function! css_color#init(type, groups)
|
|||||||
hi BGba55d3 guibg=#BA55D3 guifg=#000000 ctermbg=5 ctermfg=16
|
hi BGba55d3 guibg=#BA55D3 guifg=#000000 ctermbg=5 ctermfg=16
|
||||||
hi BGbc8f8f guibg=#BC8F8F guifg=#000000 ctermbg=138 ctermfg=16
|
hi BGbc8f8f guibg=#BC8F8F guifg=#000000 ctermbg=138 ctermfg=16
|
||||||
hi BGbdb76b guibg=#BDB76B guifg=#000000 ctermbg=247 ctermfg=16
|
hi BGbdb76b guibg=#BDB76B guifg=#000000 ctermbg=247 ctermfg=16
|
||||||
hi BGc0c0c0 guibg=#C0C0C0 guifg=#000000 ctermbg=250 ctermfg=16
|
|
||||||
hi BGc71585 guibg=#C71585 guifg=#FFFFFF ctermbg=5 ctermfg=231
|
hi BGc71585 guibg=#C71585 guifg=#FFFFFF ctermbg=5 ctermfg=231
|
||||||
hi BGcd5c5c guibg=#CD5C5C guifg=#000000 ctermbg=167 ctermfg=16
|
hi BGcd5c5c guibg=#CD5C5C guifg=#000000 ctermbg=167 ctermfg=16
|
||||||
hi BGcd853f guibg=#CD853F guifg=#000000 ctermbg=173 ctermfg=16
|
hi BGcd853f guibg=#CD853F guifg=#000000 ctermbg=173 ctermfg=16
|
||||||
@@ -375,8 +413,6 @@ function! css_color#init(type, groups)
|
|||||||
hi BGfaf0e6 guibg=#FAF0E6 guifg=#000000 ctermbg=255 ctermfg=16
|
hi BGfaf0e6 guibg=#FAF0E6 guifg=#000000 ctermbg=255 ctermfg=16
|
||||||
hi BGfafad2 guibg=#FAFAD2 guifg=#000000 ctermbg=255 ctermfg=16
|
hi BGfafad2 guibg=#FAFAD2 guifg=#000000 ctermbg=255 ctermfg=16
|
||||||
hi BGfdf5e6 guibg=#FDF5E6 guifg=#000000 ctermbg=255 ctermfg=16
|
hi BGfdf5e6 guibg=#FDF5E6 guifg=#000000 ctermbg=255 ctermfg=16
|
||||||
hi BGff0000 guibg=#FF0000 guifg=#FFFFFF ctermbg=196 ctermfg=231
|
|
||||||
hi BGff00ff guibg=#FF00FF guifg=#FFFFFF ctermbg=13 ctermfg=231
|
|
||||||
hi BGff1493 guibg=#FF1493 guifg=#FFFFFF ctermbg=5 ctermfg=231
|
hi BGff1493 guibg=#FF1493 guifg=#FFFFFF ctermbg=5 ctermfg=231
|
||||||
hi BGff4500 guibg=#FF4500 guifg=#FFFFFF ctermbg=9 ctermfg=231
|
hi BGff4500 guibg=#FF4500 guifg=#FFFFFF ctermbg=9 ctermfg=231
|
||||||
hi BGff6347 guibg=#FF6347 guifg=#000000 ctermbg=203 ctermfg=16
|
hi BGff6347 guibg=#FF6347 guifg=#000000 ctermbg=203 ctermfg=16
|
||||||
@@ -401,30 +437,9 @@ function! css_color#init(type, groups)
|
|||||||
hi BGfffacd guibg=#FFFACD guifg=#000000 ctermbg=255 ctermfg=16
|
hi BGfffacd guibg=#FFFACD guifg=#000000 ctermbg=255 ctermfg=16
|
||||||
hi BGfffaf0 guibg=#FFFAF0 guifg=#000000 ctermbg=15 ctermfg=16
|
hi BGfffaf0 guibg=#FFFAF0 guifg=#000000 ctermbg=15 ctermfg=16
|
||||||
hi BGfffafa guibg=#FFFAFA guifg=#000000 ctermbg=15 ctermfg=16
|
hi BGfffafa guibg=#FFFAFA guifg=#000000 ctermbg=15 ctermfg=16
|
||||||
hi BGffff00 guibg=#FFFF00 guifg=#000000 ctermbg=11 ctermfg=16
|
|
||||||
hi BGffffe0 guibg=#FFFFE0 guifg=#000000 ctermbg=255 ctermfg=16
|
hi BGffffe0 guibg=#FFFFE0 guifg=#000000 ctermbg=255 ctermfg=16
|
||||||
hi BGfffff0 guibg=#FFFFF0 guifg=#000000 ctermbg=15 ctermfg=16
|
hi BGfffff0 guibg=#FFFFF0 guifg=#000000 ctermbg=15 ctermfg=16
|
||||||
hi BGffffff guibg=#FFFFFF guifg=#000000 ctermbg=231 ctermfg=16
|
|
||||||
|
|
||||||
" W3C Colors
|
|
||||||
syn keyword BG000000 black contained containedin=@colorableGroup
|
|
||||||
syn keyword BGc0c0c0 silver contained containedin=@colorableGroup
|
|
||||||
syn keyword BG808080 gray contained containedin=@colorableGroup
|
|
||||||
syn match BGffffff "\<white\(-\)\@!\>" contained containedin=@colorableGroup
|
|
||||||
syn keyword BG800000 maroon contained containedin=@colorableGroup
|
|
||||||
syn keyword BGff0000 red contained containedin=@colorableGroup
|
|
||||||
syn keyword BG800080 purple contained containedin=@colorableGroup
|
|
||||||
syn keyword BGff00ff fuchsia contained containedin=@colorableGroup
|
|
||||||
syn keyword BG008000 green contained containedin=@colorableGroup
|
|
||||||
syn keyword BG00ff00 lime contained containedin=@colorableGroup
|
|
||||||
syn keyword BG808000 olive contained containedin=@colorableGroup
|
|
||||||
syn keyword BGffff00 yellow contained containedin=@colorableGroup
|
|
||||||
syn keyword BG000080 navy contained containedin=@colorableGroup
|
|
||||||
syn keyword BG0000ff blue contained containedin=@colorableGroup
|
|
||||||
syn keyword BG008080 teal contained containedin=@colorableGroup
|
|
||||||
syn keyword BG00ffff aqua contained containedin=@colorableGroup
|
|
||||||
|
|
||||||
" extra colors
|
|
||||||
syn keyword BGf0f8ff AliceBlue contained containedin=@colorableGroup
|
syn keyword BGf0f8ff AliceBlue contained containedin=@colorableGroup
|
||||||
syn keyword BGfaebd7 AntiqueWhite contained containedin=@colorableGroup
|
syn keyword BGfaebd7 AntiqueWhite contained containedin=@colorableGroup
|
||||||
syn keyword BG7fffd4 Aquamarine contained containedin=@colorableGroup
|
syn keyword BG7fffd4 Aquamarine contained containedin=@colorableGroup
|
||||||
|
|||||||
@@ -1,161 +0,0 @@
|
|||||||
" ------------------------------------------------------------------------------
|
|
||||||
" Vim omni-completion script
|
|
||||||
" Author: Oscar Hellström
|
|
||||||
" Email: oscar@oscarh.net
|
|
||||||
" Version: 2010-08-10
|
|
||||||
" Contributors: kTT (http://github.com/kTT)
|
|
||||||
" Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
|
||||||
" ------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
" Patterns for completions {{{1
|
|
||||||
let s:erlangLocalFuncBeg = '\(\<[0-9A-Za-z_-]*\|\s*\)$'
|
|
||||||
let s:erlangExternalFuncBeg = '\<[0-9A-Za-z_-]\+:[0-9A-Za-z_-]*$'
|
|
||||||
let s:ErlangBlankLine = '^\s*\(%.*\)\?$'
|
|
||||||
let s:erlangCompletionPath = expand('<sfile>:p:h') . '/erlang_completion.erl'
|
|
||||||
|
|
||||||
if !exists('g:erlangCompletionGrep')
|
|
||||||
let g:erlangCompletionGrep = 'grep'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:erlangManSuffix')
|
|
||||||
let g:erlangManSuffix = ''
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:erlangManPath')
|
|
||||||
let g:erlangManPath = '/usr/lib/erlang/man'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:erlangCompletionDisplayDoc')
|
|
||||||
let g:erlangCompletionDisplayDoc = 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Main function for completion {{{1
|
|
||||||
function! erlangcomplete#Complete(findstart, base)
|
|
||||||
" 0) Init {{{2
|
|
||||||
let lnum = line('.')
|
|
||||||
let column = col('.')
|
|
||||||
let line = strpart(getline('.'), 0, column - 1)
|
|
||||||
|
|
||||||
" 1) First, check if completion is impossible {{{2
|
|
||||||
if line =~ '[^~\\]%'
|
|
||||||
return -1
|
|
||||||
endif
|
|
||||||
|
|
||||||
"echo "line[col - 1]:" . line[column - 1] . " line[col - 2]:" . line[column - 2] . "\n" . line . "\n"
|
|
||||||
|
|
||||||
" 2) Check if the char to the left of us are part of a function call {{{2
|
|
||||||
"
|
|
||||||
" Nothing interesting is written at the char just before the cursor
|
|
||||||
" This means _anything_ could be started here
|
|
||||||
" In this case, keyword completion should probably be used,
|
|
||||||
" for now we'll only try and complete local functions.
|
|
||||||
" TODO: Examine if we can stare Identifiers end complete on them
|
|
||||||
" Is this worth it? Is /completion/ of a "blank" wanted? Can we consider (
|
|
||||||
" interesting and check if we are in a function call etc.?
|
|
||||||
if line[column - 2] !~ '[0-9A-Za-z:_-]'
|
|
||||||
if a:findstart
|
|
||||||
return column
|
|
||||||
else
|
|
||||||
return s:erlangFindLocalFunc(a:base)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
" 3) Function in external module {{{2
|
|
||||||
if line =~ s:erlangExternalFuncBeg
|
|
||||||
let delimiter = match(line, ':[0-9A-Za-z_-]*$') + 1
|
|
||||||
if a:findstart
|
|
||||||
return delimiter
|
|
||||||
else
|
|
||||||
let module = matchstr(line[:-2], '\<\k*\>$')
|
|
||||||
return s:erlangFindExternalFunc(module, a:base)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
" 4) Local function {{{2
|
|
||||||
if line =~ s:erlangLocalFuncBeg
|
|
||||||
let funcstart = match(line, ':\@<![0-9A-Za-z_-]*$')
|
|
||||||
if a:findstart
|
|
||||||
return funcstart
|
|
||||||
else
|
|
||||||
return s:erlangFindLocalFunc(a:base)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
" 5) Unhandled situation {{{2
|
|
||||||
if a:findstart
|
|
||||||
return -1
|
|
||||||
else
|
|
||||||
return []
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Auxiliary functions for completion {{{1
|
|
||||||
" Find the next non-blank line {{{2
|
|
||||||
function s:erlangFindNextNonBlank(lnum)
|
|
||||||
let lnum = nextnonblank(a:lnum + 1)
|
|
||||||
let line = getline(lnum)
|
|
||||||
while line =~ s:ErlangBlankLine && 0 != lnum
|
|
||||||
let lnum = nextnonblank(lnum + 1)
|
|
||||||
let line = getline(lnum)
|
|
||||||
endwhile
|
|
||||||
return lnum
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" vim: foldmethod=marker:
|
|
||||||
" Find external function names {{{2
|
|
||||||
function s:erlangFindExternalFunc(module, base)
|
|
||||||
" If it's a local module, try to compile it
|
|
||||||
if filereadable(a:module . '.erl') && !filereadable(a:module . '.beam')
|
|
||||||
silent execute '!erlc' a:module . '.erl' '>/dev/null' '2>/dev/null'
|
|
||||||
redraw!
|
|
||||||
endif
|
|
||||||
let functions = system(s:erlangCompletionPath . ' ' . a:module)
|
|
||||||
for element in sort(split(functions, '\n'))
|
|
||||||
if match(element, a:base) == 0
|
|
||||||
let function_name = matchstr(element, a:base . '\w\+')
|
|
||||||
let number_of_args = matchstr(element, '\d\+', len(function_name))
|
|
||||||
let number_of_comma = max([number_of_args - 1, 0])
|
|
||||||
let file_path = g:erlangManPath . '/man?/' . a:module . '\.?' . g:erlangManSuffix
|
|
||||||
" [:-2] cutting some weird characters at the end
|
|
||||||
" becouse grep doesn't support multilines, we have to filter
|
|
||||||
" first by .B and next by looking via function name
|
|
||||||
" if someone have better idea, please change it
|
|
||||||
let description = ''
|
|
||||||
" Don't look man pages if the module is present in the current directory
|
|
||||||
if g:erlangCompletionDisplayDoc != 0 && !filereadable(a:module . '.erl')
|
|
||||||
let system_command = g:erlangCompletionGrep . ' -A 1 "\.B" ' . file_path . ' | grep -EZo "\<' .
|
|
||||||
\ function_name . '\>\((\w+, ){' . number_of_comma . '}[^),]*\) -> .*"'
|
|
||||||
let description = system(system_command)
|
|
||||||
let description = description[:-2]
|
|
||||||
endif
|
|
||||||
if description == ''
|
|
||||||
let description = element " if function doesn't have description e.g. lists:rmerge, put rmerge/2 instead
|
|
||||||
endif
|
|
||||||
let field = {'word': function_name . '(', 'abbr': description, 'kind': 'f', 'dup': 1} " always duplicate functions
|
|
||||||
call complete_add(field)
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
return []
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Find local function names {{{2
|
|
||||||
function s:erlangFindLocalFunc(base)
|
|
||||||
" begin at line 1
|
|
||||||
let lnum = s:erlangFindNextNonBlank(1)
|
|
||||||
if "" == a:base
|
|
||||||
let base = '\w' " used to match against word symbol
|
|
||||||
else
|
|
||||||
let base = a:base
|
|
||||||
endif
|
|
||||||
while 0 != lnum && !complete_check()
|
|
||||||
let line = getline(lnum)
|
|
||||||
let function_name = matchstr(line, '^' . base . '[0-9A-Za-z_-]\+(\@=')
|
|
||||||
if function_name != ""
|
|
||||||
call complete_add(function_name)
|
|
||||||
endif
|
|
||||||
let lnum = s:erlangFindNextNonBlank(lnum)
|
|
||||||
endwhile
|
|
||||||
return []
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
@@ -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']
|
||||||
|
|
||||||
@@ -545,7 +545,7 @@ let g:xmldata_html5 = {
|
|||||||
\ ],
|
\ ],
|
||||||
\ 'iframe': [
|
\ 'iframe': [
|
||||||
\ [],
|
\ [],
|
||||||
\ extend(copy(global_attributes), {'src': [], 'name': [], 'width': [], 'height': [], 'sandbox': ['allow-same-origin', 'allow-forms', 'allow-scripts'], 'seamless': ['seamless', '']})
|
\ extend(copy(global_attributes), {'src': [], 'srcdoc': [], 'name': [], 'width': [], 'height': [], 'sandbox': ['allow-same-origin', 'allow-forms', 'allow-scripts'], 'seamless': ['seamless', '']})
|
||||||
\ ],
|
\ ],
|
||||||
\ 'img': [
|
\ 'img': [
|
||||||
\ [],
|
\ [],
|
||||||
@@ -601,7 +601,7 @@ let g:xmldata_html5 = {
|
|||||||
\ ],
|
\ ],
|
||||||
\ 'meta': [
|
\ 'meta': [
|
||||||
\ [],
|
\ [],
|
||||||
\ extend(copy(global_attributes), {'name': [], 'http-equiv': ['refresh', 'default-style', 'content-type'], 'content': [], 'charset': charset})
|
\ extend(copy(global_attributes), {'name': ['application-name', 'author', 'description', 'generator', 'referrer', 'creator', 'googlebot', 'publisher', 'robots', 'slurp', 'viewport', 'theme-color'], 'http-equiv': ['refresh', 'default-style', 'content-type'], 'content': [], 'charset': charset})
|
||||||
\ ],
|
\ ],
|
||||||
\ 'meter': [
|
\ 'meter': [
|
||||||
\ phrasing_elements,
|
\ phrasing_elements,
|
||||||
@@ -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
|
||||||
@@ -655,6 +659,10 @@ let g:xmldata_html5 = {
|
|||||||
\ phrasing_elements,
|
\ phrasing_elements,
|
||||||
\ extend(copy(global_attributes), {'cite': []})
|
\ extend(copy(global_attributes), {'cite': []})
|
||||||
\ ],
|
\ ],
|
||||||
|
\ 'rb': [
|
||||||
|
\ phrasing_elements,
|
||||||
|
\ global_attributes
|
||||||
|
\ ],
|
||||||
\ 'rp': [
|
\ 'rp': [
|
||||||
\ phrasing_elements,
|
\ phrasing_elements,
|
||||||
\ global_attributes
|
\ global_attributes
|
||||||
@@ -663,10 +671,14 @@ let g:xmldata_html5 = {
|
|||||||
\ phrasing_elements,
|
\ phrasing_elements,
|
||||||
\ global_attributes
|
\ global_attributes
|
||||||
\ ],
|
\ ],
|
||||||
\ 'ruby': [
|
\ 'rtc': [
|
||||||
\ phrasing_elements + ['rp', 'rt'],
|
\ phrasing_elements + ['rp', 'rt'],
|
||||||
\ global_attributes
|
\ global_attributes
|
||||||
\ ],
|
\ ],
|
||||||
|
\ 'ruby': [
|
||||||
|
\ phrasing_elements + ['rb', 'rp', 'rt', 'rtc'],
|
||||||
|
\ global_attributes
|
||||||
|
\ ],
|
||||||
\ 'samp': [
|
\ 'samp': [
|
||||||
\ phrasing_elements,
|
\ phrasing_elements,
|
||||||
\ global_attributes
|
\ global_attributes
|
||||||
@@ -693,7 +705,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,
|
||||||
|
|||||||
20
build
20
build
@@ -23,17 +23,18 @@ extract() {
|
|||||||
path="$(printf "$pack" | cut -d ':' -f 2)"
|
path="$(printf "$pack" | cut -d ':' -f 2)"
|
||||||
dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
|
dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
|
||||||
directories="DIRS$(printf "$pack" | cut -d ':' -f 3)"
|
directories="DIRS$(printf "$pack" | cut -d ':' -f 3)"
|
||||||
|
subtree="$(printf "$pack" | cut -d ':' -f 4)"
|
||||||
printf -- "- [$name](https://github.com/$path) ("
|
printf -- "- [$name](https://github.com/$path) ("
|
||||||
|
|
||||||
subdirs=""
|
subdirs=""
|
||||||
for subdir in ${!directories}; do
|
for subdir in ${!directories}; do
|
||||||
if [ -d "$dir/$subdir" ]; then
|
if [ -d "${dir}${subtree:-/}${subdir}" ]; then
|
||||||
base="$(basename "$subdir")"
|
base="$(basename "$subdir")"
|
||||||
if [[ "$subdirs" != *"$base"* ]]; then
|
if [[ "$subdirs" != *"$base"* ]]; then
|
||||||
subdirs="$subdirs, $base"
|
subdirs="$subdirs, $base"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
copy_dir "$dir" "$subdir"
|
copy_dir "${dir}${subtree}" "$subdir"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -45,8 +46,9 @@ extract() {
|
|||||||
name="$(printf "$pack" | cut -d ':' -f 1)"
|
name="$(printf "$pack" | cut -d ':' -f 1)"
|
||||||
path="$(printf "$pack" | cut -d ':' -f 2)"
|
path="$(printf "$pack" | cut -d ':' -f 2)"
|
||||||
dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
|
dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
|
||||||
|
subtree="$(printf "$pack" | cut -d ':' -f 4)"
|
||||||
|
|
||||||
if [ -d "$dir/plugin" ]; then
|
if [ -d "$dir${subtree:-/}plugin" ]; then
|
||||||
printf "Possible error (plugin directory exists): $path\n"
|
printf "Possible error (plugin directory exists): $path\n"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -72,17 +74,15 @@ PACKS="
|
|||||||
blade:xsbeats/vim-blade
|
blade:xsbeats/vim-blade
|
||||||
c++11:octol/vim-cpp-enhanced-highlight
|
c++11:octol/vim-cpp-enhanced-highlight
|
||||||
c/c++:vim-jp/cpp-vim
|
c/c++:vim-jp/cpp-vim
|
||||||
c-extensions:kergoth/aftersyntaxc.vim
|
|
||||||
clojure:guns/vim-clojure-static
|
clojure:guns/vim-clojure-static
|
||||||
coffee-script:kchmck/vim-coffee-script
|
coffee-script:kchmck/vim-coffee-script
|
||||||
css:JulesWang/css.vim
|
css:JulesWang/css.vim
|
||||||
csv:chrisbra/csv.vim
|
|
||||||
cucumber:tpope/vim-cucumber
|
cucumber:tpope/vim-cucumber
|
||||||
dockerfile:honza/dockerfile.vim
|
dockerfile:honza/dockerfile.vim
|
||||||
elixir:elixir-lang/vim-elixir
|
elixir:elixir-lang/vim-elixir
|
||||||
emberscript:heartsentwined/vim-ember-script
|
emberscript:heartsentwined/vim-ember-script
|
||||||
emblem:heartsentwined/vim-emblem
|
emblem:heartsentwined/vim-emblem
|
||||||
erlang:oscarh/vimerl
|
erlang:hcs42/vim-erlang-runtime
|
||||||
git:tpope/vim-git
|
git:tpope/vim-git
|
||||||
go:fatih/vim-go:_BASIC
|
go:fatih/vim-go:_BASIC
|
||||||
haml:tpope/vim-haml
|
haml:tpope/vim-haml
|
||||||
@@ -93,7 +93,7 @@ PACKS="
|
|||||||
jade:digitaltoad/vim-jade
|
jade:digitaltoad/vim-jade
|
||||||
jasmine:glanotte/vim-jasmine
|
jasmine:glanotte/vim-jasmine
|
||||||
javascript:pangloss/vim-javascript
|
javascript:pangloss/vim-javascript
|
||||||
json:leshill/vim-json
|
json:sheerun/vim-json
|
||||||
jst:briancollins/vim-jst
|
jst:briancollins/vim-jst
|
||||||
latex:LaTeX-Box-Team/LaTeX-Box
|
latex:LaTeX-Box-Team/LaTeX-Box
|
||||||
less:groenewege/vim-less
|
less:groenewege/vim-less
|
||||||
@@ -106,6 +106,7 @@ PACKS="
|
|||||||
perl:vim-perl/vim-perl
|
perl:vim-perl/vim-perl
|
||||||
php:StanAngeloff/php.vim
|
php:StanAngeloff/php.vim
|
||||||
puppet:rodjek/vim-puppet
|
puppet:rodjek/vim-puppet
|
||||||
|
powershell:Persistent13/vim-ps1
|
||||||
protobuf:uarun/vim-protobuf
|
protobuf:uarun/vim-protobuf
|
||||||
python:mitsuhiko/vim-python-combined
|
python:mitsuhiko/vim-python-combined
|
||||||
r-lang:vim-scripts/R.vim
|
r-lang:vim-scripts/R.vim
|
||||||
@@ -119,14 +120,17 @@ PACKS="
|
|||||||
systemd:kurayama/systemd-vim-syntax
|
systemd:kurayama/systemd-vim-syntax
|
||||||
swift:toyamarinyon/vim-swift
|
swift:toyamarinyon/vim-swift
|
||||||
textile:timcharper/textile.vim
|
textile:timcharper/textile.vim
|
||||||
tmux:acustodioo/vim-tmux
|
tmux:tejr/vim-tmux
|
||||||
tomdoc:duwanis/tomdoc.vim
|
tomdoc:duwanis/tomdoc.vim
|
||||||
typescript:leafgarland/typescript-vim
|
typescript:leafgarland/typescript-vim
|
||||||
vbnet:vim-scripts/vbnet.vim
|
vbnet:vim-scripts/vbnet.vim
|
||||||
|
thrift:solarnz/thrift.vim
|
||||||
toml:cespare/vim-toml
|
toml:cespare/vim-toml
|
||||||
twig:beyondwords/vim-twig
|
twig:beyondwords/vim-twig
|
||||||
xls:vim-scripts/XSLT-syntax
|
xls:vim-scripts/XSLT-syntax
|
||||||
yard:sheerun/vim-yardoc
|
yard:sheerun/vim-yardoc
|
||||||
|
vala:tkztmk/vim-vala
|
||||||
|
vm:lepture/vim-velocity
|
||||||
css-color:ap/vim-css-color
|
css-color:ap/vim-css-color
|
||||||
"
|
"
|
||||||
|
|
||||||
|
|||||||
@@ -1,29 +1,35 @@
|
|||||||
" Vim compiler file
|
" Vim compiler file
|
||||||
" Compiler: Cargo Compiler
|
" Compiler: Cargo Compiler
|
||||||
" Maintainer: Damien Radtke <damienradtke@gmail.com>
|
" Maintainer: Damien Radtke <damienradtke@gmail.com>
|
||||||
" Latest Revision: 2014 Sep 18
|
" Latest Revision: 2014 Sep 24
|
||||||
|
|
||||||
if exists("current_compiler")
|
if exists('current_compiler')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
runtime compiler/rustc.vim
|
||||||
let current_compiler = "cargo"
|
let current_compiler = "cargo"
|
||||||
|
|
||||||
if exists(":CompilerSet") != 2
|
if exists(':CompilerSet') != 2
|
||||||
command -nargs=* CompilerSet setlocal <args>
|
command -nargs=* CompilerSet setlocal <args>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CompilerSet errorformat&
|
if exists('g:cargo_makeprg_params')
|
||||||
CompilerSet makeprg=cargo\ $*
|
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
|
" Allow a configurable global Cargo.toml name. This makes it easy to
|
||||||
" support variations like 'cargo.toml'.
|
" support variations like 'cargo.toml'.
|
||||||
if !exists('g:cargo_toml_name')
|
let s:cargo_manifest_name = get(g:, 'cargo_manifest_name', 'Cargo.toml')
|
||||||
let g:cargo_toml_name = 'Cargo.toml'
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:toml_dir = fnamemodify(findfile(g:cargo_toml_name, '.;'), ':p:h').'/'
|
function! s:is_absolute(path)
|
||||||
|
return a:path[0] == '/' || a:path =~ '[A-Z]\+:'
|
||||||
|
endfunction
|
||||||
|
|
||||||
if s:toml_dir != ''
|
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
|
augroup cargo
|
||||||
au!
|
au!
|
||||||
au QuickfixCmdPost make call s:FixPaths()
|
au QuickfixCmdPost make call s:FixPaths()
|
||||||
@@ -33,15 +39,25 @@ if s:toml_dir != ''
|
|||||||
" to be relative to the current directory instead of Cargo.toml.
|
" to be relative to the current directory instead of Cargo.toml.
|
||||||
function! s:FixPaths()
|
function! s:FixPaths()
|
||||||
let qflist = getqflist()
|
let qflist = getqflist()
|
||||||
|
let manifest = s:local_manifest
|
||||||
for qf in qflist
|
for qf in qflist
|
||||||
if !qf['valid']
|
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
|
continue
|
||||||
endif
|
endif
|
||||||
let filename = bufname(qf['bufnr'])
|
let filename = bufname(qf.bufnr)
|
||||||
if stridx(filename, s:toml_dir) == -1
|
if s:is_absolute(filename)
|
||||||
let filename = s:toml_dir.filename
|
continue
|
||||||
endif
|
endif
|
||||||
let qf['filename'] = simplify(s:toml_dir.bufname(qf['bufnr']))
|
let qf.filename = simplify(manifest.filename)
|
||||||
call remove(qf, 'bufnr')
|
call remove(qf, 'bufnr')
|
||||||
endfor
|
endfor
|
||||||
call setqflist(qflist, 'r')
|
call setqflist(qflist, 'r')
|
||||||
|
|||||||
@@ -1,80 +0,0 @@
|
|||||||
" Erlang compiler file
|
|
||||||
" Language: Erlang
|
|
||||||
" Maintainer: Pawel 'kTT' Salata <rockplayer.pl@gmail.com>
|
|
||||||
" URL: http://ktototaki.info
|
|
||||||
|
|
||||||
if exists("current_compiler")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
let current_compiler = "erlang"
|
|
||||||
|
|
||||||
if exists(":CompilerSet") != 2
|
|
||||||
command -nargs=* CompilerSet setlocal <args>
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:erlangCheckFile')
|
|
||||||
let g:erlangCheckFile = "~/.vim/compiler/erlang_check_file.erl"
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:erlangHighlightErrors')
|
|
||||||
let g:erlangHighlightErrors = 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
let b:error_list = {}
|
|
||||||
let b:is_showing_msg = 0
|
|
||||||
|
|
||||||
function! HighlightErlangErrors()
|
|
||||||
if match(getline(1), "#!.*escript") != -1
|
|
||||||
setlocal makeprg=escript\ -s\ %
|
|
||||||
else
|
|
||||||
execute "setlocal makeprg=" . g:erlangCheckFile . "\\ \%"
|
|
||||||
endif
|
|
||||||
silent make!
|
|
||||||
call s:clear_matches()
|
|
||||||
for error in getqflist()
|
|
||||||
let item = {}
|
|
||||||
let item['lnum'] = error.lnum
|
|
||||||
let item['msg'] = error.text
|
|
||||||
let b:error_list[error.lnum] = item
|
|
||||||
call matchadd('SpellBad', "\\%" . error.lnum . "l")
|
|
||||||
endfor
|
|
||||||
if len(getqflist())
|
|
||||||
redraw!
|
|
||||||
endif
|
|
||||||
call s:show_msg()
|
|
||||||
setlocal makeprg=erlc\ %
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:show_msg()
|
|
||||||
let pos = getpos(".")
|
|
||||||
if has_key(b:error_list, pos[1])
|
|
||||||
let item = get(b:error_list, pos[1])
|
|
||||||
echo item.msg
|
|
||||||
let b:is_showing_msg = 1
|
|
||||||
else
|
|
||||||
if exists("b:is_showing_msg") && b:is_showing_msg == 1
|
|
||||||
echo
|
|
||||||
let b:is_showing_msg = 0
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endf
|
|
||||||
|
|
||||||
function! s:clear_matches()
|
|
||||||
call clearmatches()
|
|
||||||
let b:error_list = {}
|
|
||||||
if exists("b:is_showing_msg") && b:is_showing_msg == 1
|
|
||||||
echo
|
|
||||||
let b:is_showing_msg = 0
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
CompilerSet makeprg=erlc\ %
|
|
||||||
CompilerSet errorformat=%f:%l:\ %tarning:\ %m,%E%f:%l:\ %m
|
|
||||||
|
|
||||||
if g:erlangHighlightErrors
|
|
||||||
autocmd BufLeave *.erl call s:clear_matches()
|
|
||||||
autocmd BufEnter *.erl call s:clear_matches()
|
|
||||||
autocmd BufWritePost *.erl call HighlightErlangErrors()
|
|
||||||
autocmd CursorHold *.erl call s:show_msg()
|
|
||||||
autocmd CursorMoved *.erl call s:show_msg()
|
|
||||||
endif
|
|
||||||
30
compiler/sbt.vim
Normal file
30
compiler/sbt.vim
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
" Vim compiler file
|
||||||
|
" Language: Scala SBT (http://www.scala-sbt.org/)
|
||||||
|
" Maintainer: Derek Wyatt
|
||||||
|
" URL: https://github.com/derekwyatt/vim-scala
|
||||||
|
" License: Apache 2
|
||||||
|
" ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if exists('current_compiler')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let current_compiler = 'sbt'
|
||||||
|
|
||||||
|
if exists(':CompilerSet') != 2 " older Vim always used :setlocal
|
||||||
|
command -nargs=* CompilerSet setlocal <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:cpo_save = &cpo
|
||||||
|
set cpo-=C
|
||||||
|
|
||||||
|
CompilerSet makeprg=sbt\ -Dsbt.log.noformat=true\ compile
|
||||||
|
|
||||||
|
CompilerSet errorformat=
|
||||||
|
\%E\ %#[error]\ %f:%l:\ %m,%C\ %#[error]\ %p^,%-C%.%#,%Z,
|
||||||
|
\%W\ %#[warn]\ %f:%l:\ %m,%C\ %#[warn]\ %p^,%-C%.%#,%Z,
|
||||||
|
\%-G%.%#
|
||||||
|
|
||||||
|
let &cpo = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
|
||||||
|
" vim:set sw=2 sts=2 ts=8 et:
|
||||||
@@ -3,6 +3,14 @@ if exists("current_compiler")
|
|||||||
endif
|
endif
|
||||||
let current_compiler = "typescript"
|
let current_compiler = "typescript"
|
||||||
|
|
||||||
CompilerSet makeprg=tsc\ $*\ %
|
if !exists("g:typescript_compiler_binary")
|
||||||
|
let g:typescript_compiler_binary = "tsc"
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("g:typescript_compiler_options")
|
||||||
|
let g:typescript_compiler_options = ""
|
||||||
|
endif
|
||||||
|
|
||||||
|
let &l:makeprg = g:typescript_compiler_binary . ' ' . g:typescript_compiler_options . ' $* %'
|
||||||
|
|
||||||
CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m
|
CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ function! s:DetectCoffee()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
autocmd BufNewFile,BufRead * call s:DetectCoffee()
|
autocmd BufNewFile,BufRead * call s:DetectCoffee()
|
||||||
au BufRead,BufNewFile *.csv,*.dat,*.tsv,*.tab set filetype=csv
|
|
||||||
autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber
|
autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber
|
||||||
au BufNewFile,BufRead Dockerfile set filetype=dockerfile
|
au BufNewFile,BufRead Dockerfile set filetype=dockerfile
|
||||||
au BufRead,BufNewFile *.eex set filetype=eelixir
|
au BufRead,BufNewFile *.eex set filetype=eelixir
|
||||||
@@ -29,11 +28,11 @@ 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
|
||||||
autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab
|
autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab
|
||||||
autocmd BufNewFile,BufRead *.git/{,modules/**/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit
|
autocmd BufNewFile,BufRead *.git/{,modules/**/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit
|
||||||
autocmd BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules set ft=gitconfig
|
autocmd BufNewFile,BufRead *.git/config,.gitconfig,gitconfig,.gitmodules set ft=gitconfig
|
||||||
autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig
|
autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig
|
||||||
autocmd BufNewFile,BufRead *.git/modules/**/config set ft=gitconfig
|
autocmd BufNewFile,BufRead *.git/modules/**/config set ft=gitconfig
|
||||||
autocmd BufNewFile,BufRead git-rebase-todo set ft=gitrebase
|
autocmd BufNewFile,BufRead git-rebase-todo set ft=gitrebase
|
||||||
autocmd BufNewFile,BufRead .gitsendemail.* set ft=gitsendemail
|
autocmd BufNewFile,BufRead .gitsendemail.* set ft=gitsendemail
|
||||||
autocmd BufNewFile,BufRead *.git/**
|
autocmd BufNewFile,BufRead *.git/**
|
||||||
\ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
|
\ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
|
||||||
\ set ft=git |
|
\ set ft=git |
|
||||||
@@ -77,15 +76,11 @@ fun! s:SelectJavascript()
|
|||||||
endfun
|
endfun
|
||||||
au BufNewFile,BufRead * call s:SelectJavascript()
|
au BufNewFile,BufRead * call s:SelectJavascript()
|
||||||
autocmd BufNewFile,BufRead *.json set filetype=json
|
autocmd BufNewFile,BufRead *.json set filetype=json
|
||||||
augroup json_autocmd
|
autocmd BufNewFile,BufRead *.jsonp set filetype=json
|
||||||
autocmd!
|
|
||||||
autocmd FileType json setlocal autoindent
|
|
||||||
autocmd FileType json setlocal formatoptions=tcq2l
|
|
||||||
autocmd FileType json setlocal foldmethod=syntax
|
|
||||||
augroup END
|
|
||||||
au BufNewFile,BufRead *.ejs set filetype=jst
|
au BufNewFile,BufRead *.ejs set filetype=jst
|
||||||
au BufNewFile,BufRead *.jst set filetype=jst
|
au BufNewFile,BufRead *.jst set filetype=jst
|
||||||
au BufNewFile,BufRead *.hamljs set filetype=jst
|
au BufNewFile,BufRead *.hamljs set filetype=jst
|
||||||
|
au BufNewFile,BufRead *.ect set filetype=jst
|
||||||
autocmd BufNewFile,BufRead *.less setf less
|
autocmd BufNewFile,BufRead *.less setf less
|
||||||
au BufNewFile,BufRead *.liquid set ft=liquid
|
au BufNewFile,BufRead *.liquid set ft=liquid
|
||||||
au BufNewFile,BufRead */_layouts/*.html,*/_includes/*.html set ft=liquid
|
au BufNewFile,BufRead */_layouts/*.html,*/_includes/*.html set ft=liquid
|
||||||
@@ -142,8 +137,12 @@ function! s:DetectPerl6()
|
|||||||
endwhile
|
endwhile
|
||||||
endfunction
|
endfunction
|
||||||
autocmd BufReadPost *.pl,*.pm,*.t call s:DetectPerl6()
|
autocmd BufReadPost *.pl,*.pm,*.t call s:DetectPerl6()
|
||||||
autocmd BufNew,BufRead *.nqp setf perl6
|
autocmd BufNew,BufNewFile,BufRead *.nqp setf perl6
|
||||||
autocmd BufNewFile,BufRead *.proto setfiletype proto
|
autocmd BufNewFile,BufRead *.proto setfiletype proto
|
||||||
|
au BufNewFile,BufRead *.ps1 set ft=ps1
|
||||||
|
au BufNewFile,BufRead *.psd1 set ft=ps1
|
||||||
|
au BufNewFile,BufRead *.psm1 set ft=ps1
|
||||||
|
au BufNewFile,BufRead *.ps1xml set ft=ps1xml
|
||||||
au! BufRead,BufNewFile *.pp setfiletype puppet
|
au! BufRead,BufNewFile *.pp setfiletype puppet
|
||||||
au! BufRead,BufNewFile Puppetfile setfiletype ruby
|
au! BufRead,BufNewFile Puppetfile setfiletype ruby
|
||||||
function! s:setf(filetype) abort
|
function! s:setf(filetype) abort
|
||||||
@@ -174,14 +173,15 @@ au BufNewFile,BufRead [Bb]uildfile call s:setf('ruby')
|
|||||||
au BufNewFile,BufRead Appraisals call s:setf('ruby')
|
au BufNewFile,BufRead Appraisals call s:setf('ruby')
|
||||||
au BufNewFile,BufRead Podfile,*.podspec call s:setf('ruby')
|
au BufNewFile,BufRead Podfile,*.podspec call s:setf('ruby')
|
||||||
au BufRead,BufNewFile *.rs set filetype=rust
|
au BufRead,BufNewFile *.rs set filetype=rust
|
||||||
au BufRead,BufNewFile *.sbt set filetype=sbt
|
au BufRead,BufNewFile *.sbt set filetype=sbt.scala
|
||||||
fun! s:DetectScala()
|
fun! s:DetectScala()
|
||||||
if getline(1) == '#!/usr/bin/env scala'
|
if getline(1) =~# '^#!\(/usr\)\?/bin/env\s\+scalas\?'
|
||||||
set filetype=scala
|
set filetype=scala
|
||||||
endif
|
endif
|
||||||
endfun
|
endfun
|
||||||
au BufRead,BufNewFile *.scala,*.sbt set filetype=scala
|
au BufRead,BufNewFile *.scala set filetype=scala
|
||||||
au BufRead,BufNewFile * call s:DetectScala()
|
au BufRead,BufNewFile * call s:DetectScala()
|
||||||
|
au BufRead,BufNewFile *.sbt setfiletype sbt.scala
|
||||||
autocmd BufNewFile,BufRead *.slim set filetype=slim
|
autocmd BufNewFile,BufRead *.slim set filetype=slim
|
||||||
autocmd BufNewFile,BufReadPost *.styl set filetype=stylus
|
autocmd BufNewFile,BufReadPost *.styl set filetype=stylus
|
||||||
autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus
|
autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus
|
||||||
@@ -195,8 +195,14 @@ au BufNewFile,BufRead *.swap set filetype=systemd
|
|||||||
au BufNewFile,BufRead *.target set filetype=systemd
|
au BufNewFile,BufRead *.target set filetype=systemd
|
||||||
au BufNewFile,BufRead *.timer set filetype=systemd
|
au BufNewFile,BufRead *.timer set filetype=systemd
|
||||||
au BufRead,BufNewFile *.textile set filetype=textile
|
au BufRead,BufNewFile *.textile set filetype=textile
|
||||||
autocmd BufNewFile,BufRead .tmux.conf*,tmux.conf* setf tmux
|
au BufNewFile,BufRead *.thrift setlocal filetype=thrift
|
||||||
|
autocmd BufNewFile,BufRead {.,}tmux.conf{.*,} setlocal filetype=tmux
|
||||||
|
autocmd BufNewFile,BufRead {.,}tmux.conf{.*,} setlocal commentstring=#\ %s
|
||||||
autocmd BufNewFile,BufRead *.toml set filetype=toml
|
autocmd BufNewFile,BufRead *.toml set filetype=toml
|
||||||
|
autocmd BufNewFile,BufRead Cargo.lock set filetype=toml
|
||||||
autocmd BufNewFile,BufRead *.twig set filetype=twig
|
autocmd BufNewFile,BufRead *.twig set filetype=twig
|
||||||
autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
|
autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
|
||||||
autocmd BufNewFile,BufRead *.ts setlocal filetype=typescript
|
autocmd BufNewFile,BufRead *.ts setlocal filetype=typescript
|
||||||
|
autocmd BufRead *.vala,*.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
|
||||||
|
au BufRead,BufNewFile *.vala,*.vapi setfiletype vala
|
||||||
|
au BufRead,BufNewFile *.vm set ft=velocity syntax=velocity
|
||||||
|
|||||||
2549
ftplugin/csv.vim
2549
ftplugin/csv.vim
File diff suppressed because it is too large
Load Diff
@@ -1,154 +0,0 @@
|
|||||||
" Vim ftplugin file
|
|
||||||
" Language: Erlang
|
|
||||||
" Maintainer: Oscar Hellström <oscar@oscarh.net>
|
|
||||||
" URL: http://personal.oscarh.net
|
|
||||||
" Contributor: Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
|
||||||
" Version: 2010-09-03
|
|
||||||
" ------------------------------------------------------------------------------
|
|
||||||
" Usage:
|
|
||||||
"
|
|
||||||
" To enable folding put in your vimrc:
|
|
||||||
" set foldenable
|
|
||||||
"
|
|
||||||
" Folding will make only one fold for a complete function, even though it has
|
|
||||||
" more than one function head and body.
|
|
||||||
"
|
|
||||||
" To change this behaviour put in your vimrc file:
|
|
||||||
" let g:erlangFoldSplitFunction=1
|
|
||||||
"
|
|
||||||
" ------------------------------------------------------------------------------
|
|
||||||
" Plugin init
|
|
||||||
if exists("b:did_ftplugin")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Don't load any other
|
|
||||||
let b:did_ftplugin=1
|
|
||||||
|
|
||||||
if exists('s:doneFunctionDefinitions')
|
|
||||||
call s:SetErlangOptions()
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:doneFunctionDefinitions=1
|
|
||||||
|
|
||||||
" Local settings
|
|
||||||
function s:SetErlangOptions()
|
|
||||||
compiler erlang
|
|
||||||
if version >= 700
|
|
||||||
setlocal omnifunc=erlangcomplete#Complete
|
|
||||||
endif
|
|
||||||
|
|
||||||
setlocal comments=:%%%,:%%,:%
|
|
||||||
setlocal commentstring=%%s
|
|
||||||
|
|
||||||
setlocal foldmethod=expr
|
|
||||||
setlocal foldexpr=GetErlangFold(v:lnum)
|
|
||||||
setlocal foldtext=ErlangFoldText()
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Define folding functions
|
|
||||||
if !exists("*GetErlangFold")
|
|
||||||
" Folding params
|
|
||||||
let s:ErlangFunBegin = '^\a\w*(.*$'
|
|
||||||
let s:ErlangFunEnd = '^[^%]*\.\s*\(%.*\)\?$'
|
|
||||||
let s:ErlangBlankLine = '^\s*\(%.*\)\?$'
|
|
||||||
|
|
||||||
" Auxiliary fold functions
|
|
||||||
function s:GetNextNonBlank(lnum)
|
|
||||||
let lnum = nextnonblank(a:lnum + 1)
|
|
||||||
let line = getline(lnum)
|
|
||||||
while line =~ s:ErlangBlankLine && 0 != lnum
|
|
||||||
let lnum = nextnonblank(lnum + 1)
|
|
||||||
let line = getline(lnum)
|
|
||||||
endwhile
|
|
||||||
return lnum
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function s:GetFunName(str)
|
|
||||||
return matchstr(a:str, '^\a\w*(\@=')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function s:GetFunArgs(str, lnum)
|
|
||||||
let str = a:str
|
|
||||||
let lnum = a:lnum
|
|
||||||
while str !~ '->\s*\(%.*\)\?$'
|
|
||||||
let lnum = s:GetNextNonBlank(lnum)
|
|
||||||
if 0 == lnum " EOF
|
|
||||||
return ""
|
|
||||||
endif
|
|
||||||
let str .= getline(lnum)
|
|
||||||
endwhile
|
|
||||||
return matchstr(str,
|
|
||||||
\ '\(^(\s*\)\@<=.*\(\s*)\(\s\+when\s\+.*\)\?\s\+->\s*\(%.*\)\?$\)\@=')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function s:CountFunArgs(arguments)
|
|
||||||
let pos = 0
|
|
||||||
let ac = 0 " arg count
|
|
||||||
let arguments = a:arguments
|
|
||||||
|
|
||||||
" Change list / tuples into just one A(rgument)
|
|
||||||
let erlangTuple = '{\([A-Za-z_,|=\-\[\]]\|\s\)*}'
|
|
||||||
let erlangList = '\[\([A-Za-z_,|=\-{}]\|\s\)*\]'
|
|
||||||
|
|
||||||
" FIXME: Use searchpair?
|
|
||||||
while arguments =~ erlangTuple
|
|
||||||
let arguments = substitute(arguments, erlangTuple, "A", "g")
|
|
||||||
endwhile
|
|
||||||
" FIXME: Use searchpair?
|
|
||||||
while arguments =~ erlangList
|
|
||||||
let arguments = substitute(arguments, erlangList, "A", "g")
|
|
||||||
endwhile
|
|
||||||
|
|
||||||
let len = strlen(arguments)
|
|
||||||
while pos < len && pos > -1
|
|
||||||
let ac += 1
|
|
||||||
let pos = matchend(arguments, ',\s*', pos)
|
|
||||||
endwhile
|
|
||||||
return ac
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Main fold function
|
|
||||||
function GetErlangFold(lnum)
|
|
||||||
let lnum = a:lnum
|
|
||||||
let line = getline(lnum)
|
|
||||||
|
|
||||||
if line =~ s:ErlangFunEnd
|
|
||||||
return '<1'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if line =~ s:ErlangFunBegin && foldlevel(lnum - 1) == 1
|
|
||||||
if exists("g:erlangFoldSplitFunction") && g:erlangFoldSplitFunction
|
|
||||||
return '>1'
|
|
||||||
else
|
|
||||||
return '1'
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if line =~ s:ErlangFunBegin
|
|
||||||
return '>1'
|
|
||||||
endif
|
|
||||||
|
|
||||||
return '='
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Erlang fold description (foldtext function)
|
|
||||||
function ErlangFoldText()
|
|
||||||
let foldlen = v:foldend - v:foldstart
|
|
||||||
if 1 < foldlen
|
|
||||||
let lines = "lines"
|
|
||||||
else
|
|
||||||
let lines = "line"
|
|
||||||
endif
|
|
||||||
let line = getline(v:foldstart)
|
|
||||||
let name = s:GetFunName(line)
|
|
||||||
let arguments = s:GetFunArgs(strpart(line, strlen(name)), v:foldstart)
|
|
||||||
let argcount = s:CountFunArgs(arguments)
|
|
||||||
let retval = "+" . v:folddashes . " " . name . "/" . argcount
|
|
||||||
let retval .= " (" . foldlen . " " . lines . ")"
|
|
||||||
return retval
|
|
||||||
endfunction
|
|
||||||
endif
|
|
||||||
|
|
||||||
call s:SetErlangOptions()
|
|
||||||
@@ -1,295 +0,0 @@
|
|||||||
" Erlang refactor file
|
|
||||||
" Language: Erlang
|
|
||||||
" Maintainer: Pawel 'kTT' Salata <rockplayer.pl@gmail.com>
|
|
||||||
" URL: http://ktototaki.info
|
|
||||||
|
|
||||||
if exists("b:did_ftplugin_erlang")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Don't load any other
|
|
||||||
let b:did_ftplugin_erlang=1
|
|
||||||
|
|
||||||
if !exists('g:erlangRefactoring') || g:erlangRefactoring == 0
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !exists('g:erlangWranglerPath')
|
|
||||||
let g:erlangWranglerPath = '/usr/share/wrangler/'
|
|
||||||
endif
|
|
||||||
|
|
||||||
if glob(g:erlangWranglerPath) == ""
|
|
||||||
call confirm("Wrong path to wrangler dir")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
autocmd VimLeavePre * call StopWranglerServer()
|
|
||||||
|
|
||||||
let s:erlangServerName = "wrangler_vim"
|
|
||||||
|
|
||||||
" Starting background erlang session with wrangler on
|
|
||||||
function! StartWranglerServer()
|
|
||||||
let wranglerEbinDir = g:erlangWranglerPath . "/ebin"
|
|
||||||
let command = "erl_call -s -sname " . s:erlangServerName . " -x 'erl -pa " . wranglerEbinDir . "'"
|
|
||||||
call system(command)
|
|
||||||
call s:send_rpc('application', 'start', '[wrangler_app]')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Stopping erlang session
|
|
||||||
function! StopWranglerServer()
|
|
||||||
echo s:send_rpc('erlang', 'halt', '')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Sending rpc call to erlang session
|
|
||||||
function! s:send_rpc(module, fun, args)
|
|
||||||
let command = "erl_call -sname " . s:erlangServerName . " -a '" . a:module . " " . a:fun . " " . a:args . "'"
|
|
||||||
let result = system(command)
|
|
||||||
if match(result, 'erl_call: failed to connect to node .*') != -1
|
|
||||||
call StartWranglerServer()
|
|
||||||
return system(command)
|
|
||||||
endif
|
|
||||||
return result
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ErlangUndo()
|
|
||||||
echo s:send_rpc("wrangler_undo_server", "undo", "[]")
|
|
||||||
:e!
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:trim(text)
|
|
||||||
return substitute(a:text, "^\\s\\+\\|\\s\\+$", "", "g")
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! s:get_msg(result, tuple_start)
|
|
||||||
let msg_begin = '{' . a:tuple_start . ','
|
|
||||||
let matching_start = match(a:result, msg_begin)
|
|
||||||
if matching_start != -1
|
|
||||||
return s:trim(matchstr(a:result, '[^}]*', matching_start + strlen(msg_begin)))
|
|
||||||
endif
|
|
||||||
return ""
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Check if there is an error in result
|
|
||||||
function! s:check_for_error(result)
|
|
||||||
let msg = s:get_msg(a:result, 'ok')
|
|
||||||
if msg != ""
|
|
||||||
return [0, msg]
|
|
||||||
endif
|
|
||||||
let msg = s:get_msg(a:result, 'warning')
|
|
||||||
if msg != ""
|
|
||||||
return [1, msg]
|
|
||||||
endif
|
|
||||||
let msg = s:get_msg(a:result, 'error')
|
|
||||||
if msg != ""
|
|
||||||
return [2, msg]
|
|
||||||
endif
|
|
||||||
return [-1, ""]
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Sending apply changes to file
|
|
||||||
function! s:send_confirm()
|
|
||||||
let choice = confirm("What do you want?", "&Preview\n&Confirm\nCa&ncel", 0)
|
|
||||||
if choice == 1
|
|
||||||
echo "TODO: Display preview :)"
|
|
||||||
elseif choice == 2
|
|
||||||
let module = 'wrangler_preview_server'
|
|
||||||
let fun = 'commit'
|
|
||||||
let args = '[]'
|
|
||||||
return s:send_rpc(module, fun, args)
|
|
||||||
else
|
|
||||||
let module = 'wrangler_preview_server'
|
|
||||||
let fun = 'abort'
|
|
||||||
let args = '[]'
|
|
||||||
return s:send_rpc(module, fun, args)
|
|
||||||
echo "Canceled"
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Manually send confirm, for testing purpose only
|
|
||||||
function! SendConfirm()
|
|
||||||
echo s:send_confirm()
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Format and send function extracton call
|
|
||||||
function! s:call_extract(start_line, start_col, end_line, end_col, name)
|
|
||||||
let file = expand("%:p")
|
|
||||||
let module = 'wrangler'
|
|
||||||
let fun = 'fun_extraction'
|
|
||||||
let args = '["' . file . '", {' . a:start_line . ', ' . a:start_col . '}, {' . a:end_line . ', ' . a:end_col . '}, "' . a:name . '", ' . &sw . ']'
|
|
||||||
let result = s:send_rpc(module, fun, args)
|
|
||||||
let [error_code, msg] = s:check_for_error(result)
|
|
||||||
if error_code != 0
|
|
||||||
call confirm(msg)
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
echo "This files will be changed: " . matchstr(msg, "[^]]*", 1)
|
|
||||||
echo s:send_confirm()
|
|
||||||
return 1
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ErlangExtractFunction(mode) range
|
|
||||||
silent w!
|
|
||||||
let name = inputdialog("New function name: ")
|
|
||||||
if name != ""
|
|
||||||
if a:mode == "v"
|
|
||||||
let start_pos = getpos("'<")
|
|
||||||
let start_line = start_pos[1]
|
|
||||||
let start_col = start_pos[2]
|
|
||||||
|
|
||||||
let end_pos = getpos("'>")
|
|
||||||
let end_line = end_pos[1]
|
|
||||||
let end_col = end_pos[2]
|
|
||||||
elseif a:mode == "n"
|
|
||||||
let pos = getpos(".")
|
|
||||||
let start_line = pos[1]
|
|
||||||
let start_col = pos[2]
|
|
||||||
let end_line = pos[1]
|
|
||||||
let end_col = pos[2]
|
|
||||||
else
|
|
||||||
echo "Mode not supported."
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
if s:call_extract(start_line, start_col, end_line, end_col, name)
|
|
||||||
let temp = &autoread
|
|
||||||
set autoread
|
|
||||||
:e
|
|
||||||
if temp == 0
|
|
||||||
set noautoread
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
echo "Empty function name. Ignoring."
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
nmap <A-r>e :call ErlangExtractFunction("n")<ENTER>
|
|
||||||
vmap <A-r>e :call ErlangExtractFunction("v")<ENTER>
|
|
||||||
|
|
||||||
function! s:call_rename(mode, line, col, name, search_path)
|
|
||||||
let file = expand("%:p")
|
|
||||||
let module = 'wrangler'
|
|
||||||
let fun = 'rename_' . a:mode
|
|
||||||
let args = '["' . file .'", '
|
|
||||||
if a:mode != "mod"
|
|
||||||
let args = args . a:line . ', ' . a:col . ', '
|
|
||||||
endif
|
|
||||||
let args = args . '"' . a:name . '", ["' . a:search_path . '"], ' . &sw . ']'
|
|
||||||
let result = s:send_rpc(module, fun, args)
|
|
||||||
let [error_code, msg] = s:check_for_error(result)
|
|
||||||
if error_code != 0
|
|
||||||
call confirm(msg)
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
echo "This files will be changed: " . matchstr(msg, "[^]]*", 1)
|
|
||||||
echo s:send_confirm()
|
|
||||||
return 1
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ErlangRename(mode)
|
|
||||||
silent w!
|
|
||||||
if a:mode == "mod"
|
|
||||||
let name = inputdialog('Rename module to: ')
|
|
||||||
else
|
|
||||||
let name = inputdialog('Rename "' . expand("<cword>") . '" to: ')
|
|
||||||
endif
|
|
||||||
if name != ""
|
|
||||||
let search_path = expand("%:p:h")
|
|
||||||
"let search_path = inputdialog('Search path: ', expand("%:p:h"))
|
|
||||||
let pos = getpos(".")
|
|
||||||
let line = pos[1]
|
|
||||||
let col = pos[2]
|
|
||||||
let current_filename = expand("%")
|
|
||||||
let current_filepath = expand("%:p")
|
|
||||||
let new_filename = name . '.erl'
|
|
||||||
if s:call_rename(a:mode, line, col, name, search_path)
|
|
||||||
if a:mode == "mod"
|
|
||||||
execute ':bd ' . current_filename
|
|
||||||
execute ':e ' . new_filename
|
|
||||||
silent execute '!mv ' . current_filepath . ' ' . current_filepath . '.bak'
|
|
||||||
redraw!
|
|
||||||
else
|
|
||||||
let temp = &autoread
|
|
||||||
set autoread
|
|
||||||
:e
|
|
||||||
if temp == 0
|
|
||||||
set noautoread
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
echo "Empty name. Ignoring."
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ErlangRenameFunction()
|
|
||||||
call ErlangRename("fun")
|
|
||||||
endfunction
|
|
||||||
map <A-r>f :call ErlangRenameFunction()<ENTER>
|
|
||||||
|
|
||||||
function! ErlangRenameVariable()
|
|
||||||
call ErlangRename("var")
|
|
||||||
endfunction
|
|
||||||
map <A-r>v :call ErlangRenameVariable()<ENTER>
|
|
||||||
|
|
||||||
function! ErlangRenameModule()
|
|
||||||
call ErlangRename("mod")
|
|
||||||
endfunction
|
|
||||||
map <A-r>m :call ErlangRenameModule()<ENTER>
|
|
||||||
|
|
||||||
function! ErlangRenameProcess()
|
|
||||||
call ErlangRename("process")
|
|
||||||
endfunction
|
|
||||||
map <A-r>p :call ErlangRenameProcess()<ENTER>
|
|
||||||
|
|
||||||
function! s:call_tuple_fun_args(start_line, start_col, end_line, end_col, search_path)
|
|
||||||
let file = expand("%:p")
|
|
||||||
let module = 'wrangler'
|
|
||||||
let fun = 'tuple_funpar'
|
|
||||||
let args = '["' . file . '", {' . a:start_line . ', ' . a:start_col . '}, {' . a:end_line . ', ' . a:end_col . '}, ["' . a:search_path . '"], ' . &sw . ']'
|
|
||||||
let result = s:send_rpc(module, fun, args)
|
|
||||||
if s:check_for_error(result)
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
call s:send_confirm()
|
|
||||||
return 1
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! ErlangTupleFunArgs(mode)
|
|
||||||
silent w!
|
|
||||||
let search_path = expand("%:p:h")
|
|
||||||
"let search_path = inputdialog('Search path: ', expand("%:p:h"))
|
|
||||||
if a:mode == "v"
|
|
||||||
let start_pos = getpos("'<")
|
|
||||||
let start_line = start_pos[1]
|
|
||||||
let start_col = start_pos[2]
|
|
||||||
|
|
||||||
let end_pos = getpos("'>")
|
|
||||||
let end_line = end_pos[1]
|
|
||||||
let end_col = end_pos[2]
|
|
||||||
if s:call_tuple_fun_args(start_line, start_col, end_line, end_col, search_path)
|
|
||||||
let temp = &autoread
|
|
||||||
set autoread
|
|
||||||
:e
|
|
||||||
if temp == 0
|
|
||||||
set noautoread
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
elseif a:mode == "n"
|
|
||||||
let pos = getpos(".")
|
|
||||||
let line = pos[1]
|
|
||||||
let col = pos[2]
|
|
||||||
if s:call_tuple_fun_args(line, col, line, col, search_path)
|
|
||||||
let temp = &autoread
|
|
||||||
set autoread
|
|
||||||
:e
|
|
||||||
if temp == 0
|
|
||||||
set noautoread
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
echo "Mode not supported."
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
nmap <A-r>t :call ErlangTupleFunArgs("n")<ENTER>
|
|
||||||
vmap <A-r>t :call ErlangTupleFunArgs("v")<ENTER>
|
|
||||||
|
|
||||||
" vim: set foldmethod=marker:
|
|
||||||
@@ -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'
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ endif
|
|||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo-=C
|
set cpo-=C
|
||||||
|
|
||||||
|
setlocal iskeyword+=-
|
||||||
|
|
||||||
" Define some defaults in case the included ftplugins don't set them.
|
" Define some defaults in case the included ftplugins don't set them.
|
||||||
let s:undo_ftplugin = ""
|
let s:undo_ftplugin = ""
|
||||||
let s:browsefilter = "All Files (*.*)\t*.*\n"
|
let s:browsefilter = "All Files (*.*)\t*.*\n"
|
||||||
|
|||||||
@@ -64,14 +64,24 @@ setlocal efm+=%-G%.%#
|
|||||||
|
|
||||||
" Vim Windows {{{
|
" Vim Windows {{{
|
||||||
|
|
||||||
" Width of vertical splits
|
" Type of split, "new" for horiz. "vnew" for vert.
|
||||||
|
if !exists('g:LatexBox_split_type')
|
||||||
|
let g:LatexBox_split_type = "vnew"
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Length of vertical splits
|
||||||
|
if !exists('g:LatexBox_split_length')
|
||||||
|
let g:LatexBox_split_length = 15
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Width of horizontal splits
|
||||||
if !exists('g:LatexBox_split_width')
|
if !exists('g:LatexBox_split_width')
|
||||||
let g:LatexBox_split_width = 30
|
let g:LatexBox_split_width = 30
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Where vertical splits appear
|
" Where splits appear
|
||||||
if !exists('g:LatexBox_split_side')
|
if !exists('g:LatexBox_split_side')
|
||||||
let g:LatexBox_split_side = "leftabove"
|
let g:LatexBox_split_side = "aboveleft"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Resize when split?
|
" Resize when split?
|
||||||
@@ -229,12 +239,18 @@ endfunction
|
|||||||
|
|
||||||
" Default pdf viewer
|
" Default pdf viewer
|
||||||
if !exists('g:LatexBox_viewer')
|
if !exists('g:LatexBox_viewer')
|
||||||
if has('win32')
|
" On windows, 'running' a file will open it with the default program
|
||||||
" On windows, 'running' a file will open it with the default program
|
let s:viewer = ''
|
||||||
let g:LatexBox_viewer = ''
|
if has('unix')
|
||||||
else
|
" echo -n necessary as uname -s will append \n otherwise
|
||||||
let g:LatexBox_viewer = 'xdg-open'
|
let s:uname = system('echo -n $(uname -s)')
|
||||||
|
if s:uname == "Darwin"
|
||||||
|
let s:viewer = 'open'
|
||||||
|
else
|
||||||
|
let s:viewer = 'xdg-open'
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
let g:LatexBox_viewer = s:viewer
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! LatexBox_View(...)
|
function! LatexBox_View(...)
|
||||||
|
|||||||
@@ -459,7 +459,8 @@ function! s:GetLabelCache(file)
|
|||||||
|
|
||||||
if !has_key(s:LabelCache , a:file) || s:LabelCache[a:file][0] != getftime(a:file)
|
if !has_key(s:LabelCache , a:file) || s:LabelCache[a:file][0] != getftime(a:file)
|
||||||
" Open file in temporary split window for label extraction.
|
" Open file in temporary split window for label extraction.
|
||||||
silent execute '1sp +let\ labels=s:ExtractLabels()|let\ inputs=s:ExtractInputs()|quit! ' . fnameescape(a:file)
|
let main_tex_file = LatexBox_GetMainTexFile()
|
||||||
|
silent execute '1sp +let\ b:main_tex_file=main_tex_file|let\ labels=s:ExtractLabels()|let\ inputs=s:ExtractInputs()|quit! ' . fnameescape(a:file)
|
||||||
let s:LabelCache[a:file] = [ getftime(a:file), labels, inputs ]
|
let s:LabelCache[a:file] = [ getftime(a:file), labels, inputs ]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ function! LatexBox_GetMainFileName(...)
|
|||||||
" move up the directory tree until we find a .latexmain file.
|
" move up the directory tree until we find a .latexmain file.
|
||||||
" TODO: Should we be doing this recursion by default, or should there be a
|
" TODO: Should we be doing this recursion by default, or should there be a
|
||||||
" setting?
|
" setting?
|
||||||
while glob('*.latexmain') == ''
|
while glob('*.latexmain',1) == ''
|
||||||
let dirmodifier = dirmodifier.':h'
|
let dirmodifier = dirmodifier.':h'
|
||||||
let dirNew = fnameescape(expand(dirmodifier))
|
let dirNew = fnameescape(expand(dirmodifier))
|
||||||
" break from the loop if we cannot go up any further.
|
" break from the loop if we cannot go up any further.
|
||||||
@@ -41,7 +41,7 @@ function! LatexBox_GetMainFileName(...)
|
|||||||
exe 'cd '.dirLast
|
exe 'cd '.dirLast
|
||||||
endwhile
|
endwhile
|
||||||
|
|
||||||
let lheadfile = glob('*.latexmain')
|
let lheadfile = glob('*.latexmain',1)
|
||||||
if lheadfile != ''
|
if lheadfile != ''
|
||||||
" Remove the trailing .latexmain part of the filename... We never want
|
" Remove the trailing .latexmain part of the filename... We never want
|
||||||
" that.
|
" that.
|
||||||
|
|||||||
@@ -75,8 +75,8 @@ if g:LatexBox_fold_automatic == 1
|
|||||||
"
|
"
|
||||||
augroup FastFold
|
augroup FastFold
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd InsertEnter *.tex setlocal foldmethod=manual
|
autocmd InsertEnter *.tex if !&diff | setlocal foldmethod=manual | endif
|
||||||
autocmd InsertLeave *.tex setlocal foldmethod=expr
|
autocmd InsertLeave *.tex if !&diff | setlocal foldmethod=expr | endif
|
||||||
augroup end
|
augroup end
|
||||||
else
|
else
|
||||||
setl foldmethod=manual
|
setl foldmethod=manual
|
||||||
|
|||||||
@@ -443,10 +443,32 @@ function! LatexBox_LatexErrors(status, ...)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Redefine uniq() for compatibility with older Vim versions (< 7.4.218)
|
||||||
|
function! s:uniq(list)
|
||||||
|
if exists('*uniq')
|
||||||
|
return uniq(a:list)
|
||||||
|
elseif len(a:list) <= 1
|
||||||
|
return a:list
|
||||||
|
endif
|
||||||
|
|
||||||
|
let last_element = get(a:list,0)
|
||||||
|
let uniq_list = [last_element]
|
||||||
|
|
||||||
|
for i in range(1, len(a:list)-1)
|
||||||
|
let next_element = get(a:list, i)
|
||||||
|
if last_element == next_element
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
let last_element = next_element
|
||||||
|
call add(uniq_list, next_element)
|
||||||
|
endfor
|
||||||
|
return uniq_list
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:log_contains_error(file)
|
function! s:log_contains_error(file)
|
||||||
let lines = readfile(a:file)
|
let lines = readfile(a:file)
|
||||||
let lines = filter(lines, 'v:val =~ ''^.*:\d\+: ''')
|
let lines = filter(lines, 'v:val =~ ''^.*:\d\+: ''')
|
||||||
let lines = uniq(map(lines, 'matchstr(v:val, ''^.*\ze:\d\+:'')'))
|
let lines = s:uniq(map(lines, 'matchstr(v:val, ''^.*\ze:\d\+:'')'))
|
||||||
let lines = filter(lines, 'filereadable(fnameescape(v:val))')
|
let lines = filter(lines, 'filereadable(fnameescape(v:val))')
|
||||||
return len(lines) > 0
|
return len(lines) > 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -5,31 +5,31 @@ if exists("g:LatexBox_no_mappings")
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" latexmk {{{
|
" latexmk {{{
|
||||||
map <buffer> <LocalLeader>ll :Latexmk<CR>
|
noremap <buffer> <LocalLeader>ll :Latexmk<CR>
|
||||||
map <buffer> <LocalLeader>lL :Latexmk!<CR>
|
noremap <buffer> <LocalLeader>lL :Latexmk!<CR>
|
||||||
map <buffer> <LocalLeader>lc :LatexmkClean<CR>
|
noremap <buffer> <LocalLeader>lc :LatexmkClean<CR>
|
||||||
map <buffer> <LocalLeader>lC :LatexmkClean!<CR>
|
noremap <buffer> <LocalLeader>lC :LatexmkClean!<CR>
|
||||||
map <buffer> <LocalLeader>lg :LatexmkStatus<CR>
|
noremap <buffer> <LocalLeader>lg :LatexmkStatus<CR>
|
||||||
map <buffer> <LocalLeader>lG :LatexmkStatus!<CR>
|
noremap <buffer> <LocalLeader>lG :LatexmkStatus!<CR>
|
||||||
map <buffer> <LocalLeader>lk :LatexmkStop<CR>
|
noremap <buffer> <LocalLeader>lk :LatexmkStop<CR>
|
||||||
map <buffer> <LocalLeader>le :LatexErrors<CR>
|
noremap <buffer> <LocalLeader>le :LatexErrors<CR>
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" View {{{
|
" View {{{
|
||||||
map <buffer> <LocalLeader>lv :LatexView<CR>
|
noremap <buffer> <LocalLeader>lv :LatexView<CR>
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" TOC {{{
|
" TOC {{{
|
||||||
map <silent> <buffer> <LocalLeader>lt :LatexTOC<CR>
|
noremap <silent> <buffer> <LocalLeader>lt :LatexTOC<CR>
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" List of labels {{{
|
" List of labels {{{
|
||||||
map <silent> <buffer> <LocalLeader>lj :LatexLabels<CR>
|
noremap <silent> <buffer> <LocalLeader>lj :LatexLabels<CR>
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" Folding {{{
|
" Folding {{{
|
||||||
if g:LatexBox_Folding == 1
|
if g:LatexBox_Folding == 1
|
||||||
map <buffer> <LocalLeader>lf :LatexFold<CR>
|
noremap <buffer> <LocalLeader>lf :LatexFold<CR>
|
||||||
endif
|
endif
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
@@ -44,12 +44,12 @@ endif
|
|||||||
" Define text objects {{{
|
" Define text objects {{{
|
||||||
vmap <buffer> ie <Plug>LatexBox_SelectCurrentEnvInner
|
vmap <buffer> ie <Plug>LatexBox_SelectCurrentEnvInner
|
||||||
vmap <buffer> ae <Plug>LatexBox_SelectCurrentEnvOuter
|
vmap <buffer> ae <Plug>LatexBox_SelectCurrentEnvOuter
|
||||||
omap <buffer> ie :normal vie<CR>
|
onoremap <buffer> ie :normal vie<CR>
|
||||||
omap <buffer> ae :normal vae<CR>
|
onoremap <buffer> ae :normal vae<CR>
|
||||||
vmap <buffer> i$ <Plug>LatexBox_SelectInlineMathInner
|
vmap <buffer> i$ <Plug>LatexBox_SelectInlineMathInner
|
||||||
vmap <buffer> a$ <Plug>LatexBox_SelectInlineMathOuter
|
vmap <buffer> a$ <Plug>LatexBox_SelectInlineMathOuter
|
||||||
omap <buffer> i$ :normal vi$<CR>
|
onoremap <buffer> i$ :normal vi$<CR>
|
||||||
omap <buffer> a$ :normal va$<CR>
|
onoremap <buffer> a$ :normal va$<CR>
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" Jump between sections {{{
|
" Jump between sections {{{
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ function! s:ReadTOC(auxfile, texfile, ...)
|
|||||||
if len(tree) > 3 && empty(tree[1])
|
if len(tree) > 3 && empty(tree[1])
|
||||||
call remove(tree, 1)
|
call remove(tree, 1)
|
||||||
endif
|
endif
|
||||||
if len(tree) > 1 && tree[0] =~ '^\\\(numberline\|tocsection\)'
|
if len(tree) > 1 && type(tree[0]) == type("") && tree[0] =~ '^\\\(\(chapter\)\?numberline\|tocsection\)'
|
||||||
let secnum = LatexBox_TreeToTex(tree[1])
|
let secnum = LatexBox_TreeToTex(tree[1])
|
||||||
let secnum = substitute(secnum, '\\\S\+\s', '', 'g')
|
let secnum = substitute(secnum, '\\\S\+\s', '', 'g')
|
||||||
let secnum = substitute(secnum, '\\\S\+{\(.\{-}\)}', '\1', 'g')
|
let secnum = substitute(secnum, '\\\S\+{\(.\{-}\)}', '\1', 'g')
|
||||||
@@ -359,7 +359,7 @@ function! s:ReadTOC(auxfile, texfile, ...)
|
|||||||
" parse section title
|
" parse section title
|
||||||
let text = LatexBox_TreeToTex(tree)
|
let text = LatexBox_TreeToTex(tree)
|
||||||
let text = substitute(text, '^{\+\|}\+$', '', 'g')
|
let text = substitute(text, '^{\+\|}\+$', '', 'g')
|
||||||
let text = substitute(text, '\m^\\\(no\)\?numberline\s*', '', '')
|
let text = substitute(text, '\m^\\\(no\)\?\(chapter\)\?numberline\s*', '', '')
|
||||||
let text = substitute(text, '\*', '', 'g')
|
let text = substitute(text, '\*', '', 'g')
|
||||||
|
|
||||||
" add TOC entry
|
" add TOC entry
|
||||||
@@ -379,6 +379,21 @@ function! LatexBox_TOC(...)
|
|||||||
|
|
||||||
" Check if window already exists
|
" Check if window already exists
|
||||||
let winnr = bufwinnr(bufnr('LaTeX TOC'))
|
let winnr = bufwinnr(bufnr('LaTeX TOC'))
|
||||||
|
" Two types of splits, horizontal and vertical
|
||||||
|
let l:hori = "new"
|
||||||
|
let l:vert = "vnew"
|
||||||
|
|
||||||
|
" Set General Vars and initialize size
|
||||||
|
let l:type = g:LatexBox_split_type
|
||||||
|
let l:size = 10
|
||||||
|
|
||||||
|
" Size detection
|
||||||
|
if l:type == l:hori
|
||||||
|
let l:size = g:LatexBox_split_length
|
||||||
|
elseif l:type == l:vert
|
||||||
|
let l:size = g:LatexBox_split_width
|
||||||
|
endif
|
||||||
|
|
||||||
if winnr >= 0
|
if winnr >= 0
|
||||||
if a:0 == 0
|
if a:0 == 0
|
||||||
silent execute winnr . 'wincmd w'
|
silent execute winnr . 'wincmd w'
|
||||||
@@ -386,13 +401,12 @@ function! LatexBox_TOC(...)
|
|||||||
" Supplying an argument to this function causes toggling instead
|
" Supplying an argument to this function causes toggling instead
|
||||||
" of jumping to the TOC window
|
" of jumping to the TOC window
|
||||||
if g:LatexBox_split_resize
|
if g:LatexBox_split_resize
|
||||||
silent exe "set columns-=" . g:LatexBox_split_width
|
silent exe "set columns-=" . l:size
|
||||||
endif
|
endif
|
||||||
silent execute 'bwipeout' . bufnr('LaTeX TOC')
|
silent execute 'bwipeout' . bufnr('LaTeX TOC')
|
||||||
endif
|
endif
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Read TOC
|
" Read TOC
|
||||||
let [toc, fileindices] = s:ReadTOC(LatexBox_GetAuxFile(),
|
let [toc, fileindices] = s:ReadTOC(LatexBox_GetAuxFile(),
|
||||||
\ LatexBox_GetMainTexFile())
|
\ LatexBox_GetMainTexFile())
|
||||||
@@ -403,9 +417,10 @@ function! LatexBox_TOC(...)
|
|||||||
|
|
||||||
" Create TOC window and set local settings
|
" Create TOC window and set local settings
|
||||||
if g:LatexBox_split_resize
|
if g:LatexBox_split_resize
|
||||||
silent exe "set columns+=" . g:LatexBox_split_width
|
silent exe "set columns+=" . l:size
|
||||||
endif
|
endif
|
||||||
silent exe g:LatexBox_split_side g:LatexBox_split_width . 'vnew LaTeX\ TOC'
|
silent exe g:LatexBox_split_side l:size . l:type . ' LaTeX\ TOC'
|
||||||
|
|
||||||
let b:toc = toc
|
let b:toc = toc
|
||||||
let b:toc_numbers = 1
|
let b:toc_numbers = 1
|
||||||
let b:calling_win = bufwinnr(calling_buf)
|
let b:calling_win = bufwinnr(calling_buf)
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ endif
|
|||||||
"---------------------------------------------
|
"---------------------------------------------
|
||||||
|
|
||||||
" Undo the stuff we changed.
|
" Undo the stuff we changed.
|
||||||
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< kp< path<" .
|
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isk< isf< kp< path<" .
|
||||||
\ " | unlet! b:browsefilter"
|
\ " | unlet! b:browsefilter"
|
||||||
|
|
||||||
" proper matching for matchit plugin
|
" proper matching for matchit plugin
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ setlocal define=[^A-Za-z_]
|
|||||||
" after/ftplugin/perl6.vim file that contains
|
" after/ftplugin/perl6.vim file that contains
|
||||||
" set isfname-=:
|
" set isfname-=:
|
||||||
set isfname+=:
|
set isfname+=:
|
||||||
setlocal iskeyword=48-57,_,A-Z,a-z,:,-
|
setlocal iskeyword=@,48-57,_,192-255,:,-,'
|
||||||
|
|
||||||
" Set this once, globally.
|
" Set this once, globally.
|
||||||
if !exists("perlpath")
|
if !exists("perlpath")
|
||||||
@@ -65,11 +65,22 @@ if !exists("perlpath")
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let &l:path=perlpath
|
" Append perlpath to the existing path value, if it is set. Since we don't
|
||||||
|
" use += to do it because of the commas in perlpath, we have to handle the
|
||||||
|
" global / local settings, too.
|
||||||
|
if &l:path == ""
|
||||||
|
if &g:path == ""
|
||||||
|
let &l:path=perlpath
|
||||||
|
else
|
||||||
|
let &l:path=&g:path.",".perlpath
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let &l:path=&l:path.",".perlpath
|
||||||
|
endif
|
||||||
"---------------------------------------------
|
"---------------------------------------------
|
||||||
|
|
||||||
" Undo the stuff we changed.
|
" Undo the stuff we changed.
|
||||||
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isk<" .
|
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< isk< kp< path<" .
|
||||||
\ " | unlet! b:browsefilter"
|
\ " | unlet! b:browsefilter"
|
||||||
|
|
||||||
" Restore the saved compatibility options.
|
" Restore the saved compatibility options.
|
||||||
|
|||||||
34
ftplugin/ps1.vim
Normal file
34
ftplugin/ps1.vim
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
" Vim filetype plugin file
|
||||||
|
" Language: Windows PowerShell
|
||||||
|
" Maintainer: Peter Provost <peter@provost.org>
|
||||||
|
" Version: 2.10
|
||||||
|
" Project Repository: https://github.com/PProvost/vim-ps1
|
||||||
|
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327
|
||||||
|
|
||||||
|
" Only do this when not done yet for this buffer
|
||||||
|
if exists("b:did_ftplugin") | finish | endif
|
||||||
|
|
||||||
|
" Don't load another plug-in for this buffer
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
setlocal tw=0
|
||||||
|
setlocal commentstring=#%s
|
||||||
|
setlocal formatoptions=tcqro
|
||||||
|
" Enable autocompletion of hyphenated PowerShell commands,
|
||||||
|
" e.g. Get-Content or Get-ADUser
|
||||||
|
setlocal iskeyword+=-
|
||||||
|
|
||||||
|
" Change the browse dialog on Win32 to show mainly PowerShell-related files
|
||||||
|
if has("gui_win32")
|
||||||
|
let b:browsefilter =
|
||||||
|
\ "All PowerShell Files (*.ps1, *.psd1, *.psm1, *.ps1xml)\t*.ps1;*.psd1;*.psm1;*.ps1xml\n" .
|
||||||
|
\ "PowerShell Script Files (*.ps1)\t*.ps1\n" .
|
||||||
|
\ "PowerShell Module Files (*.psd1, *.psm1)\t*.psd1;*.psm1\n" .
|
||||||
|
\ "PowerShell XML Files (*.ps1xml)\t*.ps1xml\n" .
|
||||||
|
\ "All Files (*.*)\t*.*\n"
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Undo the stuff we changed
|
||||||
|
let b:undo_ftplugin = "setlocal tw< cms< fo<" .
|
||||||
|
\ " | unlet! b:browsefilter"
|
||||||
|
|
||||||
31
ftplugin/ps1xml.vim
Normal file
31
ftplugin/ps1xml.vim
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
" Vim filetype plugin file
|
||||||
|
" Language: Windows PowerShell
|
||||||
|
" Maintainer: Peter Provost <peter@provost.org>
|
||||||
|
" Version: 2.10
|
||||||
|
" Project Repository: https://github.com/PProvost/vim-ps1
|
||||||
|
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327
|
||||||
|
|
||||||
|
" Only do this when not done yet for this buffer
|
||||||
|
if exists("b:did_ftplugin") | finish | endif
|
||||||
|
|
||||||
|
" Don't load another plug-in for this buffer
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
setlocal tw=0
|
||||||
|
setlocal commentstring=#%s
|
||||||
|
setlocal formatoptions=tcqro
|
||||||
|
|
||||||
|
" Change the browse dialog on Win32 to show mainly PowerShell-related files
|
||||||
|
if has("gui_win32")
|
||||||
|
let b:browsefilter =
|
||||||
|
\ "All PowerShell Files (*.ps1, *.psd1, *.psm1, *.ps1xml)\t*.ps1;*.psd1;*.psm1;*.ps1xml\n" .
|
||||||
|
\ "PowerShell Script Files (*.ps1)\t*.ps1\n" .
|
||||||
|
\ "PowerShell Module Files (*.psd1, *.psm1)\t*.psd1;*.psm1\n" .
|
||||||
|
\ "PowerShell XML Files (*.ps1xml)\t*.ps1xml\n" .
|
||||||
|
\ "All Files (*.*)\t*.*\n"
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Undo the stuff we changed
|
||||||
|
let b:undo_ftplugin = "setlocal tw< cms< fo<" .
|
||||||
|
\ " | unlet! b:browsefilter"
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ if exists("loaded_matchit") && !exists("b:match_words")
|
|||||||
\ ':' .
|
\ ':' .
|
||||||
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
|
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
|
||||||
\ ':' .
|
\ ':' .
|
||||||
\ '\<end\>' .
|
\ '\%(^\|[^.\:@$]\)\@<=\<end\:\@!\>' .
|
||||||
\ ',{:},\[:\],(:)'
|
\ ',{:},\[:\],(:)'
|
||||||
|
|
||||||
let b:match_skip =
|
let b:match_skip =
|
||||||
|
|||||||
@@ -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')
|
||||||
|
|||||||
@@ -1,14 +1,33 @@
|
|||||||
setlocal formatoptions+=ro
|
" Vim filetype plugin
|
||||||
setlocal commentstring=//%s
|
" Language: Scala
|
||||||
let &l:include = '^\s*import'
|
" Maintainer: Derek Wyatt
|
||||||
let &l:includeexpr = 'substitute(v:fname,"\\.","/","g")'
|
" URL: https://github.com/derekwyatt/vim-scala
|
||||||
|
" License: Apache 2
|
||||||
|
" ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if exists('b:did_ftplugin') || &cp
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
" j is fairly new in Vim, so don't complain if it's not there
|
||||||
|
setlocal formatoptions-=t formatoptions+=croqnl
|
||||||
|
silent! setlocal formatoptions+=j
|
||||||
|
|
||||||
|
" Just like c.vim, but additionally doesn't wrap text onto /** line when
|
||||||
|
" formatting. Doesn't bungle bulleted lists when formatting.
|
||||||
|
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/**,mb:*,ex:*/,s1:/*,mb:*,ex:*/,://
|
||||||
|
setlocal commentstring=//\ %s
|
||||||
|
|
||||||
|
setlocal shiftwidth=2 softtabstop=2 expandtab
|
||||||
|
|
||||||
|
setlocal include='^\s*import'
|
||||||
|
setlocal includeexpr='substitute(v:fname,"\\.","/","g")'
|
||||||
|
|
||||||
setlocal path+=src/main/scala,src/test/scala
|
setlocal path+=src/main/scala,src/test/scala
|
||||||
setlocal suffixesadd=.scala
|
setlocal suffixesadd=.scala
|
||||||
|
|
||||||
set makeprg=sbt\ -Dsbt.log.noformat=true\ compile
|
compiler sbt
|
||||||
set efm=%E\ %#[error]\ %f:%l:\ %m,%C\ %#[error]\ %p^,%-C%.%#,%Z,
|
|
||||||
\%W\ %#[warn]\ %f:%l:\ %m,%C\ %#[warn]\ %p^,%-C%.%#,%Z,
|
|
||||||
\%-G%.%#
|
|
||||||
|
|
||||||
if globpath(&rtp, 'plugin/fuf.vim') != ''
|
if globpath(&rtp, 'plugin/fuf.vim') != ''
|
||||||
"
|
"
|
||||||
@@ -127,49 +146,6 @@ if globpath(&rtp, 'plugin/fuf.vim') != ''
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" If you want to disable the default key mappings, write the following line in
|
|
||||||
" your ~/.vimrc
|
|
||||||
" let g:scala_use_default_keymappings = 0
|
|
||||||
if get(g:, 'scala_use_default_keymappings', 1)
|
|
||||||
nnoremap <buffer> <Leader>jt :call JustifyCurrentLine()<cr>
|
|
||||||
endif
|
|
||||||
|
|
||||||
"
|
|
||||||
" TagBar
|
|
||||||
"
|
|
||||||
let g:tagbar_type_scala = {
|
|
||||||
\ 'ctagstype' : 'scala',
|
|
||||||
\ 'kinds' : [
|
|
||||||
\ 'p:packages:1',
|
|
||||||
\ 'V:values',
|
|
||||||
\ 'v:variables',
|
|
||||||
\ 'T:types',
|
|
||||||
\ 't:traits',
|
|
||||||
\ 'o:objects',
|
|
||||||
\ 'a:aclasses',
|
|
||||||
\ 'c:classes',
|
|
||||||
\ 'r:cclasses',
|
|
||||||
\ 'm:methods'
|
|
||||||
\ ],
|
|
||||||
\ 'sro' : '.',
|
|
||||||
\ 'kind2scope' : {
|
|
||||||
\ 'T' : 'type',
|
|
||||||
\ 't' : 'trait',
|
|
||||||
\ 'o' : 'object',
|
|
||||||
\ 'a' : 'abstract class',
|
|
||||||
\ 'c' : 'class',
|
|
||||||
\ 'r' : 'case class'
|
|
||||||
\ },
|
|
||||||
\ 'scope2kind' : {
|
|
||||||
\ 'type' : 'T',
|
|
||||||
\ 'trait' : 't',
|
|
||||||
\ 'object' : 'o',
|
|
||||||
\ 'abstract class' : 'a',
|
|
||||||
\ 'class' : 'c',
|
|
||||||
\ 'case class' : 'r'
|
|
||||||
\ }
|
|
||||||
\ }
|
|
||||||
|
|
||||||
function! s:CreateOrExpression(keywords)
|
function! s:CreateOrExpression(keywords)
|
||||||
return '('.join(a:keywords, '|').')'
|
return '('.join(a:keywords, '|').')'
|
||||||
endfunction
|
endfunction
|
||||||
@@ -191,5 +167,6 @@ function! s:NextSection(backwards)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
noremap <script> <buffer> <silent> ]] :call <SID>NextSection(0)<cr>
|
noremap <script> <buffer> <silent> ]] :call <SID>NextSection(0)<cr>
|
||||||
|
|
||||||
noremap <script> <buffer> <silent> [[ :call <SID>NextSection(1)<cr>
|
noremap <script> <buffer> <silent> [[ :call <SID>NextSection(1)<cr>
|
||||||
|
|
||||||
|
" vim:set sw=2 sts=2 ts=8 et:
|
||||||
|
|||||||
31
ftplugin/scala/tagbar.vim
Normal file
31
ftplugin/scala/tagbar.vim
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
"
|
||||||
|
" Support for Tagbar -- https://github.com/majutsushi/tagbar
|
||||||
|
"
|
||||||
|
" Hat tip to Leonard Ehrenfried for the built-in ctags deffile:
|
||||||
|
" https://leonard.io/blog/2013/04/editing-scala-with-vim/
|
||||||
|
"
|
||||||
|
if !exists(':Tagbar')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let g:tagbar_type_scala = {
|
||||||
|
\ 'ctagstype' : 'scala',
|
||||||
|
\ 'sro' : '.',
|
||||||
|
\ 'kinds' : [
|
||||||
|
\ 'p:packages',
|
||||||
|
\ 'T:types:1',
|
||||||
|
\ 't:traits',
|
||||||
|
\ 'o:objects',
|
||||||
|
\ 'O:case objects',
|
||||||
|
\ 'c:classes',
|
||||||
|
\ 'C:case classes',
|
||||||
|
\ 'm:methods',
|
||||||
|
\ 'V:values:1',
|
||||||
|
\ 'v:variables:1'
|
||||||
|
\ ]
|
||||||
|
\ }
|
||||||
|
|
||||||
|
" In case you've updated/customized your ~/.ctags and prefer to use it.
|
||||||
|
if get(g:, 'scala_use_builtin_tagbar_defs', 1)
|
||||||
|
let g:tagbar_type_scala.deffile = expand('<sfile>:p:h:h:h') . '/ctags/scala.ctags'
|
||||||
|
endif
|
||||||
37
ftplugin/toml.vim
Normal file
37
ftplugin/toml.vim
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
" File: ftplugin/toml.vim
|
||||||
|
" Author: Kevin Ballard <kevin@sb.org>
|
||||||
|
" Description: FileType Plugin for Toml
|
||||||
|
" Last Change: Dec 09, 2014
|
||||||
|
|
||||||
|
if exists('b:did_ftplugin')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
setlocal commentstring=#\ %s
|
||||||
|
|
||||||
|
" Add NERDCommenter delimiters
|
||||||
|
|
||||||
|
let s:delims = { 'left': '#' }
|
||||||
|
if exists('g:NERDDelimiterMap')
|
||||||
|
if !has_key(g:NERDDelimiterMap, 'toml')
|
||||||
|
let g:NERDDelimiterMap.toml = s:delims
|
||||||
|
endif
|
||||||
|
elseif exists('g:NERDCustomDelimiters')
|
||||||
|
if !has_key(g:NERDCustomDelimiters, 'toml')
|
||||||
|
let g:NERDCustomDelimiters.toml = s:delims
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let g:NERDCustomDelimiters = { 'toml': s:delims }
|
||||||
|
endif
|
||||||
|
unlet s:delims
|
||||||
|
|
||||||
|
let b:undo_ftplugin = ""
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
|
unlet s:save_cpo
|
||||||
|
|
||||||
|
" vim: set et sw=4 ts=4:
|
||||||
@@ -1,10 +1,19 @@
|
|||||||
|
if exists("b:did_ftplugin")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
let s:cpo_save = &cpo
|
||||||
|
set cpo-=C
|
||||||
|
|
||||||
compiler typescript
|
compiler typescript
|
||||||
|
|
||||||
setlocal autoindent
|
|
||||||
setlocal smartindent
|
|
||||||
setlocal indentexpr&
|
|
||||||
|
|
||||||
setlocal cindent
|
|
||||||
setlocal cino=j1J1
|
|
||||||
|
|
||||||
setlocal commentstring=//\ %s
|
setlocal commentstring=//\ %s
|
||||||
|
|
||||||
|
" Set 'formatoptions' to break comment lines but not other lines,
|
||||||
|
" " and insert the comment leader when hitting <CR> or using "o".
|
||||||
|
setlocal formatoptions-=t formatoptions+=croql
|
||||||
|
|
||||||
|
let b:undo_ftplugin = "setl fo< ofu< com< cms<"
|
||||||
|
|
||||||
|
let &cpo = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ setlocal nosmartindent
|
|||||||
|
|
||||||
setlocal indentexpr=GetElixirIndent()
|
setlocal indentexpr=GetElixirIndent()
|
||||||
setlocal indentkeys+=0=end,0=else,0=match,0=elsif,0=catch,0=after,0=rescue
|
setlocal indentkeys+=0=end,0=else,0=match,0=elsif,0=catch,0=after,0=rescue
|
||||||
setlocal indentkeys+==->
|
|
||||||
|
|
||||||
if exists("*GetElixirIndent")
|
if exists("*GetElixirIndent")
|
||||||
finish
|
finish
|
||||||
@@ -68,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
|
||||||
|
|||||||
1616
indent/erlang.vim
1616
indent/erlang.vim
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
" - general line splits (line ends in an operator)
|
" - general line splits (line ends in an operator)
|
||||||
|
|
||||||
if exists("b:did_indent")
|
if exists("b:did_indent")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
|
|
||||||
@@ -21,45 +21,58 @@ setlocal indentexpr=GoIndent(v:lnum)
|
|||||||
setlocal indentkeys+=<:>,0=},0=)
|
setlocal indentkeys+=<:>,0=},0=)
|
||||||
|
|
||||||
if exists("*GoIndent")
|
if exists("*GoIndent")
|
||||||
finish
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" use shiftwidth function only if it's available
|
||||||
|
if exists('*shiftwidth')
|
||||||
|
func s:sw()
|
||||||
|
return shiftwidth()
|
||||||
|
endfunc
|
||||||
|
else
|
||||||
|
func s:sw()
|
||||||
|
return &sw
|
||||||
|
endfunc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! GoIndent(lnum)
|
function! GoIndent(lnum)
|
||||||
let prevlnum = prevnonblank(a:lnum-1)
|
let prevlnum = prevnonblank(a:lnum-1)
|
||||||
if prevlnum == 0
|
if prevlnum == 0
|
||||||
" top of file
|
" top of file
|
||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" grab the previous and current line, stripping comments.
|
" grab the previous and current line, stripping comments.
|
||||||
let prevl = substitute(getline(prevlnum), '//.*$', '', '')
|
let prevl = substitute(getline(prevlnum), '//.*$', '', '')
|
||||||
let thisl = substitute(getline(a:lnum), '//.*$', '', '')
|
let thisl = substitute(getline(a:lnum), '//.*$', '', '')
|
||||||
let previ = indent(prevlnum)
|
let previ = indent(prevlnum)
|
||||||
|
|
||||||
let ind = previ
|
let ind = previ
|
||||||
|
|
||||||
if prevl =~ '[({]\s*$'
|
if prevl =~ '[({]\s*$'
|
||||||
" previous line opened a block
|
" previous line opened a block
|
||||||
let ind += &sw
|
let ind += s:sw()
|
||||||
endif
|
endif
|
||||||
if prevl =~# '^\s*\(case .*\|default\):$'
|
if prevl =~# '^\s*\(case .*\|default\):$'
|
||||||
" previous line is part of a switch statement
|
" previous line is part of a switch statement
|
||||||
let ind += &sw
|
let ind += s:sw()
|
||||||
endif
|
endif
|
||||||
" TODO: handle if the previous line is a label.
|
" TODO: handle if the previous line is a label.
|
||||||
|
|
||||||
if thisl =~ '^\s*[)}]'
|
if thisl =~ '^\s*[)}]'
|
||||||
" this line closed a block
|
" this line closed a block
|
||||||
let ind -= &sw
|
let ind -= s:sw()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Colons are tricky.
|
" Colons are tricky.
|
||||||
" We want to outdent if it's part of a switch ("case foo:" or "default:").
|
" We want to outdent if it's part of a switch ("case foo:" or "default:").
|
||||||
" We ignore trying to deal with jump labels because (a) they're rare, and
|
" We ignore trying to deal with jump labels because (a) they're rare, and
|
||||||
" (b) they're hard to disambiguate from a composite literal key.
|
" (b) they're hard to disambiguate from a composite literal key.
|
||||||
if thisl =~# '^\s*\(case .*\|default\):$'
|
if thisl =~# '^\s*\(case .*\|default\):$'
|
||||||
let ind -= &sw
|
let ind -= s:sw()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return ind
|
return ind
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" vim:ts=4:sw=4:et
|
||||||
|
|||||||
@@ -127,10 +127,14 @@ 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, 'rb')
|
||||||
call add(s:tags, 'rp')
|
call add(s:tags, 'rp')
|
||||||
call add(s:tags, 'rt')
|
call add(s:tags, 'rt')
|
||||||
|
call add(s:tags, 'rtc')
|
||||||
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')
|
||||||
|
|||||||
@@ -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.
|
||||||
@@ -48,11 +49,11 @@ let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_st
|
|||||||
let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
|
let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
|
||||||
|
|
||||||
" Regex that defines continuation lines, not including (, {, or [.
|
" Regex that defines continuation lines, not including (, {, or [.
|
||||||
let s:continuation_regex = '\%([\\*+/.:]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)' . s:line_term
|
let s:continuation_regex = '\%([\\*+/.:]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\|[^=]=[^=].*,\)' . s:line_term
|
||||||
|
|
||||||
" Regex that defines continuation lines.
|
" Regex that defines continuation lines.
|
||||||
" TODO: this needs to deal with if ...: and so on
|
" TODO: this needs to deal with if ...: and so on
|
||||||
let s:msl_regex = '\%([\\*+/.:([]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)' . s:line_term
|
let s:msl_regex = s:continuation_regex
|
||||||
|
|
||||||
let s:one_line_scope_regex = '\<\%(if\|else\|for\|while\)\>[^{;]*' . s:line_term
|
let s:one_line_scope_regex = '\<\%(if\|else\|for\|while\)\>[^{;]*' . s:line_term
|
||||||
|
|
||||||
@@ -437,3 +438,64 @@ 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
|
||||||
|
let l:first_char = indent(a:lnum) + 1
|
||||||
|
|
||||||
|
if mode() == 'i' " gq was not pressed, but tw was set
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" This gq is only meant to do code with strings, not comments
|
||||||
|
if s:IsLineComment(a:lnum, l:first_char) || s:IsInMultilineComment(a:lnum, l:first_char)
|
||||||
|
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
|
||||||
|
|||||||
169
indent/json.vim
Normal file
169
indent/json.vim
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
" Vim indent file
|
||||||
|
" Language: JSON
|
||||||
|
" Mantainer: Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json
|
||||||
|
" Last Change: 2014-05-13: merged Fix for square bracket matching by Jakar
|
||||||
|
" https://github.com/jakar/vim-json/commit/20b650e22aa750c4ab6a66aa646bdd95d7cd548a#diff-e81fc111b2052e306d126bd9989f7b7c
|
||||||
|
" Original Author: Rogerz Zhang <rogerz.zhang at gmail.com> http://github.com/rogerz/vim-json
|
||||||
|
" Acknowledgement: Based off of vim-javascript maintained by Darrick Wiebe
|
||||||
|
" http://www.vim.org/scripts/script.php?script_id=2765
|
||||||
|
|
||||||
|
" 0. Initialization {{{1
|
||||||
|
" =================
|
||||||
|
|
||||||
|
" Only load this indent file when no other was loaded.
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
setlocal nosmartindent
|
||||||
|
|
||||||
|
" Now, set up our indentation expression and keys that trigger it.
|
||||||
|
setlocal indentexpr=GetJSONIndent()
|
||||||
|
setlocal indentkeys=0{,0},0),0[,0],!^F,o,O,e
|
||||||
|
|
||||||
|
" Only define the function once.
|
||||||
|
if exists("*GetJSONIndent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:cpo_save = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
" 1. Variables {{{1
|
||||||
|
" ============
|
||||||
|
|
||||||
|
let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
|
||||||
|
" Regex that defines blocks.
|
||||||
|
let s:block_regex = '\%({\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term
|
||||||
|
|
||||||
|
" 2. Auxiliary Functions {{{1
|
||||||
|
" ======================
|
||||||
|
|
||||||
|
" Check if the character at lnum:col is inside a string.
|
||||||
|
function s:IsInString(lnum, col)
|
||||||
|
return synIDattr(synID(a:lnum, a:col, 1), 'name') == jsonString
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Find line above 'lnum' that isn't empty, or in a string.
|
||||||
|
function s:PrevNonBlankNonString(lnum)
|
||||||
|
let lnum = prevnonblank(a:lnum)
|
||||||
|
while lnum > 0
|
||||||
|
" If the line isn't empty or in a string, end search.
|
||||||
|
let line = getline(lnum)
|
||||||
|
if !(s:IsInString(lnum, 1) && s:IsInString(lnum, strlen(line)))
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
let lnum = prevnonblank(lnum - 1)
|
||||||
|
endwhile
|
||||||
|
return lnum
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Check if line 'lnum' has more opening brackets than closing ones.
|
||||||
|
function s:LineHasOpeningBrackets(lnum)
|
||||||
|
let open_0 = 0
|
||||||
|
let open_2 = 0
|
||||||
|
let open_4 = 0
|
||||||
|
let line = getline(a:lnum)
|
||||||
|
let pos = match(line, '[][(){}]', 0)
|
||||||
|
while pos != -1
|
||||||
|
let idx = stridx('(){}[]', line[pos])
|
||||||
|
if idx % 2 == 0
|
||||||
|
let open_{idx} = open_{idx} + 1
|
||||||
|
else
|
||||||
|
let open_{idx - 1} = open_{idx - 1} - 1
|
||||||
|
endif
|
||||||
|
let pos = match(line, '[][(){}]', pos + 1)
|
||||||
|
endwhile
|
||||||
|
return (open_0 > 0) . (open_2 > 0) . (open_4 > 0)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function s:Match(lnum, regex)
|
||||||
|
let col = match(getline(a:lnum), a:regex) + 1
|
||||||
|
return col > 0 && !s:IsInString(a:lnum, col) ? col : 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" 3. GetJSONIndent Function {{{1
|
||||||
|
" =========================
|
||||||
|
|
||||||
|
function GetJSONIndent()
|
||||||
|
" 3.1. Setup {{{2
|
||||||
|
" ----------
|
||||||
|
|
||||||
|
" Set up variables for restoring position in file. Could use v:lnum here.
|
||||||
|
let vcol = col('.')
|
||||||
|
|
||||||
|
" 3.2. Work on the current line {{{2
|
||||||
|
" -----------------------------
|
||||||
|
|
||||||
|
" Get the current line.
|
||||||
|
let line = getline(v:lnum)
|
||||||
|
let ind = -1
|
||||||
|
|
||||||
|
" If we got a closing bracket on an empty line, find its match and indent
|
||||||
|
" according to it.
|
||||||
|
let col = matchend(line, '^\s*[]}]')
|
||||||
|
|
||||||
|
if col > 0 && !s:IsInString(v:lnum, col)
|
||||||
|
call cursor(v:lnum, col)
|
||||||
|
let bs = strpart('{}[]', stridx('}]', line[col - 1]) * 2, 2)
|
||||||
|
|
||||||
|
let pairstart = escape(bs[0], '[')
|
||||||
|
let pairend = escape(bs[1], ']')
|
||||||
|
let pairline = searchpair(pairstart, '', pairend, 'bW')
|
||||||
|
|
||||||
|
if pairline > 0
|
||||||
|
let ind = indent(pairline)
|
||||||
|
else
|
||||||
|
let ind = virtcol('.') - 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ind
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If we are in a multi-line string, don't do anything to it.
|
||||||
|
if s:IsInString(v:lnum, matchend(line, '^\s*') + 1)
|
||||||
|
return indent('.')
|
||||||
|
endif
|
||||||
|
|
||||||
|
" 3.3. Work on the previous line. {{{2
|
||||||
|
" -------------------------------
|
||||||
|
|
||||||
|
let lnum = prevnonblank(v:lnum - 1)
|
||||||
|
|
||||||
|
if lnum == 0
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Set up variables for current line.
|
||||||
|
let line = getline(lnum)
|
||||||
|
let ind = indent(lnum)
|
||||||
|
|
||||||
|
" If the previous line ended with a block opening, add a level of indent.
|
||||||
|
" if s:Match(lnum, s:block_regex)
|
||||||
|
" return indent(lnum) + shiftwidth()
|
||||||
|
" endif
|
||||||
|
|
||||||
|
" If the previous line contained an opening bracket, and we are still in it,
|
||||||
|
" add indent depending on the bracket type.
|
||||||
|
if line =~ '[[({]'
|
||||||
|
let counts = s:LineHasOpeningBrackets(lnum)
|
||||||
|
if counts[0] == '1' || counts[1] == '1' || counts[2] == '1'
|
||||||
|
return ind + shiftwidth()
|
||||||
|
else
|
||||||
|
call cursor(v:lnum, vcol)
|
||||||
|
end
|
||||||
|
endif
|
||||||
|
|
||||||
|
" }}}2
|
||||||
|
|
||||||
|
return ind
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" }}}1
|
||||||
|
|
||||||
|
let &cpo = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
|
||||||
|
" vim:set sw=2 sts=2 ts=8 noet:
|
||||||
|
|
||||||
20
indent/ps1.vim
Normal file
20
indent/ps1.vim
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
" Vim indent file
|
||||||
|
" Language: Windows PowerShell
|
||||||
|
" Maintainer: Peter Provost <peter@provost.org>
|
||||||
|
" Version: 2.10
|
||||||
|
" Project Repository: https://github.com/PProvost/vim-ps1
|
||||||
|
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327"
|
||||||
|
|
||||||
|
" Only load this indent file when no other was loaded.
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
" smartindent is good enough for powershell
|
||||||
|
setlocal smartindent
|
||||||
|
" disable the indent removal for # marks
|
||||||
|
inoremap # X#
|
||||||
|
|
||||||
|
let b:undo_indent = "setl si<"
|
||||||
|
|
||||||
@@ -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'
|
||||||
@@ -433,10 +440,14 @@ function GetRubyIndent(...)
|
|||||||
|
|
||||||
if strpart(line, 0, col('.') - 1) =~ '=\s*$' &&
|
if strpart(line, 0, col('.') - 1) =~ '=\s*$' &&
|
||||||
\ strpart(line, col('.') - 1, 2) !~ 'do'
|
\ strpart(line, col('.') - 1, 2) !~ 'do'
|
||||||
|
" assignment to case/begin/etc, on the same line, hanging indent
|
||||||
let ind = virtcol('.') - 1
|
let ind = virtcol('.') - 1
|
||||||
elseif getline(msl) =~ '=\s*\(#.*\)\=$'
|
elseif getline(msl) =~ '=\s*\(#.*\)\=$'
|
||||||
|
" in the case of assignment to the msl, align to the starting line,
|
||||||
|
" not to the msl
|
||||||
let ind = indent(line('.'))
|
let ind = indent(line('.'))
|
||||||
else
|
else
|
||||||
|
" align to the msl
|
||||||
let ind = indent(msl)
|
let ind = indent(msl)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -458,7 +469,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 +496,32 @@ 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
|
let msl = s:GetMSL(lnum)
|
||||||
|
|
||||||
|
if getline(msl) =~ '=\s*\(#.*\)\=$'
|
||||||
|
" in the case of assignment to the msl, align to the starting line,
|
||||||
|
" not to the msl
|
||||||
|
let ind = indent(lnum) + sw
|
||||||
|
else
|
||||||
|
let ind = indent(msl) + sw
|
||||||
|
endif
|
||||||
|
return ind
|
||||||
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 +532,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 +547,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 +589,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 +626,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 +637,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
|
||||||
|
|||||||
@@ -9,13 +9,9 @@ if exists("b:did_indent")
|
|||||||
endif
|
endif
|
||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
setlocal autoindent
|
||||||
setlocal indentexpr=GetScalaIndent()
|
setlocal indentexpr=GetScalaIndent()
|
||||||
setlocal indentkeys=0{,0},0),!^F,<>>,o,O,e,=case,<CR>
|
setlocal indentkeys=0{,0},0),!^F,<>>,o,O,e,=case,<CR>
|
||||||
setlocal autoindent
|
|
||||||
setlocal softtabstop=2
|
|
||||||
setlocal tabstop=2
|
|
||||||
setlocal shiftwidth=2
|
|
||||||
setlocal expandtab
|
|
||||||
|
|
||||||
if exists("*GetScalaIndent")
|
if exists("*GetScalaIndent")
|
||||||
finish
|
finish
|
||||||
@@ -543,7 +539,7 @@ function! GetScalaIndent()
|
|||||||
let ind = ind - 1
|
let ind = ind - 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if scala#LineEndsInIncomplete(curline)
|
if scala#LineEndsInIncomplete(prevline)
|
||||||
call scala#ConditionalConfirm("19")
|
call scala#ConditionalConfirm("19")
|
||||||
return ind
|
return ind
|
||||||
endif
|
endif
|
||||||
@@ -597,5 +593,6 @@ function! GetScalaIndent()
|
|||||||
|
|
||||||
return ind
|
return ind
|
||||||
endfunction
|
endfunction
|
||||||
" vim:set ts=2 sts=2 sw=2:
|
|
||||||
|
" vim:set sw=2 sts=2 ts=8 et:
|
||||||
" vim600:fdm=marker fdl=1 fdc=0:
|
" vim600:fdm=marker fdl=1 fdc=0:
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ let s:list_envs = ['itemize', 'enumerate', 'description']
|
|||||||
" indent on \left( and on \(, but not on (
|
" indent on \left( and on \(, but not on (
|
||||||
" indent on \left[ and on \[, but not on [
|
" indent on \left[ and on \[, but not on [
|
||||||
" indent on \left\{ and on {, but not on \{
|
" indent on \left\{ and on {, but not on \{
|
||||||
let s:open_pat = '\\\@<!\%(\\begin\|\\left\|\\(\|\\\[\|{\)'
|
let s:open_pat = '\\\@<!\%(\\begin\|\\left\a\@!\|\\(\|\\\[\|{\)'
|
||||||
let s:close_pat = '\\\@<!\%(\\end\|\\right\|\\)\|\\\]\|}\)'
|
let s:close_pat = '\\\@<!\%(\\end\|\\right\a\@!\|\\)\|\\\]\|}\)'
|
||||||
let s:list_open_pat = '\\\@<!\\begin{\%(' . join(s:list_envs, '\|') . '\)}'
|
let s:list_open_pat = '\\\@<!\\begin{\%(' . join(s:list_envs, '\|') . '\)}'
|
||||||
let s:list_close_pat = '\\\@<!\\end{\%(' . join(s:list_envs, '\|') . '\)}'
|
let s:list_close_pat = '\\\@<!\\end{\%(' . join(s:list_envs, '\|') . '\)}'
|
||||||
|
|
||||||
|
|||||||
79
indent/typescript.vim
Normal file
79
indent/typescript.vim
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
" Vim indent file, taken from indent/java.vim
|
||||||
|
" Language: Typescript
|
||||||
|
" Maintainer: None! Wanna improve this?
|
||||||
|
" Last Change: 2015 Mar 07
|
||||||
|
|
||||||
|
" Only load this indent file when no other was loaded.
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
" Use javascript cindent options
|
||||||
|
setlocal cindent cinoptions& cinoptions+=j1,J1
|
||||||
|
setlocal indentkeys&
|
||||||
|
|
||||||
|
" Load typescript indent function
|
||||||
|
setlocal indentexpr=GetTypescriptIndent()
|
||||||
|
|
||||||
|
let b:undo_indent = "setl cin< cino< indentkeys< indentexpr<"
|
||||||
|
|
||||||
|
" Only define the function once
|
||||||
|
if exists("*GetTypescriptIndent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Make sure we have vim capabilities
|
||||||
|
let s:keepcpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
function! TypescriptPrevNonBlankOrComment(lnum)
|
||||||
|
let pnum = prevnonblank(a:lnum)
|
||||||
|
" skip any comments (either `//`, `/*` or `*`)
|
||||||
|
while getline(pnum) =~ '^\s*\(\/\/\|\/\*\|\*\)'
|
||||||
|
let pnum = prevnonblank(pnum-1)
|
||||||
|
endwhile
|
||||||
|
return pnum
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function GetTypescriptIndent()
|
||||||
|
|
||||||
|
" default value: trust cindent
|
||||||
|
let ind = cindent(v:lnum)
|
||||||
|
|
||||||
|
if getline(v:lnum) =~ '^\s*[{}\*]'
|
||||||
|
return ind
|
||||||
|
endif
|
||||||
|
|
||||||
|
" The last non-empty line
|
||||||
|
let prev = TypescriptPrevNonBlankOrComment(v:lnum-1)
|
||||||
|
|
||||||
|
" Check if the previous line consists of a single `<variable> : <type>;`
|
||||||
|
" declaration (e.g. in interface definitions)
|
||||||
|
if getline(prev) =~ '^\s*\w\+\s*:[^{]\+;\s*$'
|
||||||
|
return indent(prev)
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Try to find out whether the last `}` ended a `<variable> : {` block
|
||||||
|
if getline(prev) =~ '};\s*$'
|
||||||
|
" jump to matching `{` bracket
|
||||||
|
call cursor(prev, 1)
|
||||||
|
silent normal %
|
||||||
|
|
||||||
|
" See if current line is type annotation without closing ';' but open
|
||||||
|
" `{` bracket
|
||||||
|
let lnum = line('.')
|
||||||
|
if getline(lnum) =~ '^\s*\w\+\s*:[^;]\+{'
|
||||||
|
let ind = indent(lnum)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ind
|
||||||
|
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Restore compatibility mode
|
||||||
|
let &cpo = s:keepcpo
|
||||||
|
unlet s:keepcpo
|
||||||
|
|
||||||
|
" vim: et
|
||||||
32
indent/vala.vim
Normal file
32
indent/vala.vim
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
" Copyright (c) 2012 Takezoe Tomoaki <tkztmk@outlook.com>
|
||||||
|
"
|
||||||
|
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
" of
|
||||||
|
" this software and associated documentation files (the "Software"), to deal in
|
||||||
|
" the Software without restriction, including without limitation the rights to
|
||||||
|
" use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
" of
|
||||||
|
" the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
" so,
|
||||||
|
" subject to the following conditions:
|
||||||
|
"
|
||||||
|
" The above copyright notice and this permission notice shall be included in all
|
||||||
|
" copies or substantial portions of the Software.
|
||||||
|
"
|
||||||
|
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
" FITNESS
|
||||||
|
" FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
" COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
" IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
" Vim indent file for Vala.
|
||||||
|
" It just sets cindent for Vala files...
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
setl cin
|
||||||
|
let b:undo_indent = "setl cin<"
|
||||||
|
|
||||||
5
indent/velocity.vim
Normal file
5
indent/velocity.vim
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
runtime! indent/html.vim
|
||||||
70
syntax/c.vim
70
syntax/c.vim
@@ -1,7 +1,7 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: C
|
" Language: C
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||||
" Last Change: 2013 Jul 05
|
" Last Change: 2015 Mar 05
|
||||||
|
|
||||||
" Quit when a (custom) syntax file was already loaded
|
" Quit when a (custom) syntax file was already loaded
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
@@ -35,28 +35,37 @@ syn match cSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
|
|||||||
if !exists("c_no_utf")
|
if !exists("c_no_utf")
|
||||||
syn match cSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)"
|
syn match cSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)"
|
||||||
endif
|
endif
|
||||||
if exists("c_no_cformat")
|
|
||||||
syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
|
if !exists("c_no_cformat")
|
||||||
" cCppString: same as cString, but ends at end of line
|
" Highlight % items in strings.
|
||||||
if !exists("cpp_no_cpp11") " ISO C++11
|
|
||||||
syn region cCppString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
|
||||||
else
|
|
||||||
syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
|
||||||
endif
|
|
||||||
syn region cCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cSpaceError,cCppSkip
|
|
||||||
syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip
|
|
||||||
else
|
|
||||||
if !exists("c_no_c99") " ISO C99
|
if !exists("c_no_c99") " ISO C99
|
||||||
syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
|
syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
|
||||||
else
|
else
|
||||||
syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
|
syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
|
||||||
endif
|
endif
|
||||||
syn match cFormat display "%%" contained
|
syn match cFormat display "%%" contained
|
||||||
|
endif
|
||||||
|
|
||||||
|
" cCppString: same as cString, but ends at end of line
|
||||||
|
if s:ft ==# "cpp" && !exists("cpp_no_cpp11") && !exists("c_no_cformat")
|
||||||
|
" ISO C++11
|
||||||
|
syn region cString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
|
||||||
|
syn region cCppString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
||||||
|
elseif s:ft ==# "c" && !exists("c_no_c11") && !exists("c_no_cformat")
|
||||||
|
" ISO C99
|
||||||
|
syn region cString start=+\%(L\|U\|u8\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
|
||||||
|
syn region cCppString start=+\%(L\|U\|u8\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
||||||
|
else
|
||||||
|
" older C or C++
|
||||||
|
syn match cFormat display "%%" contained
|
||||||
syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
|
syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
|
||||||
" cCppString: same as cString, but ends at end of line
|
|
||||||
syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip
|
||||||
|
|
||||||
|
syn cluster cStringGroup contains=cCppString,cCppSkip
|
||||||
|
|
||||||
syn match cCharacter "L\='[^\\]'"
|
syn match cCharacter "L\='[^\\]'"
|
||||||
syn match cCharacter "L'[^']*'" contains=cSpecial
|
syn match cCharacter "L'[^']*'" contains=cSpecial
|
||||||
if exists("c_gnu")
|
if exists("c_gnu")
|
||||||
@@ -70,7 +79,8 @@ syn match cSpecialCharacter display "L\='\\\o\{1,3}'"
|
|||||||
syn match cSpecialCharacter display "'\\x\x\{1,2}'"
|
syn match cSpecialCharacter display "'\\x\x\{1,2}'"
|
||||||
syn match cSpecialCharacter display "L'\\x\x\+'"
|
syn match cSpecialCharacter display "L'\\x\x\+'"
|
||||||
|
|
||||||
if !exists("c_no_c11") " ISO C11
|
if (s:ft ==# "c" && !exists("c_no_c11")) || (s:ft ==# "cpp" && !exists("cpp_no_cpp11"))
|
||||||
|
" ISO C11 or ISO C++ 11
|
||||||
if exists("c_no_cformat")
|
if exists("c_no_cformat")
|
||||||
syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
|
syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
|
||||||
else
|
else
|
||||||
@@ -102,24 +112,24 @@ endif
|
|||||||
" This should be before cErrInParen to avoid problems with #define ({ xxx })
|
" This should be before cErrInParen to avoid problems with #define ({ xxx })
|
||||||
if exists("c_curly_error")
|
if exists("c_curly_error")
|
||||||
syn match cCurlyError "}"
|
syn match cCurlyError "}"
|
||||||
syn region cBlock start="{" end="}" contains=ALLBUT,cBadBlock,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell fold
|
syn region cBlock start="{" end="}" contains=ALLBUT,cBadBlock,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell fold
|
||||||
else
|
else
|
||||||
syn region cBlock start="{" end="}" transparent fold
|
syn region cBlock start="{" end="}" transparent fold
|
||||||
endif
|
endif
|
||||||
|
|
||||||
"catch errors caused by wrong parenthesis and brackets
|
" Catch errors caused by wrong parenthesis and brackets.
|
||||||
" also accept <% for {, %> for }, <: for [ and :> for ] (C99)
|
" Also accept <% for {, %> for }, <: for [ and :> for ] (C99)
|
||||||
" But avoid matching <::.
|
" But avoid matching <::.
|
||||||
syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
|
syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
|
||||||
if exists("c_no_curly_error")
|
if exists("c_no_curly_error")
|
||||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
||||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell
|
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
||||||
syn match cParenError display ")"
|
syn match cParenError display ")"
|
||||||
syn match cErrInParen display contained "^^<%\|^%>"
|
syn match cErrInParen display contained "^^<%\|^%>"
|
||||||
else
|
else
|
||||||
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cCppString,@Spell
|
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
||||||
syn match cParenError display ")"
|
syn match cParenError display ")"
|
||||||
@@ -127,13 +137,13 @@ if exists("c_no_curly_error")
|
|||||||
endif
|
endif
|
||||||
elseif exists("c_no_bracket_error")
|
elseif exists("c_no_bracket_error")
|
||||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
||||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell
|
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
||||||
syn match cParenError display ")"
|
syn match cParenError display ")"
|
||||||
syn match cErrInParen display contained "<%\|%>"
|
syn match cErrInParen display contained "<%\|%>"
|
||||||
else
|
else
|
||||||
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cCppString,@Spell
|
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,@cStringGroup,@Spell
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
|
||||||
syn match cParenError display ")"
|
syn match cParenError display ")"
|
||||||
@@ -141,19 +151,19 @@ elseif exists("c_no_bracket_error")
|
|||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
|
||||||
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell
|
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
|
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
|
||||||
syn match cParenError display "[\])]"
|
syn match cParenError display "[\])]"
|
||||||
syn match cErrInParen display contained "<%\|%>"
|
syn match cErrInParen display contained "<%\|%>"
|
||||||
syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell
|
syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,@cStringGroup,@Spell
|
||||||
else
|
else
|
||||||
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell
|
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell
|
||||||
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
|
||||||
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
|
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
|
||||||
syn match cParenError display "[\])]"
|
syn match cParenError display "[\])]"
|
||||||
syn match cErrInParen display contained "[\]{}]\|<%\|%>"
|
syn match cErrInParen display contained "[\]{}]\|<%\|%>"
|
||||||
syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell
|
syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cErrInParen,cCppParen,cCppBracket,@cStringGroup,@Spell
|
||||||
endif
|
endif
|
||||||
" cCppBracket: same as cParen but ends at end-of-line; used in cDefine
|
" cCppBracket: same as cParen but ends at end-of-line; used in cDefine
|
||||||
syn region cCppBracket transparent start='\[\|<::\@!' skip='\\$' excludenl end=']\|:>' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell
|
syn region cCppBracket transparent start='\[\|<::\@!' skip='\\$' excludenl end=']\|:>' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell
|
||||||
@@ -322,6 +332,11 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
|
|||||||
syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET
|
syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET
|
||||||
syn keyword cConstant TMP_MAX stderr stdin stdout
|
syn keyword cConstant TMP_MAX stderr stdin stdout
|
||||||
syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX
|
syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX
|
||||||
|
" POSIX 2001
|
||||||
|
syn keyword cConstant SIGBUS SIGPOLL SIGPROF SIGSYS SIGURG
|
||||||
|
syn keyword cConstant SIGVTALRM SIGXCPU SIGXFSZ
|
||||||
|
" non-POSIX signals
|
||||||
|
syn keyword cConstant SIGWINCH SIGINFO
|
||||||
" Add POSIX errors as well
|
" Add POSIX errors as well
|
||||||
syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY
|
syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY
|
||||||
syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT
|
syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT
|
||||||
@@ -373,7 +388,7 @@ syn region cPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>
|
|||||||
" Highlight User Labels
|
" Highlight User Labels
|
||||||
syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
|
syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
|
||||||
if s:ft ==# 'c' || exists("cpp_no_cpp11")
|
if s:ft ==# 'c' || exists("cpp_no_cpp11")
|
||||||
syn region cMulti transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell
|
syn region cMulti transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell,@cStringGroup
|
||||||
endif
|
endif
|
||||||
" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
|
" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
|
||||||
syn cluster cLabelGroup contains=cUserLabel
|
syn cluster cLabelGroup contains=cUserLabel
|
||||||
@@ -458,8 +473,7 @@ hi def link cTodo Todo
|
|||||||
hi def link cBadContinuation Error
|
hi def link cBadContinuation Error
|
||||||
hi def link cCppOutSkip cCppOutIf2
|
hi def link cCppOutSkip cCppOutIf2
|
||||||
hi def link cCppInElse2 cCppOutIf2
|
hi def link cCppInElse2 cCppOutIf2
|
||||||
hi def link cCppOutIf2 cCppOut2 " Old syntax group for #if 0 body
|
hi def link cCppOutIf2 cCppOut
|
||||||
hi def link cCppOut2 cCppOut " Old syntax group for #if of #if 0
|
|
||||||
hi def link cCppOut Comment
|
hi def link cCppOut Comment
|
||||||
|
|
||||||
let b:current_syntax = "c"
|
let b:current_syntax = "c"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: C++
|
" Language: C++
|
||||||
" Current Maintainer: vim-jp (https://github.com/vim-jp/cpp-vim)
|
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
|
||||||
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
|
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
|
||||||
" Last Change: 2014 May 13
|
" Last Change: 2015 Mar 1
|
||||||
|
|
||||||
" 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
|
||||||
@@ -32,14 +32,21 @@ syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*$"
|
|||||||
syn keyword cppStorageClass mutable
|
syn keyword cppStorageClass mutable
|
||||||
syn keyword cppStructure class typename template namespace
|
syn keyword cppStructure class typename template namespace
|
||||||
syn keyword cppBoolean true false
|
syn keyword cppBoolean true false
|
||||||
|
syn keyword cppConstant __cplusplus
|
||||||
|
|
||||||
" C++ 11 extensions
|
" C++ 11 extensions
|
||||||
if !exists("cpp_no_cpp11")
|
if !exists("cpp_no_cpp11")
|
||||||
syn keyword cppType override final
|
syn keyword cppType override final
|
||||||
syn keyword cppExceptions noexcept
|
syn keyword cppExceptions noexcept
|
||||||
syn keyword cppStorageClass constexpr decltype
|
syn keyword cppStorageClass constexpr decltype thread_local
|
||||||
syn keyword cppConstant nullptr
|
syn keyword cppConstant nullptr
|
||||||
syn region cppRawString matchgroup=cppRawDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell
|
syn keyword cppConstant ATOMIC_FLAG_INIT ATOMIC_VAR_INIT
|
||||||
|
syn keyword cppConstant ATOMIC_BOOL_LOCK_FREE ATOMIC_CHAR_LOCK_FREE
|
||||||
|
syn keyword cppConstant ATOMIC_CHAR16_T_LOCK_FREE ATOMIC_CHAR32_T_LOCK_FREE
|
||||||
|
syn keyword cppConstant ATOMIC_WCHAR_T_LOCK_FREE ATOMIC_SHORT_LOCK_FREE
|
||||||
|
syn keyword cppConstant ATOMIC_INT_LOCK_FREE ATOMIC_LONG_LOCK_FREE
|
||||||
|
syn keyword cppConstant ATOMIC_LLONG_LOCK_FREE ATOMIC_POINTER_LOCK_FREE
|
||||||
|
syn region cppRawString matchgroup=cppRawDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" The minimum and maximum operators in GNU C++
|
" The minimum and maximum operators in GNU C++
|
||||||
|
|||||||
188
syntax/csv.vim
188
syntax/csv.vim
@@ -1,188 +0,0 @@
|
|||||||
" A simple syntax highlighting, simply alternate colors between two
|
|
||||||
" adjacent columns
|
|
||||||
" Init {{{2
|
|
||||||
let s:cpo_save = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
scriptencoding utf8
|
|
||||||
if version < 600
|
|
||||||
syn clear
|
|
||||||
elseif exists("b:current_syntax")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Helper functions "{{{2
|
|
||||||
fu! <sid>Warning(msg) "{{{3
|
|
||||||
" Don't redraw, so we are not overwriting messages from the ftplugin
|
|
||||||
" script
|
|
||||||
"redraw!
|
|
||||||
echohl WarningMsg
|
|
||||||
echomsg "CSV Syntax:" . a:msg
|
|
||||||
echohl Normal
|
|
||||||
endfu
|
|
||||||
|
|
||||||
fu! <sid>Esc(val, char) "{{2
|
|
||||||
return '\V'.escape(a:val, '\\'.a:char).'\m'
|
|
||||||
endfu
|
|
||||||
|
|
||||||
fu! <sid>CheckSaneSearchPattern() "{{{3
|
|
||||||
let s:del_def = ','
|
|
||||||
let s:col_def = '\%([^' . s:del_def . ']*' . s:del_def . '\|$\)'
|
|
||||||
let s:col_def_end = '\%([^' . s:del_def . ']*' . s:del_def . '\)'
|
|
||||||
|
|
||||||
" First:
|
|
||||||
" Check for filetype plugin. This syntax script relies on the filetype
|
|
||||||
" plugin, else, it won't work properly.
|
|
||||||
redir => s:a |sil filetype | redir end
|
|
||||||
let s:a=split(s:a, "\n")[0]
|
|
||||||
if match(s:a, '\cplugin:off') > 0
|
|
||||||
call <sid>Warning("No filetype support, only simple highlighting using"
|
|
||||||
\ . s:del_def . " as delimiter! See :h csv-installation")
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Check Comment setting
|
|
||||||
if !exists("g:csv_comment")
|
|
||||||
let b:csv_cmt = split(&cms, '%s')
|
|
||||||
else
|
|
||||||
let b:csv_cmt = split(g:csv_comment, '%s')
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
" Second: Check for sane defaults for the column pattern
|
|
||||||
" Not necessary to check for fixed width columns
|
|
||||||
if exists("b:csv_fixed_width_cols")
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
" Try a simple highlighting, if the defaults from the ftplugin
|
|
||||||
" don't exist
|
|
||||||
let s:col = exists("b:col") && !empty(b:col) ? b:col
|
|
||||||
\ : s:col_def
|
|
||||||
let s:col_end = exists("b:col_end") && !empty(b:col_end) ? b:col_end
|
|
||||||
\ : s:col_def_end
|
|
||||||
let s:del = exists("b:delimiter") && !empty(b:delimiter) ? b:delimiter
|
|
||||||
\ : s:del_def
|
|
||||||
let s:cmts = exists("b:csv_cmt") ? b:csv_cmt[0] : split(&cms, '&s')[0]
|
|
||||||
let s:cmte = exists("b:csv_cmt") && len(b:csv_cmt) == 2 ? b:csv_cmt[1]
|
|
||||||
\ : ''
|
|
||||||
|
|
||||||
if line('$') > 1 && (!exists("b:col") || empty(b:col))
|
|
||||||
" check for invalid pattern, ftplugin hasn't been loaded yet
|
|
||||||
call <sid>Warning("Invalid column pattern, using default pattern " . s:col_def)
|
|
||||||
endif
|
|
||||||
endfu
|
|
||||||
|
|
||||||
" Syntax rules {{{2
|
|
||||||
fu! <sid>DoHighlight() "{{{3
|
|
||||||
if has("conceal") && !exists("g:csv_no_conceal") &&
|
|
||||||
\ !exists("b:csv_fixed_width_cols")
|
|
||||||
" old val
|
|
||||||
"\ '\%(.\)\@=/ms=e,me=e contained conceal cchar=' .
|
|
||||||
" Has a problem with the last line!
|
|
||||||
exe "syn match CSVDelimiter /" . s:col_end .
|
|
||||||
\ '/ms=e,me=e contained conceal cchar=' .
|
|
||||||
\ (&enc == "utf-8" ? "│" : '|')
|
|
||||||
"exe "syn match CSVDelimiterEOL /" . s:del .
|
|
||||||
" \ '\?$/ contained conceal cchar=' .
|
|
||||||
" \ (&enc == "utf-8" ? "│" : '|')
|
|
||||||
hi def link CSVDelimiter Conceal
|
|
||||||
elseif !exists("b:csv_fixed_width_cols")
|
|
||||||
" The \%(.\)\@<= makes sure, the last char won't be concealed,
|
|
||||||
" if it isn't a delimiter
|
|
||||||
"exe "syn match CSVDelimiter /" . s:col . '\%(.\)\@<=/ms=e,me=e contained'
|
|
||||||
exe "syn match CSVDelimiter /" . s:col_end . '/ms=e,me=e contained'
|
|
||||||
"exe "syn match CSVDelimiterEOL /" . s:del . '\?$/ contained'
|
|
||||||
if has("conceal")
|
|
||||||
hi def link CSVDelimiter Conceal
|
|
||||||
else
|
|
||||||
hi def link CSVDelimiter Ignore
|
|
||||||
endif
|
|
||||||
endif " There is no delimiter for csv fixed width columns
|
|
||||||
|
|
||||||
|
|
||||||
if !exists("b:csv_fixed_width_cols")
|
|
||||||
exe 'syn match CSVColumnEven nextgroup=CSVColumnOdd /'
|
|
||||||
\ . s:col . '/ contains=CSVDelimiter'
|
|
||||||
exe 'syn match CSVColumnOdd nextgroup=CSVColumnEven /'
|
|
||||||
\ . s:col . '/ contains=CSVDelimiter'
|
|
||||||
|
|
||||||
exe 'syn match CSVColumnHeaderEven nextgroup=CSVColumnHeaderOdd /\%1l'
|
|
||||||
\. s:col . '/ contains=CSVDelimiter'
|
|
||||||
exe 'syn match CSVColumnHeaderOdd nextgroup=CSVColumnHeaderEven /\%1l'
|
|
||||||
\. s:col . '/ contains=CSVDelimiter'
|
|
||||||
else
|
|
||||||
for i in range(len(b:csv_fixed_width_cols))
|
|
||||||
let pat = '/\%' . b:csv_fixed_width_cols[i] . 'v.*' .
|
|
||||||
\ ((i == len(b:csv_fixed_width_cols)-1) ? '/' :
|
|
||||||
\ '\%' . b:csv_fixed_width_cols[i+1] . 'v/')
|
|
||||||
|
|
||||||
let group = "CSVColumn" . (i%2 ? "Odd" : "Even" )
|
|
||||||
let ngroup = "CSVColumn" . (i%2 ? "Even" : "Odd" )
|
|
||||||
exe "syn match " group pat " nextgroup=" . ngroup
|
|
||||||
endfor
|
|
||||||
endif
|
|
||||||
" Comment regions
|
|
||||||
exe 'syn match CSVComment /'. <sid>Esc(s:cmts, '/'). '.*'.
|
|
||||||
\ (!empty(s:cmte) ? '\%('. <sid>Esc(s:cmte, '/'). '\)\?'
|
|
||||||
\: ''). '/'
|
|
||||||
hi def link CSVComment Comment
|
|
||||||
endfun
|
|
||||||
|
|
||||||
fu! <sid>DoSyntaxDefinitions() "{{{3
|
|
||||||
syn spell toplevel
|
|
||||||
|
|
||||||
" Not really needed
|
|
||||||
syn case ignore
|
|
||||||
|
|
||||||
hi def link CSVColumnHeaderOdd WarningMsg
|
|
||||||
hi def link CSVColumnHeaderEven WarningMsg
|
|
||||||
hi def link CSVColumnOdd DiffAdd
|
|
||||||
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
|
|
||||||
|
|
||||||
" Main: {{{2
|
|
||||||
" Make sure, we are using a sane, valid pattern for syntax
|
|
||||||
" highlighting
|
|
||||||
call <sid>CheckSaneSearchPattern()
|
|
||||||
|
|
||||||
" Define all necessary syntax groups
|
|
||||||
call <sid>DoSyntaxDefinitions()
|
|
||||||
|
|
||||||
" Highlight the file
|
|
||||||
call <sid>DoHighlight()
|
|
||||||
|
|
||||||
" Set the syntax variable {{{2
|
|
||||||
let b:current_syntax="csv"
|
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
|
||||||
unlet s:cpo_save
|
|
||||||
@@ -10,7 +10,7 @@ endif
|
|||||||
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/
|
||||||
syntax match dockerfileKeyword /\v^\s*(ENTRYPOINT|VOLUME|USER|WORKDIR)\s/
|
syntax match dockerfileKeyword /\v^\s*(ENTRYPOINT|VOLUME|USER|WORKDIR|COPY)\s/
|
||||||
highlight link dockerfileKeyword Keyword
|
highlight link dockerfileKeyword Keyword
|
||||||
|
|
||||||
syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/
|
syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/
|
||||||
|
|||||||
@@ -15,13 +15,15 @@ syn cluster elixirNotTop contains=@elixirRegexSpecial,@elixirStringContained,@el
|
|||||||
syn match elixirComment '#.*' contains=elixirTodo
|
syn match elixirComment '#.*' contains=elixirTodo
|
||||||
syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained
|
syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained
|
||||||
|
|
||||||
syn keyword elixirKeyword is_atom is_binary is_bitstring is_boolean is_float is_function is_integer is_list is_number is_pid is_port is_record is_reference is_tuple is_exception
|
syn keyword elixirKeyword is_atom is_binary is_bitstring is_boolean is_float is_function is_integer is_list is_map is_number is_pid is_port is_record is_reference is_tuple is_exception
|
||||||
syn keyword elixirKeyword case cond for if unless try receive send
|
syn keyword elixirKeyword case when cond for if unless try receive send
|
||||||
syn keyword elixirKeyword exit raise throw after rescue catch else do end
|
syn keyword elixirKeyword exit raise throw after rescue catch else do end
|
||||||
syn keyword elixirKeyword quote unquote super
|
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
|
||||||
@@ -68,7 +70,7 @@ syn region elixirRegex matchgroup=elixirRegexDelimiter start="%r/" end="/[uiomxf
|
|||||||
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=elixirStringDelimiter start="'" end="'" skip="\\'"
|
syn region elixirString matchgroup=elixirStringDelimiter start="'" end="'" skip="\\'|\\\\"
|
||||||
syn region elixirString matchgroup=elixirStringDelimiter start='"' end='"' skip='\\"' contains=@elixirStringContained
|
syn region elixirString matchgroup=elixirStringDelimiter start='"' end='"' skip='\\"' contains=@elixirStringContained
|
||||||
syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,elixirComment,@elixirNotTop
|
syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,elixirComment,@elixirNotTop
|
||||||
|
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -1,137 +1,271 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: Erlang
|
" Language: Erlang (http://www.erlang.org)
|
||||||
" Maintainer: Oscar Hellstr<74>m <oscar@oscarh.net>
|
" Maintainer: Csaba Hoch <csaba.hoch@gmail.com>
|
||||||
" URL: http://oscar.hellstrom.st
|
" Contributor: Adam Rutkowski <hq@mtod.org>
|
||||||
" Version: 2010-08-09
|
" Last Update: 2013-Nov-23
|
||||||
" ------------------------------------------------------------------------------
|
" License: Vim license
|
||||||
" {{{1
|
" URL: https://github.com/hcs42/vim-erlang
|
||||||
" Options:
|
|
||||||
"
|
" Acknowledgements: This script was originally created by Kresimir Marzic [1].
|
||||||
" Erlang BIFs
|
" The script was then revamped by Csaba Hoch [2]. During the revamp, the new
|
||||||
" g:erlangHighlightBif - highlight erlang built in functions (default: off)
|
" highlighting style and some code was taken from the Erlang syntax script
|
||||||
"
|
" that is part of vimerl [3], created by Oscar Hellström [4] and improved by
|
||||||
" }}}
|
" Ricardo Catalinas Jiménez [5].
|
||||||
" -----------------------------------------------------------------------------
|
|
||||||
|
" [1]: Kreąimir Marľić (Kresimir Marzic) <kmarzic@fly.srk.fer.hr>
|
||||||
|
" [2]: Csaba Hoch <csaba.hoch@gmail.com>
|
||||||
|
" [3]: https://github.com/jimenezrick/vimerl
|
||||||
|
" [4]: Oscar Hellström <oscar@oscarh.net> (http://oscar.hellstrom.st)
|
||||||
|
" [5]: Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
||||||
|
|
||||||
|
" Customization:
|
||||||
|
"
|
||||||
|
" To use the old highlighting style, add this to your .vimrc:
|
||||||
|
"
|
||||||
|
" let g:erlang_old_style_highlight = 1
|
||||||
|
"
|
||||||
|
" To highlight further module attributes, add them to
|
||||||
|
" ~/.vim/after/syntax/erlang.vim:
|
||||||
|
"
|
||||||
|
" syn keyword erlangAttribute myattr1 myattr2 contained
|
||||||
|
|
||||||
" Setup {{{1
|
|
||||||
" 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
|
||||||
if version < 600
|
if version < 600
|
||||||
syntax clear
|
syntax clear
|
||||||
elseif exists("b:current_syntax")
|
elseif exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Erlang is case sensitive
|
let s:cpo_save = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
" Case sensitive
|
||||||
syn case match
|
syn case match
|
||||||
|
|
||||||
" Match groups {{{1
|
if version >= 600
|
||||||
syn match erlangStringModifier /\\./ contained
|
setlocal iskeyword+=$,@-@
|
||||||
syn match erlangStringModifier /\~\%(-\?[0-9*]\+\)\?\%(\.[0-9*]\+\..\?\)\?\%(c\|f\|e\|g\|s\|w\|p\|W\|P\|B\|X\|#\|b\|+\|n\|i\)/ contained
|
endif
|
||||||
syn match erlangModifier /\$\\\?./
|
|
||||||
|
" Comments
|
||||||
syn match erlangInteger /\<\%([0-9]\+#[0-9a-fA-F]\+\|[0-9]\+\)\>/
|
syn match erlangComment '%.*$' contains=erlangCommentAnnotation,erlangTodo
|
||||||
syn match erlangFloat /\<[0-9]\+\.[0-9]\+\%(e-\?[0-9]\+\)\?\>/
|
syn match erlangCommentAnnotation ' \@<=@\%(clear\|docfile\|end\|headerfile\|todo\|TODO\|type\|author\|copyright\|doc\|reference\|see\|since\|title\|version\|deprecated\|hidden\|private\|equiv\|spec\|throws\)' contained
|
||||||
|
syn match erlangCommentAnnotation /`[^']*'/ contained
|
||||||
syn keyword erlangTodo TODO FIXME XXX contained
|
syn keyword erlangTodo TODO FIXME XXX contained
|
||||||
syn match erlangComment /%.*$/ contains=@Spell,erlangTodo
|
|
||||||
|
" Numbers (minimum base is 2, maximum is 36.)
|
||||||
syn keyword erlangKeyword band bor bnot bsl bsr bxor div rem xor
|
syn match erlangNumberInteger '\<\d\+\>'
|
||||||
syn keyword erlangKeyword try catch begin receive after cond fun let query
|
syn match erlangNumberInteger '\<\%([2-9]\|[12]\d\|3[0-6]\)\+#[[:alnum:]]\+\>'
|
||||||
|
syn match erlangNumberFloat '\<\d\+\.\d\+\%([eE][+-]\=\d\+\)\=\>'
|
||||||
syn keyword erlangConditional case if of end
|
|
||||||
syn keyword erlangConditional not and or andalso orelse
|
" Strings, atoms, characters
|
||||||
syn keyword erlangConditional when
|
syn region erlangString start=/"/ end=/"/ contains=erlangStringModifier
|
||||||
|
syn region erlangQuotedAtom start=/'/ end=/'/ contains=erlangQuotedAtomModifier
|
||||||
syn keyword erlangBoolean true false
|
syn match erlangStringModifier '\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\|\~\%([ni~]\|\%(-\=\d\+\|\*\)\=\.\=\%(\*\|\d\+\)\=\%(\..\)\=[tl]*[cfegswpWPBX#bx+]\)' contained
|
||||||
|
syn match erlangQuotedAtomModifier '\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' contained
|
||||||
syn keyword erlangGuard is_list is_alive is_atom is_binary is_bitstring is_boolean is_tuple is_number is_integer is_float is_function is_constant is_pid is_port is_reference is_record is_process_alive
|
syn match erlangModifier '\$\%([^\\]\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\)'
|
||||||
|
|
||||||
syn match erlangOperator /\/\|*\|+\|-\|++\|--/
|
" Operators, separators
|
||||||
syn match erlangOperator /->\|<-\|||\||\|!\|=/
|
syn match erlangOperator '==\|=:=\|/=\|=/=\|<\|=<\|>\|>=\|=>\|:=\|++\|--\|=\|!\|<-\|+\|-\|\*\|\/'
|
||||||
syn match erlangOperator /=:=\|==\|\/=\|=\/=\|<\|>\|=<\|>=/
|
syn keyword erlangOperator div rem or xor bor bxor bsl bsr and band not bnot andalso orelse
|
||||||
syn keyword erlangOperator div rem
|
syn match erlangBracket '{\|}\|\[\|]\||\|||'
|
||||||
|
syn match erlangPipe '|'
|
||||||
syn region erlangString start=/"/ end=/"/ skip=/\\/ contains=@Spell,erlangStringModifier
|
syn match erlangRightArrow '->'
|
||||||
|
|
||||||
syn match erlangVariable /\<[A-Z_]\w*\>/
|
" Atoms, function calls (order is important)
|
||||||
syn match erlangAtom /\%(\%(^-\)\|#\)\@<!\<[a-z][A-Za-z0-9_]*\>\%(\s*[(:]\)\@!/
|
syn match erlangAtom '\<\l[[:alnum:]_@]*' contains=erlangBoolean
|
||||||
syn match erlangAtom /\\\@<!'[^']*\\\@<!'/
|
syn keyword erlangBoolean true false contained
|
||||||
|
syn match erlangLocalFuncCall '\<\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*(\)\@=' contains=erlangBIF
|
||||||
syn match erlangRecord /#\w\+/
|
syn match erlangLocalFuncRef '\<\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@='
|
||||||
|
syn match erlangGlobalFuncCall '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*(\)\@=' contains=erlangComment
|
||||||
syn match erlangTuple /{\|}/
|
syn match erlangGlobalFuncRef '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@=' contains=erlangComment
|
||||||
syn match erlangList /\[\|\]/
|
|
||||||
|
" Variables, macros, records, maps
|
||||||
syn match erlangAttribute /^-\%(vsn\|author\|copyright\|compile\|deprecated\|module\|export\|import\|behaviour\|export_type\|ignore_xref\) *(\@=/
|
syn match erlangVariable '\<[A-Z_][[:alnum:]_@]*'
|
||||||
syn match erlangInclude /^-include\%(_lib\)\?\s*(\@=/
|
syn match erlangMacro '??\=[[:alnum:]_@]\+'
|
||||||
syn match erlangRecordDef /^-record\s*(\@=/
|
syn match erlangMacro '\%(-define(\)\@<=[[:alnum:]_@]\+'
|
||||||
syn match erlangDefine /^-\%(define\|undef\)\s*(\@=/
|
syn match erlangMap '#'
|
||||||
syn match erlangPreCondit /^-\%(ifdef\|ifndef\|else\|endif\)\%(\s*(\@=\)\?/
|
syn match erlangRecord '#\s*\l[[:alnum:]_@]*'
|
||||||
|
|
||||||
syn match erlangType /^-\%(spec\|type\)[( ]\@=/
|
" Shebang (this line has to be after the ErlangMap)
|
||||||
|
syn match erlangShebang '^#!.*'
|
||||||
syn match erlangMacro /\%(-define(\)\@<=\w\+/
|
|
||||||
syn match erlangMacro /?\w\+/
|
" Bitstrings
|
||||||
|
syn match erlangBitType '\%(\/\%(\s\|\n\|%.*\n\)*\)\@<=\%(integer\|float\|binary\|bytes\|bitstring\|bits\|binary\|utf8\|utf16\|utf32\|signed\|unsigned\|big\|little\|native\|unit\)\%(\%(\s\|\n\|%.*\n\)*-\%(\s\|\n\|%.*\n\)*\%(integer\|float\|binary\|bytes\|bitstring\|bits\|binary\|utf8\|utf16\|utf32\|signed\|unsigned\|big\|little\|native\|unit\)\)*' contains=erlangComment
|
||||||
syn match erlangBitType /\%(\/\|-\)\@<=\%(bits\|bitstring\|binary\|integer\|float\|unit\)\>/
|
|
||||||
syn match erlangBitSize /:\@<=[0-9]\+/
|
" Constants and Directives
|
||||||
|
syn match erlangUnknownAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\l[[:alnum:]_@]*' contains=erlangComment
|
||||||
syn match erlangBinary /<<\|>>/
|
syn match erlangAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\%(behaviou\=r\|compile\|export\(_type\)\=\|file\|import\|module\|author\|copyright\|doc\|vsn\|on_load\)\>' contains=erlangComment
|
||||||
|
syn match erlangInclude '^\s*-\%(\s\|\n\|%.*\n\)*\%(include\|include_lib\)\>' contains=erlangComment
|
||||||
" BIFS
|
syn match erlangRecordDef '^\s*-\%(\s\|\n\|%.*\n\)*record\>' contains=erlangComment
|
||||||
syn match erlangBIF /\%([^:0-9A-Za-z_]\|\<erlang:\)\@<=\%(abs\|apply\|atom_to_list\|binary_part\|binary_to_list\|binary_to_term\|binary_to_atom\|binary_to_existing_atom\|bitstring_to_list\|check_process_code\|concat_binary\|date\|delete_module\|disconnect_node\|element\|erase\|error\|exit\|float\|float_to_list\|garbage_collect\|get\|get_keys\|group_leader\|halt\|hd\|integer_to_list\|iolist_to_binary\|iolist_size\|length\|link\|list_to_atom\|list_to_binary\|list_to_bitstring\|list_to_existing_atom\|list_to_float\|list_to_integer\|list_to_pid\|list_to_tuple\|load_module\|make_ref\|monitor_node\|node\|nodes\|now\|open_port\|pid_to_list\|port_close\|port_command\|port_connect\|port_control\|pre_loaded\|process_flag\|process_info\|processes\|purge_module\|put\|register\|registered\|round\|self\|setelement\|size\|bit_size\|byte_size\|spawn\|spawn_link\|spawn_opt\|split_binary\|statistics\|term_to_binary\|throw\|time\|tl\|trunc\|tuple_to_list\|unlink\|unregister\|whereis\)\((\|\/[0-9]\)\@=/
|
syn match erlangDefine '^\s*-\%(\s\|\n\|%.*\n\)*\%(define\|undef\)\>' contains=erlangComment
|
||||||
syn match erlangBIF /\<\%(erlang:\)\@<=\%(append_element\|bump_reductions\|cancel_timer\|decode_packet\|demonitor\|display\|fault\|fun_info\|fun_to_list\|function_exported\|get_cookie\|get_stacktrace\|hash\|hibernate\|info\|is_builtin\|loaded\|localtime\|localtime_to_universaltime\|localtime_to_universaltime\|make_tuple\|md5\|md5_init\|md5_update\|memory\|monitor\|monitor_node\|phash\|phash2\|port_call\|port_info\|port_to_list\|ports\|process_display\|raise\|read_timer\|ref_to_list\|resume_process\|send\|send_after\|send_nosuspend\|set_cookie\|spawn_monitor\|start_timer\|suspend_process\|system_flag\|system_info\|system_monitor\|trace\|trace_delivered\|trace_info\|trace_pattern\|universaltime\|universaltime_to_localtime\|yield\)(\@=/
|
syn match erlangPreCondit '^\s*-\%(\s\|\n\|%.*\n\)*\%(ifdef\|ifndef\|else\|endif\)\>' contains=erlangComment
|
||||||
syn match erlangGBIF /erlang\(:\w\)\@=/
|
syn match erlangType '^\s*-\%(\s\|\n\|%.*\n\)*\%(spec\|type\|opaque\|callback\)\>' contains=erlangComment
|
||||||
" }}}
|
|
||||||
|
" Keywords
|
||||||
" Link Erlang stuff to Vim groups {{{1
|
syn keyword erlangKeyword after begin case catch cond end fun if let of
|
||||||
hi link erlangTodo Todo
|
syn keyword erlangKeyword receive when try
|
||||||
hi link erlangString String
|
|
||||||
hi link erlangNoSpellString String
|
" Build-in-functions (BIFs)
|
||||||
hi link erlangModifier SpecialChar
|
syn keyword erlangBIF abs alive apply atom_to_binary atom_to_list contained
|
||||||
hi link erlangStringModifier SpecialChar
|
syn keyword erlangBIF binary_part binary_to_atom contained
|
||||||
hi link erlangComment Comment
|
syn keyword erlangBIF binary_to_existing_atom binary_to_float contained
|
||||||
hi link erlangVariable Identifier
|
syn keyword erlangBIF binary_to_integer bitstring_to_list contained
|
||||||
hi link erlangInclude Include
|
syn keyword erlangBIF binary_to_list binary_to_term bit_size contained
|
||||||
hi link erlangRecordDef Keyword
|
syn keyword erlangBIF byte_size check_old_code check_process_code contained
|
||||||
hi link erlangAttribute Keyword
|
syn keyword erlangBIF concat_binary date delete_module demonitor contained
|
||||||
hi link erlangKeyword Keyword
|
syn keyword erlangBIF disconnect_node element erase error exit contained
|
||||||
hi link erlangMacro Macro
|
syn keyword erlangBIF float float_to_binary float_to_list contained
|
||||||
hi link erlangDefine Define
|
syn keyword erlangBIF garbage_collect get get_keys group_leader contained
|
||||||
hi link erlangPreCondit PreCondit
|
syn keyword erlangBIF halt hd integer_to_binary integer_to_list contained
|
||||||
hi link erlangPreProc PreProc
|
syn keyword erlangBIF iolist_to_binary iolist_size is_alive contained
|
||||||
hi link erlangDelimiter Delimiter
|
syn keyword erlangBIF is_atom is_binary is_bitstring is_boolean contained
|
||||||
hi link erlangBitDelimiter Normal
|
syn keyword erlangBIF is_float is_function is_integer is_list contained
|
||||||
hi link erlangOperator Operator
|
syn keyword erlangBIF is_number is_pid is_port is_process_alive contained
|
||||||
hi link erlangConditional Conditional
|
syn keyword erlangBIF is_record is_reference is_tuple length link contained
|
||||||
hi link erlangGuard Conditional
|
syn keyword erlangBIF list_to_atom list_to_binary contained
|
||||||
hi link erlangBoolean Boolean
|
syn keyword erlangBIF list_to_bitstring list_to_existing_atom contained
|
||||||
hi link erlangAtom Constant
|
syn keyword erlangBIF list_to_float list_to_integer list_to_pid contained
|
||||||
hi link erlangRecord Structure
|
syn keyword erlangBIF list_to_tuple load_module make_ref max min contained
|
||||||
hi link erlangInteger Number
|
syn keyword erlangBIF module_loaded monitor monitor_node node contained
|
||||||
hi link erlangFloat Number
|
syn keyword erlangBIF nodes now open_port pid_to_list port_close contained
|
||||||
hi link erlangFloat Number
|
syn keyword erlangBIF port_command port_connect pre_loaded contained
|
||||||
hi link erlangFloat Number
|
syn keyword erlangBIF process_flag process_flag process_info contained
|
||||||
hi link erlangFloat Number
|
syn keyword erlangBIF process purge_module put register registered contained
|
||||||
hi link erlangHex Number
|
syn keyword erlangBIF round self setelement size spawn spawn_link contained
|
||||||
hi link erlangBIF Keyword
|
syn keyword erlangBIF spawn_monitor spawn_opt split_binary contained
|
||||||
hi link erlangFun Keyword
|
syn keyword erlangBIF statistics term_to_binary throw time tl contained
|
||||||
hi link erlangList Delimiter
|
syn keyword erlangBIF trunc tuple_size tuple_to_list unlink contained
|
||||||
hi link erlangTuple Delimiter
|
syn keyword erlangBIF unregister whereis contained
|
||||||
hi link erlangBinary Keyword
|
|
||||||
hi link erlangBitVariable Identifier
|
" Sync at the beginning of functions: if this is not used, multiline string
|
||||||
hi link erlangBitType Type
|
" are not always recognized, and the indentation script cannot use the
|
||||||
hi link erlangType Type
|
" "searchpair" (because it would not always skip strings and comments when
|
||||||
hi link erlangBitSize Number
|
" looking for keywords and opening parens/brackets).
|
||||||
" }}}
|
syn sync match erlangSync grouphere NONE "^[a-z]\s*("
|
||||||
|
let b:erlang_syntax_synced = 1
|
||||||
" Optional linkings {{{1
|
|
||||||
if exists("g:erlangHighlightBif") && g:erlangHighlightBif
|
" Define the default highlighting. See ":help group-name" for the groups and
|
||||||
hi link erlangGBIF Keyword
|
" their colors.
|
||||||
|
|
||||||
|
let s:old_style = (exists("g:erlang_old_style_highlight") &&
|
||||||
|
\g:erlang_old_style_highlight == 1)
|
||||||
|
|
||||||
|
" For version 5.7 and earlier: only when not done already
|
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||||
|
if version >= 508 || !exists("did_erlang_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_erlang_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
HiLink erlangComment Comment
|
||||||
|
HiLink erlangCommentAnnotation Special
|
||||||
|
HiLink erlangTodo Todo
|
||||||
|
HiLink erlangShebang Comment
|
||||||
|
|
||||||
|
" Numbers
|
||||||
|
HiLink erlangNumberInteger Number
|
||||||
|
HiLink erlangNumberFloat Float
|
||||||
|
|
||||||
|
" Strings, atoms, characters
|
||||||
|
HiLink erlangString String
|
||||||
|
|
||||||
|
if s:old_style
|
||||||
|
HiLink erlangQuotedAtom Type
|
||||||
|
else
|
||||||
|
HiLink erlangQuotedAtom String
|
||||||
|
endif
|
||||||
|
|
||||||
|
HiLink erlangStringModifier Special
|
||||||
|
HiLink erlangQuotedAtomModifier Special
|
||||||
|
HiLink erlangModifier Special
|
||||||
|
|
||||||
|
" Operators, separators
|
||||||
|
HiLink erlangOperator Operator
|
||||||
|
HiLink erlangRightArrow Operator
|
||||||
|
if s:old_style
|
||||||
|
HiLink erlangBracket Normal
|
||||||
|
HiLink erlangPipe Normal
|
||||||
|
else
|
||||||
|
HiLink erlangBracket Delimiter
|
||||||
|
HiLink erlangPipe Delimiter
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Atoms, functions, variables, macros
|
||||||
|
if s:old_style
|
||||||
|
HiLink erlangAtom Normal
|
||||||
|
HiLink erlangLocalFuncCall Normal
|
||||||
|
HiLink erlangLocalFuncRef Normal
|
||||||
|
HiLink erlangGlobalFuncCall Function
|
||||||
|
HiLink erlangGlobalFuncRef Function
|
||||||
|
HiLink erlangVariable Normal
|
||||||
|
HiLink erlangMacro Normal
|
||||||
|
HiLink erlangRecord Normal
|
||||||
|
HiLink erlangMap Normal
|
||||||
|
else
|
||||||
|
HiLink erlangAtom String
|
||||||
|
HiLink erlangLocalFuncCall Normal
|
||||||
|
HiLink erlangLocalFuncRef Normal
|
||||||
|
HiLink erlangGlobalFuncCall Normal
|
||||||
|
HiLink erlangGlobalFuncRef Normal
|
||||||
|
HiLink erlangVariable Identifier
|
||||||
|
HiLink erlangMacro Macro
|
||||||
|
HiLink erlangRecord Structure
|
||||||
|
HiLink erlangMap Structure
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Bitstrings
|
||||||
|
if !s:old_style
|
||||||
|
HiLink erlangBitType Type
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Constants and Directives
|
||||||
|
if s:old_style
|
||||||
|
HiLink erlangAttribute Type
|
||||||
|
HiLink erlangMacroDef Type
|
||||||
|
HiLink erlangUnknownAttribute Normal
|
||||||
|
HiLink erlangInclude Type
|
||||||
|
HiLink erlangRecordDef Type
|
||||||
|
HiLink erlangDefine Type
|
||||||
|
HiLink erlangPreCondit Type
|
||||||
|
HiLink erlangType Type
|
||||||
|
else
|
||||||
|
HiLink erlangAttribute Keyword
|
||||||
|
HiLink erlangMacroDef Macro
|
||||||
|
HiLink erlangUnknownAttribute Normal
|
||||||
|
HiLink erlangInclude Include
|
||||||
|
HiLink erlangRecordDef Keyword
|
||||||
|
HiLink erlangDefine Define
|
||||||
|
HiLink erlangPreCondit PreCondit
|
||||||
|
HiLink erlangType Type
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Keywords
|
||||||
|
HiLink erlangKeyword Keyword
|
||||||
|
|
||||||
|
" Build-in-functions (BIFs)
|
||||||
|
HiLink erlangBIF Function
|
||||||
|
|
||||||
|
if s:old_style
|
||||||
|
HiLink erlangBoolean Statement
|
||||||
|
HiLink erlangExtra Statement
|
||||||
|
HiLink erlangSignal Statement
|
||||||
|
else
|
||||||
|
HiLink erlangBoolean Boolean
|
||||||
|
HiLink erlangExtra Statement
|
||||||
|
HiLink erlangSignal Statement
|
||||||
|
endif
|
||||||
|
|
||||||
|
delcommand HiLink
|
||||||
endif
|
endif
|
||||||
" }}}
|
|
||||||
|
|
||||||
let b:current_syntax = "erlang"
|
let b:current_syntax = "erlang"
|
||||||
|
|
||||||
" vim: set foldmethod=marker:
|
let &cpo = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
|
||||||
|
" vim: sw=2 et
|
||||||
|
|||||||
@@ -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'
|
||||||
|
|||||||
@@ -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 "[]".
|
||||||
@@ -65,6 +67,10 @@ if !exists("g:go_highlight_structs")
|
|||||||
let g:go_highlight_structs = 0
|
let g:go_highlight_structs = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists("g:go_highlight_build_constraints")
|
||||||
|
let g:go_highlight_build_constraints = 0
|
||||||
|
endif
|
||||||
|
|
||||||
syn case match
|
syn case match
|
||||||
|
|
||||||
syn keyword goDirective package import
|
syn keyword goDirective package import
|
||||||
@@ -107,10 +113,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 +147,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
|
||||||
@@ -199,7 +207,7 @@ endif
|
|||||||
" Extra types commonly seen
|
" Extra types commonly seen
|
||||||
if g: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
|
||||||
@@ -266,6 +274,21 @@ endif
|
|||||||
hi def link goStruct Function
|
hi def link goStruct Function
|
||||||
hi def link goStructDef Function
|
hi def link goStructDef Function
|
||||||
|
|
||||||
|
" Build Constraints
|
||||||
|
if g:go_highlight_build_constraints != 0
|
||||||
|
syn keyword goBuildOs contained ignore cgo android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris windows
|
||||||
|
syn keyword goBuildArch contained 386 amd64 amd64p32 arm
|
||||||
|
syn match goBuildDirective display contained "+build"
|
||||||
|
syn region goBuildComment start="//\s*+build" end="$" contains=goBuildDirective,goBuildOs,goBuildArch
|
||||||
|
syn region goBuildComment start="/\*\s*+build" end="\*/" contains=goBuildDirective,goBuildOs,goBuildArch
|
||||||
|
endif
|
||||||
|
|
||||||
|
hi def link goBuildComment Comment
|
||||||
|
hi def link goBuildOs Type
|
||||||
|
hi def link goBuildArch Type
|
||||||
|
hi def link goBuildDirective PreProc
|
||||||
|
|
||||||
|
|
||||||
" Search backwards for a global declaration to start processing the syntax.
|
" Search backwards for a global declaration to start processing the syntax.
|
||||||
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
|
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,10 @@
|
|||||||
syn keyword htmlTagName contained article aside audio canvas command
|
syn keyword htmlTagName contained article aside audio canvas command
|
||||||
syn keyword htmlTagName contained datalist details dialog embed figcaption figure footer
|
syn keyword htmlTagName contained datalist details dialog embed figcaption figure footer
|
||||||
syn keyword htmlTagName contained header hgroup keygen main mark meter menu nav output
|
syn keyword htmlTagName contained header hgroup keygen main mark meter menu nav output
|
||||||
syn keyword htmlTagName contained progress ruby rt rp section source summary time track video data
|
syn keyword htmlTagName contained progress ruby rt rp rb rtc 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/
|
||||||
@@ -75,10 +76,14 @@ syn keyword htmlArg contained label icon open datetime pubdate
|
|||||||
syn keyword htmlArg contained async
|
syn keyword htmlArg contained async
|
||||||
" <content>
|
" <content>
|
||||||
syn keyword htmlArg contained select
|
syn keyword htmlArg contained select
|
||||||
|
" <iframe>
|
||||||
|
syn keyword htmlArg contained seamless srcdoc sandbox
|
||||||
|
" <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
|
||||||
syn match htmlArg "\<\(data\(\-[a-z]\+\)\+\)\=\>" contained
|
syn match htmlArg "\<\(data\-\([a-z_][a-z0-9_.\-]*\)\+\)\=\>" contained
|
||||||
|
|
||||||
" Microdata
|
" Microdata
|
||||||
" http://dev.w3.org/html5/md/
|
" http://dev.w3.org/html5/md/
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ syn match jadeBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=jadeTag,jadeClassCha
|
|||||||
syn match jadeTag "+\?\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@jadeComponent
|
syn match jadeTag "+\?\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@jadeComponent
|
||||||
syn cluster jadeComponent contains=jadeAttributes,jadeIdChar,jadeBlockExpansionChar,jadeClassChar,jadePlainChar,jadeJavascript,jadeTagBlockChar,jadeTagInlineText
|
syn cluster jadeComponent contains=jadeAttributes,jadeIdChar,jadeBlockExpansionChar,jadeClassChar,jadePlainChar,jadeJavascript,jadeTagBlockChar,jadeTagInlineText
|
||||||
syn match jadeComment '\s*\/\/.*$'
|
syn match jadeComment '\s*\/\/.*$'
|
||||||
|
syn region jadeCommentBlock start="\z(\s*\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" keepend
|
||||||
syn region jadeHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->"
|
syn region jadeHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->"
|
||||||
syn region jadeAttributes matchgroup=jadeAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,jadeHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@jadeComponent
|
syn region jadeAttributes matchgroup=jadeAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,jadeHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@jadeComponent
|
||||||
syn match jadeClassChar "\." contained nextgroup=jadeClass
|
syn match jadeClassChar "\." contained nextgroup=jadeClass
|
||||||
@@ -45,7 +46,7 @@ syn region jadeDocType start="^\s*\(!!!\|doctype\)" end="$"
|
|||||||
syn keyword jadeHtmlArg contained href title
|
syn keyword jadeHtmlArg contained href title
|
||||||
|
|
||||||
syn match jadePlainChar "\\" contained
|
syn match jadePlainChar "\\" contained
|
||||||
syn region jadeInterpolation matchgroup=jadeInterpolationDelimiter start="#{" end="}" contains=@htmlJavascript
|
syn region jadeInterpolation matchgroup=jadeInterpolationDelimiter start="[#!]{" end="}" contains=@htmlJavascript
|
||||||
syn match jadeInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)"
|
syn match jadeInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)"
|
||||||
syn match jadeTagInlineText "\s.*$" contained contains=jadeInterpolation,jadeTextInlineJade
|
syn match jadeTagInlineText "\s.*$" contained contains=jadeInterpolation,jadeTextInlineJade
|
||||||
syn region jadePipedText matchgroup=jadePipeChar start="|" end="$" contained contains=jadeInterpolation,jadeTextInlineJade nextgroup=jadePipedText skipnl
|
syn region jadePipedText matchgroup=jadePipeChar start="|" end="$" contained contains=jadeInterpolation,jadeTextInlineJade nextgroup=jadePipedText skipnl
|
||||||
@@ -67,7 +68,7 @@ syn keyword jadeScriptLoopKeywords for in contained
|
|||||||
|
|
||||||
syn region jadeJavascript start="^\z(\s*\)script\%(:\w\+\)\=" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript,jadeJavascriptTag keepend
|
syn region jadeJavascript start="^\z(\s*\)script\%(:\w\+\)\=" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript,jadeJavascriptTag keepend
|
||||||
syn region jadeJavascriptTag contained start="^\z(\s*\)script\%(:\w\+\)\=" end="$" contains=jadeBegin,jadeTag
|
syn region jadeJavascriptTag contained start="^\z(\s*\)script\%(:\w\+\)\=" end="$" contains=jadeBegin,jadeTag
|
||||||
syn region jadeCssBlock start="^\z(\s*\)style" nextgroup=@jadeComponent,jadeError end="^\%(\z1\s\|\s*$\)\@!" contains=@jadeTop,@htmlCss keepend
|
syn region jadeCssBlock start="^\z(\s*\)style" nextgroup=@jadeComponent,jadeError end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlCss keepend
|
||||||
|
|
||||||
syn match jadeError "\$" contained
|
syn match jadeError "\$" contained
|
||||||
|
|
||||||
@@ -90,6 +91,7 @@ hi def link jadeInlineDelimiter Delimiter
|
|||||||
hi def link jadeFilter PreProc
|
hi def link jadeFilter PreProc
|
||||||
hi def link jadeDocType PreProc
|
hi def link jadeDocType PreProc
|
||||||
hi def link jadeComment Comment
|
hi def link jadeComment Comment
|
||||||
|
hi def link jadeCommentBlock Comment
|
||||||
hi def link jadeHtmlConditionalComment jadeComment
|
hi def link jadeHtmlConditionalComment jadeComment
|
||||||
|
|
||||||
let b:current_syntax = "jade"
|
let b:current_syntax = "jade"
|
||||||
|
|||||||
@@ -35,6 +35,13 @@ 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 jsModules import export contained
|
||||||
|
syntax keyword jsModuleWords default from as contained
|
||||||
|
syntax keyword jsOf of contained
|
||||||
|
|
||||||
|
syntax region jsImportContainer start="^\s\?import \?" end="$" contains=jsModules,jsModuleWords,jsComment,jsStringS,jsStringD,jsTemplateString
|
||||||
|
|
||||||
|
syntax region jsExportContainer start="^\s\?export \?" end="$" contains=jsModules,jsModuleWords,jsComment,jsTemplateString,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsClass,jsStorageClass,jsPrototype,jsBuiltins,jsNoise,jsAssignmentExpr
|
||||||
|
|
||||||
"" JavaScript comments
|
"" JavaScript comments
|
||||||
syntax keyword jsCommentTodo TODO FIXME XXX TBD contained
|
syntax keyword jsCommentTodo TODO FIXME XXX TBD contained
|
||||||
@@ -52,24 +59,24 @@ if !exists("javascript_ignore_javaScriptdoc")
|
|||||||
"syntax include @javaHtml <sfile>:p:h/html.vim
|
"syntax include @javaHtml <sfile>:p:h/html.vim
|
||||||
"unlet b:current_syntax
|
"unlet b:current_syntax
|
||||||
|
|
||||||
syntax region jsDocComment matchgroup=jsComment start="/\*\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold
|
syntax region jsBlockComment 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\|api\|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
|
||||||
syntax region jsDocTypeNoParam start="{" end="}" oneline contained
|
syntax region jsDocTypeNoParam start="{" end="}" oneline contained
|
||||||
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
|
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
|
||||||
syntax match jsDocParam contained "\%(#\|\"\|{\|}\|\w\|\.\|:\|\/\)\+"
|
syntax match jsDocParam contained "\%(#\|\"\|{\|}\|\w\|\.\|:\|\/\|\[\|]\|=\)\+"
|
||||||
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
|
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
|
||||||
|
|
||||||
syntax case match
|
syntax case match
|
||||||
@@ -78,42 +85,42 @@ endif "" JSDoc end
|
|||||||
syntax case match
|
syntax case match
|
||||||
|
|
||||||
"" Syntax in the JavaScript code
|
"" Syntax in the JavaScript code
|
||||||
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 jsTaggedTemplate start=/\k\+\(\(\n\|\s\)\+\)\?`/ end=+`\|$+ contains=jsTemplateString
|
||||||
|
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
|
||||||
syntax match jsRegexpQuantifier "\v\\@<!%([?*+]|\{\d+%(,|,\d+)?})\??" contained
|
syntax match jsRegexpQuantifier "\v\\@<!%([?*+]|\{\d+%(,|,\d+)?})\??" contained
|
||||||
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\|[eE][+-]\=\d\+\)\=\>\|\<0[xX]\x\+\>/
|
||||||
syntax keyword jsNumber Infinity
|
syntax keyword jsNumber Infinity
|
||||||
syntax match jsFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
|
syntax match jsFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
|
||||||
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
|
syntax match jsAssignmentExpr /\v%([a-zA-Z_$]\k*\.)*[a-zA-Z_$]\k*\s*\=/ contains=jsFuncAssignExpr,jsAssignExpIdent,jsPrototype,jsOperator,jsThis,jsNoise
|
||||||
syntax keyword jsNull null conceal cchar=ø
|
syntax match jsAssignExpIdent /\v[a-zA-Z_$]\k*\ze%(\s*\=)/ contained
|
||||||
syntax keyword jsThis this conceal cchar=@
|
syntax match jsFuncAssignExpr /\v%(%([a-zA-Z_$]\k*\.)*[a-zA-Z_$]\k*\s*\=\s*){-1,}\ze%(function\s*\*?\s*\()/ contains=jsFuncAssignObjChain,jsFuncAssignIdent,jsFunction,jsPrototype,jsOperator,jsThis contained
|
||||||
syntax keyword jsReturn return conceal cchar=⇚
|
syntax match jsFuncAssignObjChain /\v%([a-zA-Z_$]\k*\.)+/ contains=jsPrototype,jsNoise contained
|
||||||
syntax keyword jsUndefined undefined conceal cchar=¿
|
syntax match jsFuncAssignIdent /\v[a-zA-Z_$]\k*\ze%(\s*\=)/ contained
|
||||||
syntax keyword jsNan NaN conceal cchar=ℕ
|
|
||||||
syntax keyword jsPrototype prototype conceal cchar=¶
|
exe 'syntax keyword jsNull null '.(exists('g:javascript_conceal_null') ? 'conceal cchar='.g:javascript_conceal_null : '')
|
||||||
else
|
exe 'syntax keyword jsReturn return '.(exists('g:javascript_conceal_return') ? 'conceal cchar='.g:javascript_conceal_return : '')
|
||||||
syntax keyword jsNull null
|
exe 'syntax keyword jsUndefined undefined '.(exists('g:javascript_conceal_undefined') ? 'conceal cchar='.g:javascript_conceal_undefined : '')
|
||||||
syntax keyword jsThis this
|
exe 'syntax keyword jsNan NaN '.(exists('g:javascript_conceal_NaN') ? 'conceal cchar='.g:javascript_conceal_NaN : '')
|
||||||
syntax keyword jsReturn return
|
exe 'syntax keyword jsPrototype prototype '.(exists('g:javascript_conceal_prototype') ? 'conceal cchar='.g:javascript_conceal_prototype : '')
|
||||||
syntax keyword jsUndefined undefined
|
exe 'syntax keyword jsThis this '.(exists('g:javascript_conceal_this') ? 'conceal cchar='.g:javascript_conceal_this : '')
|
||||||
syntax keyword jsNan NaN
|
exe 'syntax keyword jsStatic static '.(exists('g:javascript_conceal_static') ? 'conceal cchar='.g:javascript_conceal_static : '')
|
||||||
syntax keyword jsPrototype prototype
|
exe 'syntax keyword jsSuper super '.(exists('g:javascript_conceal_super') ? 'conceal cchar='.g:javascript_conceal_super : '')
|
||||||
endif
|
|
||||||
|
|
||||||
"" Statement Keywords
|
"" Statement Keywords
|
||||||
syntax keyword jsStatement break continue with
|
syntax keyword jsStatement break continue with
|
||||||
@@ -121,16 +128,17 @@ 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
|
||||||
|
syntax keyword jsClass 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 Symbol Map WeakMap Set RegExp String Proxy Promise ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray Intl JSON Math console document window
|
||||||
syntax match jsGlobalObjects /\%(Intl\.\)\@<=\(Collator\|DateTimeFormat\|NumberFormat\)/
|
syntax match jsGlobalObjects /\%(Intl\.\)\@<=\(Collator\|DateTimeFormat\|NumberFormat\)/
|
||||||
|
|
||||||
syntax keyword jsExceptions Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError
|
syntax keyword jsExceptions Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError
|
||||||
|
|
||||||
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 byte long 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
|
||||||
|
|
||||||
@@ -180,12 +188,11 @@ endif "DOM/HTML/CSS
|
|||||||
|
|
||||||
"" end DOM/HTML/CSS specified things
|
"" end DOM/HTML/CSS specified things
|
||||||
|
|
||||||
|
|
||||||
"" 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,jsBlockComment,jsTaggedTemplate,jsTemplateString,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsStatic,jsSuper,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,jsAssignmentExpr,jsImportContainer,jsExportContainer,jsClass
|
||||||
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,jsOf,jsParensErrA,jsParensErrC,jsParen,jsBracket,jsBlock,@htmlPreproc fold
|
||||||
syntax region jsBlock matchgroup=jsBraces start="{" end="}" contains=@jsAll,jsParensErrA,jsParensErrB,jsParen,jsBracket,jsBlock,jsObjectKey,@htmlPreproc fold
|
syntax region jsBlock matchgroup=jsBraces start="{" end="}" contains=@jsAll,jsParensErrA,jsParensErrB,jsParen,jsBracket,jsBlock,jsObjectKey,@htmlPreproc fold
|
||||||
syntax region jsFuncBlock matchgroup=jsFuncBraces start="{" end="}" contains=@jsAll,jsParensErrA,jsParensErrB,jsParen,jsBracket,jsBlock,@htmlPreproc contained fold
|
syntax region jsFuncBlock matchgroup=jsFuncBraces start="{" end="}" contains=@jsAll,jsParensErrA,jsParensErrB,jsParen,jsBracket,jsBlock,@htmlPreproc contained fold
|
||||||
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=+?+ end=+:+ contains=@jsExpression,jsTernaryIf
|
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=+?+ end=+:+ contains=@jsExpression,jsTernaryIf
|
||||||
@@ -202,14 +209,11 @@ 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=jsGenerator,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 jsGenerator contained '\*' nextgroup=jsFuncName skipwhite
|
||||||
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,jsAssignmentExpr nextgroup=jsFuncBlock keepend skipwhite skipempty
|
||||||
syntax match jsFuncArgCommas contained ','
|
syntax match jsFuncArgCommas contained ','
|
||||||
syntax match jsFuncArgRest contained /\%(\.\.\.[a-zA-Z_$][0-9a-zA-Z_$]*\))/
|
syntax match jsFuncArgRest contained /\%(\.\.\.[a-zA-Z_$][0-9a-zA-Z_$]*\))/
|
||||||
syntax keyword jsArgsObj arguments contained containedin=jsFuncBlock
|
syntax keyword jsArgsObj arguments contained containedin=jsFuncBlock
|
||||||
@@ -230,7 +234,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
|||||||
HiLink jsComment Comment
|
HiLink jsComment Comment
|
||||||
HiLink jsLineComment Comment
|
HiLink jsLineComment Comment
|
||||||
HiLink jsEnvComment PreProc
|
HiLink jsEnvComment PreProc
|
||||||
HiLink jsDocComment Comment
|
HiLink jsBlockComment Comment
|
||||||
HiLink jsCommentTodo Todo
|
HiLink jsCommentTodo Todo
|
||||||
HiLink jsCvsTag Function
|
HiLink jsCvsTag Function
|
||||||
HiLink jsDocTags Special
|
HiLink jsDocTags Special
|
||||||
@@ -241,6 +245,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
|||||||
HiLink jsStringS String
|
HiLink jsStringS String
|
||||||
HiLink jsStringD String
|
HiLink jsStringD String
|
||||||
HiLink jsTemplateString String
|
HiLink jsTemplateString String
|
||||||
|
HiLink jsTaggedTemplate StorageClass
|
||||||
HiLink jsTernaryIfOperator Conditional
|
HiLink jsTernaryIfOperator Conditional
|
||||||
HiLink jsRegexpString String
|
HiLink jsRegexpString String
|
||||||
HiLink jsRegexpBoundary SpecialChar
|
HiLink jsRegexpBoundary SpecialChar
|
||||||
@@ -262,6 +267,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
|||||||
HiLink jsKeyword Keyword
|
HiLink jsKeyword Keyword
|
||||||
HiLink jsArrowFunction Type
|
HiLink jsArrowFunction Type
|
||||||
HiLink jsFunction Type
|
HiLink jsFunction Type
|
||||||
|
HiLink jsGenerator jsFunction
|
||||||
HiLink jsFuncName Function
|
HiLink jsFuncName Function
|
||||||
HiLink jsArgsObj Special
|
HiLink jsArgsObj Special
|
||||||
HiLink jsError Error
|
HiLink jsError Error
|
||||||
@@ -270,8 +276,12 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
|||||||
HiLink jsParensErrB Error
|
HiLink jsParensErrB Error
|
||||||
HiLink jsParensErrC Error
|
HiLink jsParensErrC Error
|
||||||
HiLink jsOperator Operator
|
HiLink jsOperator Operator
|
||||||
|
HiLink jsOf Operator
|
||||||
HiLink jsStorageClass StorageClass
|
HiLink jsStorageClass StorageClass
|
||||||
|
HiLink jsClass Structure
|
||||||
HiLink jsThis Special
|
HiLink jsThis Special
|
||||||
|
HiLink jsStatic Special
|
||||||
|
HiLink jsSuper Special
|
||||||
HiLink jsNan Number
|
HiLink jsNan Number
|
||||||
HiLink jsNull Type
|
HiLink jsNull Type
|
||||||
HiLink jsUndefined Type
|
HiLink jsUndefined Type
|
||||||
@@ -291,6 +301,8 @@ 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 jsModules Include
|
||||||
|
HiLink jsModuleWords Include
|
||||||
|
|
||||||
HiLink jsDomErrNo Constant
|
HiLink jsDomErrNo Constant
|
||||||
HiLink jsDomNodeConsts Constant
|
HiLink jsDomNodeConsts Constant
|
||||||
@@ -307,10 +319,9 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Define the htmlJavaScript for HTML syntax html.vim
|
" Define the htmlJavaScript for HTML syntax html.vim
|
||||||
"syntax clear htmlJavaScript
|
|
||||||
"syntax clear jsExpression
|
|
||||||
syntax cluster htmlJavaScript contains=@jsAll,jsBracket,jsParen,jsBlock
|
syntax cluster htmlJavaScript contains=@jsAll,jsBracket,jsParen,jsBlock
|
||||||
syntax cluster javaScriptExpression contains=@jsAll,jsBracket,jsParen,jsBlock,@htmlPreproc
|
syntax cluster javaScriptExpression contains=@jsAll,jsBracket,jsParen,jsBlock,@htmlPreproc
|
||||||
|
|
||||||
" Vim's default html.vim highlights all javascript as 'Special'
|
" Vim's default html.vim highlights all javascript as 'Special'
|
||||||
hi! def link javaScript NONE
|
hi! def link javaScript NONE
|
||||||
|
|
||||||
|
|||||||
128
syntax/json.vim
128
syntax/json.vim
@@ -1,13 +1,7 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: JSON
|
" Language: JSON
|
||||||
" Maintainer: Jeroen Ruigrok van der Werven <asmodai@in-nomine.org>
|
" Maintainer: Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json
|
||||||
" Last Change: 2009-06-16
|
" Last Change: 2014-12-20 Load ftplugin/json.vim
|
||||||
" Version: 0.4
|
|
||||||
" {{{1
|
|
||||||
|
|
||||||
" Syntax setup {{{2
|
|
||||||
" For version 5.x: Clear all syntax items
|
|
||||||
" For version 6.x: Quit when a syntax file was already loaded
|
|
||||||
|
|
||||||
if !exists("main_syntax")
|
if !exists("main_syntax")
|
||||||
if version < 600
|
if version < 600
|
||||||
@@ -18,54 +12,95 @@ if !exists("main_syntax")
|
|||||||
let main_syntax = 'json'
|
let main_syntax = 'json'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Syntax: Strings {{{2
|
syntax match jsonNoise /\%(:\|,\)/
|
||||||
syn region jsonString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=jsonEscape
|
|
||||||
" Syntax: JSON does not allow strings with single quotes, unlike JavaScript.
|
|
||||||
syn region jsonStringSQ start=+'+ skip=+\\\\\|\\"+ end=+'+
|
|
||||||
|
|
||||||
" Syntax: Escape sequences {{{3
|
" Syntax: Strings
|
||||||
|
" Separated into a match and region because a region by itself is always greedy
|
||||||
|
syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString
|
||||||
|
syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ concealends contains=jsonEscape contained
|
||||||
|
|
||||||
|
" Syntax: JSON does not allow strings with single quotes, unlike JavaScript.
|
||||||
|
syn region jsonStringSQError oneline start=+'+ skip=+\\\\\|\\"+ end=+'+
|
||||||
|
|
||||||
|
" Syntax: JSON Keywords
|
||||||
|
" Separated into a match and region because a region by itself is always greedy
|
||||||
|
syn match jsonKeywordMatch /"\([^"]\|\\\"\)\+"[[:blank:]\r\n]*\:/ contains=jsonKeyword
|
||||||
|
syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ contains=jsonEscape contained
|
||||||
|
|
||||||
|
" Syntax: Escape sequences
|
||||||
syn match jsonEscape "\\["\\/bfnrt]" contained
|
syn match jsonEscape "\\["\\/bfnrt]" contained
|
||||||
syn match jsonEscape "\\u\x\{4}" contained
|
syn match jsonEscape "\\u\x\{4}" contained
|
||||||
|
|
||||||
" Syntax: Strings should always be enclosed with quotes.
|
" Syntax: Numbers
|
||||||
syn match jsonNoQuotes "\<\a\+\>"
|
syn match jsonNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>\ze[[:blank:]\r\n]*[,}\]]"
|
||||||
|
|
||||||
" Syntax: Numbers {{{2
|
" ERROR WARNINGS **********************************************
|
||||||
syn match jsonNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>"
|
" Syntax: Strings should always be enclosed with quotes.
|
||||||
|
syn match jsonNoQuotesError "\<[[:alpha:]][[:alnum:]]*\>"
|
||||||
|
syn match jsonTripleQuotesError /"""/
|
||||||
|
|
||||||
" Syntax: An integer part of 0 followed by other digits is not allowed.
|
" Syntax: An integer part of 0 followed by other digits is not allowed.
|
||||||
syn match jsonNumError "-\=\<0\d\.\d*\>"
|
syn match jsonNumError "-\=\<0\d\.\d*\>"
|
||||||
|
|
||||||
" Syntax: Boolean {{{2
|
" Syntax: Decimals smaller than one should begin with 0 (so .1 should be 0.1).
|
||||||
syn keyword jsonBoolean true false
|
syn match jsonNumError "\:\@<=[[:blank:]\r\n]*\zs\.\d\+"
|
||||||
|
|
||||||
" Syntax: Null {{{2
|
" Syntax: No comments in JSON, see http://stackoverflow.com/questions/244777/can-i-comment-a-json-file
|
||||||
syn keyword jsonNull null
|
syn match jsonCommentError "//.*"
|
||||||
|
syn match jsonCommentError "\(/\*\)\|\(\*/\)"
|
||||||
|
|
||||||
" Syntax: Braces {{{2
|
" Syntax: No semicolons in JSON
|
||||||
syn match jsonBraces "[{}\[\]]"
|
syn match jsonSemicolonError ";"
|
||||||
|
|
||||||
" Define the default highlighting. {{{1
|
" Syntax: No trailing comma after the last element of arrays or objects
|
||||||
" For version 5.7 and earlier: only when not done already
|
syn match jsonTrailingCommaError ",\_s*[}\]]"
|
||||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
||||||
|
" Syntax: Watch out for missing commas between elements
|
||||||
|
syn match jsonMissingCommaError /\("\|\]\|\d\)\zs\_s\+\ze"/
|
||||||
|
syn match jsonMissingCommaError /\(\]\|\}\)\_s\+\ze"/ "arrays/objects as values
|
||||||
|
syn match jsonMissingCommaError /}\_s\+\ze{/ "objects as elements in an array
|
||||||
|
syn match jsonMissingCommaError /\(true\|false\)\_s\+\ze"/ "true/false as value
|
||||||
|
|
||||||
|
" ********************************************** END OF ERROR WARNINGS
|
||||||
|
" Allowances for JSONP: function call at the beginning of the file,
|
||||||
|
" parenthesis and semicolon at the end.
|
||||||
|
" Function name validation based on
|
||||||
|
" http://stackoverflow.com/questions/2008279/validate-a-javascript-function-name/2008444#2008444
|
||||||
|
syn match jsonPadding "\%^[[:blank:]\r\n]*[_$[:alpha:]][_$[:alnum:]]*[[:blank:]\r\n]*("
|
||||||
|
syn match jsonPadding ");[[:blank:]\r\n]*\%$"
|
||||||
|
|
||||||
|
" Syntax: Boolean
|
||||||
|
syn match jsonBoolean /\(true\|false\)\(\_s\+\ze"\)\@!/
|
||||||
|
|
||||||
|
" Syntax: Null
|
||||||
|
syn keyword jsonNull null
|
||||||
|
|
||||||
|
" Syntax: Braces
|
||||||
|
syn region jsonFold matchgroup=jsonBraces start="{" end=/}\(\_s\+\ze\("\|{\)\)\@!/ transparent fold
|
||||||
|
syn region jsonFold matchgroup=jsonBraces start="\[" end=/]\(\_s\+\ze"\)\@!/ transparent fold
|
||||||
|
|
||||||
|
" Define the default highlighting.
|
||||||
if version >= 508 || !exists("did_json_syn_inits")
|
if version >= 508 || !exists("did_json_syn_inits")
|
||||||
if version < 508
|
hi def link jsonPadding Operator
|
||||||
let did_json_syn_inits = 1
|
hi def link jsonString String
|
||||||
command -nargs=+ HiLink hi link <args>
|
hi def link jsonTest Label
|
||||||
else
|
hi def link jsonEscape Special
|
||||||
command -nargs=+ HiLink hi def link <args>
|
hi def link jsonNumber Number
|
||||||
endif
|
hi def link jsonBraces Delimiter
|
||||||
HiLink jsonString String
|
hi def link jsonNull Function
|
||||||
HiLink jsonEscape Special
|
hi def link jsonBoolean Boolean
|
||||||
HiLink jsonNumber Number
|
hi def link jsonKeyword Label
|
||||||
HiLink jsonBraces Operator
|
|
||||||
HiLink jsonNull Function
|
|
||||||
HiLink jsonBoolean Boolean
|
|
||||||
|
|
||||||
HiLink jsonNumError Error
|
hi def link jsonNumError Error
|
||||||
HiLink jsonStringSQ Error
|
hi def link jsonCommentError Error
|
||||||
HiLink jsonNoQuotes Error
|
hi def link jsonSemicolonError Error
|
||||||
delcommand HiLink
|
hi def link jsonTrailingCommaError Error
|
||||||
|
hi def link jsonMissingCommaError Error
|
||||||
|
hi def link jsonStringSQError Error
|
||||||
|
hi def link jsonNoQuotesError Error
|
||||||
|
hi def link jsonTripleQuotesError Error
|
||||||
|
hi def link jsonQuote Quote
|
||||||
|
hi def link jsonNoise Noise
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let b:current_syntax = "json"
|
let b:current_syntax = "json"
|
||||||
@@ -73,5 +108,12 @@ if main_syntax == 'json'
|
|||||||
unlet main_syntax
|
unlet main_syntax
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Vim settings {{{2
|
" Vim settings
|
||||||
" vim: ts=8 fdm=marker
|
" vim: ts=8 fdm=marker
|
||||||
|
|
||||||
|
" MIT License
|
||||||
|
" Copyright (c) 2013, Jeroen Ruigrok van der Werven, Eli Parra
|
||||||
|
"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
"THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
"See https://twitter.com/elzr/status/294964017926119424
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ elseif !exists("b:jst_subtype") && main_syntax == 'jst'
|
|||||||
let b:jst_subtype = 'haml'
|
let b:jst_subtype = 'haml'
|
||||||
elseif b:jst_subtype == 'ejs'
|
elseif b:jst_subtype == 'ejs'
|
||||||
let b:jst_subtype = 'html'
|
let b:jst_subtype = 'html'
|
||||||
|
elseif b:jst_subtype == 'ect'
|
||||||
|
let b:jst_subtype = 'html'
|
||||||
elseif b:jst_subtype == 'rb'
|
elseif b:jst_subtype == 'rb'
|
||||||
let b:jst_subtype = 'ruby'
|
let b:jst_subtype = 'ruby'
|
||||||
elseif b:jst_subtype == 'yml'
|
elseif b:jst_subtype == 'yml'
|
||||||
@@ -70,4 +72,14 @@ if main_syntax == 'jst'
|
|||||||
unlet main_syntax
|
unlet main_syntax
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
set commentstring=<!--%s-->
|
||||||
|
|
||||||
|
if exists("loaded_matchit")
|
||||||
|
let b:match_ignorecase = 1
|
||||||
|
let b:match_words = '<:>,' .
|
||||||
|
\ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' .
|
||||||
|
\ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' .
|
||||||
|
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
|
||||||
|
endif
|
||||||
|
|
||||||
" vim: nowrap sw=2 sts=2 ts=8:
|
" vim: nowrap sw=2 sts=2 ts=8:
|
||||||
|
|||||||
@@ -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 contained containedin=mustacheInside,@htmlMustacheContainer
|
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
|
||||||
|
|
||||||
|
|||||||
@@ -39,11 +39,6 @@ endif
|
|||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
if exists('®expengine')
|
|
||||||
let s:regexpengine=®expengine
|
|
||||||
set regexpengine=1
|
|
||||||
endif
|
|
||||||
|
|
||||||
" POD starts with ^=<word> and ends with ^=cut
|
" POD starts with ^=<word> and ends with ^=cut
|
||||||
|
|
||||||
if !exists("perl_include_pod") || perl_include_pod == 1
|
if !exists("perl_include_pod") || perl_include_pod == 1
|
||||||
@@ -334,19 +329,24 @@ syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s
|
|||||||
" XXX Any statements after the identifier are in perlString colour (i.e.
|
" XXX Any statements after the identifier are in perlString colour (i.e.
|
||||||
" 'if $a' in 'print <<EOF if $a'). This is almost impossible to get right it
|
" 'if $a' in 'print <<EOF if $a'). This is almost impossible to get right it
|
||||||
" seems due to the 'auto-extending nature' of regions.
|
" seems due to the 'auto-extending nature' of regions.
|
||||||
|
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\z(\I\i*\)+ end=+$+ contains=@perlTop oneline
|
||||||
|
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+$+ contains=@perlTop oneline
|
||||||
|
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+$+ contains=@perlTop oneline
|
||||||
|
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*""+ end=+$+ contains=@perlTop oneline
|
||||||
|
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*''+ end=+$+ contains=@perlTop oneline
|
||||||
if exists("perl_fold")
|
if exists("perl_fold")
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\).*+ end=+^\z1$+ contains=@perlInterpDQ fold extend
|
syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ fold extend
|
syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ fold extend
|
syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ fold extend
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine fold extend
|
syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine fold extend
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine fold extend
|
syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine fold extend
|
||||||
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL fold extend
|
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL fold extend
|
||||||
else
|
else
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\).*+ end=+^\z1$+ contains=@perlInterpDQ
|
syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ
|
syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ
|
syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine
|
syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine
|
||||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine
|
syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine
|
||||||
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL
|
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -360,15 +360,11 @@ syn keyword perlStatementPackage package contained
|
|||||||
" sub [name] [(prototype)] {
|
" sub [name] [(prototype)] {
|
||||||
"
|
"
|
||||||
syn match perlSubError "[^[:space:];{#]" contained
|
syn match perlSubError "[^[:space:];{#]" contained
|
||||||
if v:version == 701 && !has('patch221') " XXX I hope that's the right one
|
syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained
|
||||||
syn match perlSubAttributes ":" contained
|
syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ
|
||||||
else
|
syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup
|
||||||
syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained
|
syn match perlSubAttributes "" contained nextgroup=perlSubError
|
||||||
syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ
|
syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
|
||||||
syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup
|
|
||||||
syn match perlSubAttributes "" contained nextgroup=perlSubError
|
|
||||||
syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
|
|
||||||
endif
|
|
||||||
if !exists("perl_no_subprototype_error") " Set 1 if using signatures feature in perl5.19.9
|
if !exists("perl_no_subprototype_error") " Set 1 if using signatures feature in perl5.19.9
|
||||||
syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
|
syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
|
||||||
syn match perlSubPrototype +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError
|
syn match perlSubPrototype +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError
|
||||||
@@ -583,11 +579,6 @@ syn sync match perlSyncPOD grouphere NONE "^=cut"
|
|||||||
|
|
||||||
let b:current_syntax = "perl"
|
let b:current_syntax = "perl"
|
||||||
|
|
||||||
if exists('®expengine')
|
|
||||||
let ®expengine=s:regexpengine
|
|
||||||
unlet s:regexpengine
|
|
||||||
endif
|
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
|
|
||||||
|
|||||||
1932
syntax/perl6.vim
1932
syntax/perl6.vim
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
162
syntax/ps1.vim
Normal file
162
syntax/ps1.vim
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: Windows PowerShell
|
||||||
|
" Maintainer: Peter Provost <peter@provost.org>
|
||||||
|
" Version: 2.10
|
||||||
|
" Project Repository: https://github.com/PProvost/vim-ps1
|
||||||
|
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327"
|
||||||
|
"
|
||||||
|
" The following settings are available for tuning syntax highlighting:
|
||||||
|
" let ps1_nofold_blocks = 1
|
||||||
|
" let ps1_nofold_sig = 1
|
||||||
|
|
||||||
|
" Compatible VIM syntax file start
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" PowerShell doesn't care about case
|
||||||
|
syn case ignore
|
||||||
|
|
||||||
|
" Sync-ing method
|
||||||
|
syn sync minlines=100
|
||||||
|
|
||||||
|
" Certain tokens can't appear at the top level of the document
|
||||||
|
syn cluster ps1NotTop contains=@ps1Comment,ps1CDocParam,ps1Function
|
||||||
|
|
||||||
|
" Comments and special comment words
|
||||||
|
syn keyword ps1CommentTodo TODO FIXME XXX TBD HACK NOTE contained
|
||||||
|
syn match ps1CDocParam /.*/ contained
|
||||||
|
syn match ps1CommentDoc /^\s*\zs\.\w\+\>/ nextgroup=ps1CDocParam contained
|
||||||
|
syn match ps1CommentDoc /#\s*\zs\.\w\+\>/ nextgroup=ps1CDocParam contained
|
||||||
|
syn match ps1Comment /#.*/ contains=ps1CommentTodo,ps1CommentDoc,@Spell
|
||||||
|
syn region ps1Comment start="<#" end="#>" contains=ps1CommentTodo,ps1CommentDoc,@Spell
|
||||||
|
|
||||||
|
" Language keywords and elements
|
||||||
|
syn keyword ps1Conditional if else elseif switch default
|
||||||
|
syn keyword ps1Repeat while for do until break continue foreach in
|
||||||
|
syn match ps1Repeat /\<foreach\>/ nextgroup=ps1Block skipwhite
|
||||||
|
syn match ps1Keyword /\<while\>/ nextgroup=ps1Block skipwhite
|
||||||
|
syn match ps1Keyword /\<where\>/ nextgroup=ps1Block skipwhite
|
||||||
|
|
||||||
|
syn keyword ps1Exception begin process end exit
|
||||||
|
syn keyword ps1Keyword try catch finally throw
|
||||||
|
syn keyword ps1Keyword return filter in trap param data dynamicparam
|
||||||
|
syn match ps1Keyword /&/
|
||||||
|
syn keyword ps1Constant $true $false $null
|
||||||
|
syn match ps1Constant +\$?+
|
||||||
|
syn match ps1Constant +\$_+
|
||||||
|
syn match ps1Constant +\$\$+
|
||||||
|
syn match ps1Constant +\$^+
|
||||||
|
|
||||||
|
" Keywords reserved for future use
|
||||||
|
syn keyword ps1Keyword class define from using var
|
||||||
|
|
||||||
|
" Functions and Cmdlets
|
||||||
|
syn match ps1Cmdlet /\w\+-\w\+/
|
||||||
|
syn keyword ps1Keyword function nextgroup=ps1Function skipwhite
|
||||||
|
syn keyword ps1Keyword filter nextgroup=ps1Function skipwhite
|
||||||
|
syn match ps1Function /\w\+-*\w*/ contained
|
||||||
|
|
||||||
|
" Type declarations
|
||||||
|
syn match ps1Type /\[[a-z0-9_:.]\+\(\[\]\)\?\]/
|
||||||
|
syn match ps1StandaloneType /[a-z0-9_.]\+/ contained
|
||||||
|
syn keyword ps1Scope global local private script contained
|
||||||
|
|
||||||
|
" Variables and other user defined items
|
||||||
|
syn match ps1Variable /\$\w\+/
|
||||||
|
syn match ps1Variable /\${\w\+:\\\w\+}/
|
||||||
|
syn match ps1ScopedVariable /\$\w\+:\w\+/ contains=ps1Scope
|
||||||
|
syn match ps1VariableName /\w\+/ contained
|
||||||
|
|
||||||
|
" Operators all start w/ dash
|
||||||
|
syn match ps1OperatorStart /-c\?/ nextgroup=ps1Operator
|
||||||
|
syn keyword ps1Operator eq ne ge gt lt le like notlike match notmatch replace split /contains/ notcontains contained
|
||||||
|
syn keyword ps1Operator ieq ine ige igt ile ilt ilike inotlike imatch inotmatch ireplace isplit icontains inotcontains contained
|
||||||
|
syn keyword ps1Operator ceq cne cge cgt clt cle clike cnotlike cmatch cnotmatch creplace csplit ccontains cnotcontains contained
|
||||||
|
syn keyword ps1Operator is isnot as join contained
|
||||||
|
syn keyword ps1Operator and or not xor band bor bnot bxor contained
|
||||||
|
syn keyword ps1Operator f contained
|
||||||
|
|
||||||
|
" Regular Strings
|
||||||
|
" These aren't precisely correct and could use some work
|
||||||
|
syn region ps1String start=/"/ skip=/`"/ end=/"/ contains=@ps1StringSpecial
|
||||||
|
syn region ps1String start=/'/ skip=/''/ end=/'/
|
||||||
|
|
||||||
|
" Here-Strings
|
||||||
|
syn region ps1String start=/@"$/ end=/^"@/ contains=@ps1StringSpecial
|
||||||
|
syn region ps1String start=/@'$/ end=/^'@/
|
||||||
|
|
||||||
|
" Interpolation
|
||||||
|
syn match ps1Escape /`./ contained
|
||||||
|
syn region ps1Interpolation matchgroup=ps1InterpolationDelimiter start="$(" end=")" contained contains=ALLBUT,@ps1NotTop
|
||||||
|
syn region ps1NestedParentheses start="(" skip="\\\\\|\\)" matchgroup=ps1Interpolation end=")" transparent contained
|
||||||
|
syn cluster ps1StringSpecial contains=ps1Escape,ps1Interpolation,ps1Variable,ps1Boolean,ps1Constant,ps1BuiltIn
|
||||||
|
|
||||||
|
" Numbers
|
||||||
|
syn match ps1Number "\<\(0[xX]\x\+\|\d\+\)\([KMGTP][B]\)\=\>"
|
||||||
|
syn match ps1Number "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[dD]\="
|
||||||
|
syn match ps1Number "\<\d\+[eE][-+]\=\d\+[dD]\=\>"
|
||||||
|
syn match ps1Number "\<\d\+\([eE][-+]\=\d\+\)\=[dD]\>"
|
||||||
|
|
||||||
|
" Constants
|
||||||
|
syn match ps1Boolean "$\%(true\|false\)\>"
|
||||||
|
syn match ps1Constant /\$null\>/
|
||||||
|
syn match ps1BuiltIn "$^\|$?\|$_\|$\$"
|
||||||
|
syn match ps1BuiltIn "$\%(args\|error\|foreach\|home\|input\)\>"
|
||||||
|
syn match ps1BuiltIn "$\%(match\(es\)\?\|myinvocation\|host\|lastexitcode\)\>"
|
||||||
|
syn match ps1BuiltIn "$\%(ofs\|shellid\|stacktrace\)\>"
|
||||||
|
|
||||||
|
" Folding blocks
|
||||||
|
if !exists('g:ps1_nofold_blocks')
|
||||||
|
syn region ps1Block start=/{/ end=/}/ transparent fold
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:ps1_nofold_sig')
|
||||||
|
syn region ps1Signature start=/# SIG # Begin signature block/ end=/# SIG # End signature block/ transparent fold
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Setup default color highlighting
|
||||||
|
if version >= 508 || !exists("did_ps1_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_ps1_syn_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
HiLink ps1Number Number
|
||||||
|
HiLink ps1Block Block
|
||||||
|
HiLink ps1Exception Exception
|
||||||
|
HiLink ps1Constant Constant
|
||||||
|
HiLink ps1String String
|
||||||
|
HiLink ps1Escape SpecialChar
|
||||||
|
HiLink ps1InterpolationDelimiter Delimiter
|
||||||
|
HiLink ps1Conditional Conditional
|
||||||
|
HiLink ps1Function Function
|
||||||
|
HiLink ps1Variable Identifier
|
||||||
|
HiLink ps1ScopedVariable Identifier
|
||||||
|
HiLink ps1VariableName Identifier
|
||||||
|
HiLink ps1Boolean Boolean
|
||||||
|
HiLink ps1Constant Constant
|
||||||
|
HiLink ps1BuiltIn StorageClass
|
||||||
|
HiLink ps1Type Type
|
||||||
|
HiLink ps1Scope Type
|
||||||
|
HiLink ps1StandaloneType Type
|
||||||
|
HiLink ps1Number Number
|
||||||
|
HiLink ps1Comment Comment
|
||||||
|
HiLink ps1CommentTodo Todo
|
||||||
|
HiLink ps1CommentDoc Tag
|
||||||
|
HiLink ps1CDocParam Todo
|
||||||
|
HiLink ps1Operator Operator
|
||||||
|
HiLink ps1Repeat Repeat
|
||||||
|
HiLink ps1RepeatAndCmdlet Repeat
|
||||||
|
HiLink ps1Keyword Keyword
|
||||||
|
HiLink ps1KeywordAndCmdlet Keyword
|
||||||
|
HiLink ps1Cmdlet Statement
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:current_syntax = "ps1"
|
||||||
|
|
||||||
56
syntax/ps1xml.vim
Normal file
56
syntax/ps1xml.vim
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: Windows PowerShell XML
|
||||||
|
" Maintainer: Peter Provost <peter@provost.org>
|
||||||
|
" Version: 2.10
|
||||||
|
" Project Repository: https://github.com/PProvost/vim-ps1
|
||||||
|
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327"
|
||||||
|
|
||||||
|
" Compatible VIM syntax file start
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:ps1xml_cpo_save = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
doau syntax xml
|
||||||
|
unlet b:current_syntax
|
||||||
|
|
||||||
|
syn case ignore
|
||||||
|
syn include @ps1xmlScriptBlock <sfile>:p:h/ps1.vim
|
||||||
|
unlet b:current_syntax
|
||||||
|
|
||||||
|
syn region ps1xmlScriptBlock
|
||||||
|
\ matchgroup=xmlTag start="<Script>"
|
||||||
|
\ matchgroup=xmlEndTag end="</Script>"
|
||||||
|
\ fold
|
||||||
|
\ contains=@ps1xmlScriptBlock
|
||||||
|
\ keepend
|
||||||
|
syn region ps1xmlScriptBlock
|
||||||
|
\ matchgroup=xmlTag start="<ScriptBlock>"
|
||||||
|
\ matchgroup=xmlEndTag end="</ScriptBlock>"
|
||||||
|
\ fold
|
||||||
|
\ contains=@ps1xmlScriptBlock
|
||||||
|
\ keepend
|
||||||
|
syn region ps1xmlScriptBlock
|
||||||
|
\ matchgroup=xmlTag start="<GetScriptBlock>"
|
||||||
|
\ matchgroup=xmlEndTag end="</GetScriptBlock>"
|
||||||
|
\ fold
|
||||||
|
\ contains=@ps1xmlScriptBlock
|
||||||
|
\ keepend
|
||||||
|
syn region ps1xmlScriptBlock
|
||||||
|
\ matchgroup=xmlTag start="<SetScriptBlock>"
|
||||||
|
\ matchgroup=xmlEndTag end="</SetScriptBlock>"
|
||||||
|
\ fold
|
||||||
|
\ contains=@ps1xmlScriptBlock
|
||||||
|
\ keepend
|
||||||
|
|
||||||
|
syn cluster xmlRegionHook add=ps1xmlScriptBlock
|
||||||
|
|
||||||
|
let b:current_syntax = "ps1xml"
|
||||||
|
|
||||||
|
let &cpo = s:ps1xml_cpo_save
|
||||||
|
unlet s:ps1xml_cpo_save
|
||||||
|
|
||||||
@@ -130,9 +130,14 @@ syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][io
|
|||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold
|
||||||
|
|
||||||
" Normal String and Shell Command Output
|
" Normal String and Shell Command Output
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial,@Spell fold
|
if exists('ruby_spellcheck_strings')
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape,@Spell fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial,@Spell fold
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape,@Spell fold
|
||||||
|
else
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold
|
||||||
|
endif
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold
|
||||||
|
|
||||||
" Generalized Single Quoted String, Symbol and Array of Strings
|
" Generalized Single Quoted String, Symbol and Array of Strings
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
||||||
|
|||||||
121
syntax/rust.vim
121
syntax/rust.vim
@@ -3,7 +3,7 @@
|
|||||||
" Maintainer: Patrick Walton <pcwalton@mozilla.com>
|
" Maintainer: Patrick Walton <pcwalton@mozilla.com>
|
||||||
" Maintainer: Ben Blum <bblum@cs.cmu.edu>
|
" Maintainer: Ben Blum <bblum@cs.cmu.edu>
|
||||||
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
||||||
" Last Change: July 18, 2014
|
" Last Change: January 5, 2015
|
||||||
|
|
||||||
if version < 600
|
if version < 600
|
||||||
syntax clear
|
syntax clear
|
||||||
@@ -17,20 +17,20 @@ 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
|
||||||
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
|
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
|
||||||
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
|
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
|
||||||
syn keyword rustKeyword for in if impl let
|
syn keyword rustKeyword for in if impl let
|
||||||
syn keyword rustKeyword loop once proc pub
|
syn keyword rustKeyword loop once 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 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
|
||||||
|
|
||||||
@@ -56,79 +56,49 @@ 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 abstract final override
|
syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield abstract final override macro
|
||||||
|
|
||||||
" Built-in types {{{2
|
" Built-in types {{{2
|
||||||
syn keyword rustType int uint float char bool u8 u16 u32 u64 f32
|
syn keyword rustType isize usize float char bool u8 u16 u32 u64 f32
|
||||||
syn keyword rustType f64 i8 i16 i32 i64 str Self
|
syn keyword rustType f64 i8 i16 i32 i64 str Self
|
||||||
|
|
||||||
" Things from the prelude (src/libstd/prelude.rs) {{{2
|
" Things from the prelude (src/libstd/prelude.rs) {{{2
|
||||||
" 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 Drop Fn FnMut FnOnce
|
||||||
syn keyword rustTrait BitAnd BitOr BitXor
|
|
||||||
syn keyword rustTrait Drop Deref DerefMut
|
|
||||||
syn keyword rustTrait Shl Shr Index IndexMut
|
|
||||||
syn keyword rustEnum Option
|
|
||||||
syn keyword rustEnumVariant Some None
|
|
||||||
syn keyword rustEnum Result
|
|
||||||
syn keyword rustEnumVariant Ok Err
|
|
||||||
|
|
||||||
" Functions {{{3
|
" Reexported functions {{{3
|
||||||
"syn keyword rustFunction from_str
|
syn keyword rustFunction drop
|
||||||
"syn keyword rustFunction range
|
|
||||||
"syn keyword rustFunction drop
|
|
||||||
|
|
||||||
" Types and traits {{{3
|
" Reexported types and traits {{{3
|
||||||
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr
|
|
||||||
syn keyword rustTrait IntoBytes
|
|
||||||
syn keyword rustTrait ToCStr
|
|
||||||
syn keyword rustTrait Char UnicodeChar
|
|
||||||
syn keyword rustTrait Clone
|
|
||||||
syn keyword rustTrait PartialEq PartialOrd Eq Ord Equiv
|
|
||||||
syn keyword rustEnum Ordering
|
|
||||||
syn keyword rustEnumVariant Less Equal Greater
|
|
||||||
syn keyword rustTrait Collection Mutable Map MutableMap MutableSeq
|
|
||||||
syn keyword rustTrait Set MutableSet
|
|
||||||
syn keyword rustTrait FromIterator IntoIterator Extend ExactSize
|
|
||||||
syn keyword rustTrait Iterator DoubleEndedIterator
|
|
||||||
syn keyword rustTrait RandomAccessIterator CloneableIterator
|
|
||||||
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator
|
|
||||||
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul CheckedDiv
|
|
||||||
syn keyword rustTrait Signed Unsigned Primitive Int Float
|
|
||||||
syn keyword rustTrait FloatMath ToPrimitive FromPrimitive
|
|
||||||
syn keyword rustTrait Box
|
syn keyword rustTrait Box
|
||||||
syn keyword rustTrait GenericPath Path PosixPath WindowsPath
|
syn keyword rustTrait CharExt
|
||||||
syn keyword rustTrait RawPtr
|
syn keyword rustTrait Clone
|
||||||
syn keyword rustTrait Buffer Writer Reader Seek
|
syn keyword rustTrait PartialEq PartialOrd Eq Ord
|
||||||
syn keyword rustTrait Str StrVector StrSlice
|
syn keyword rustTrait DoubleEndedIterator
|
||||||
syn keyword rustTrait IntoMaybeOwned StrAllocating UnicodeStrSlice
|
syn keyword rustTrait ExactSizeIterator
|
||||||
syn keyword rustTrait ToString IntoStr
|
syn keyword rustTrait Iterator IteratorExt Extend
|
||||||
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
|
syn keyword rustEnum Option
|
||||||
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
|
syn keyword rustEnumVariant Some None
|
||||||
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12
|
syn keyword rustTrait PtrExt MutPtrExt
|
||||||
syn keyword rustTrait CloneableVector ImmutableCloneableVector
|
syn keyword rustEnum Result
|
||||||
syn keyword rustTrait MutableCloneableSlice MutableOrdSlice
|
syn keyword rustEnumVariant Ok Err
|
||||||
syn keyword rustTrait ImmutableSlice MutableSlice
|
syn keyword rustTrait AsSlice
|
||||||
syn keyword rustTrait ImmutablePartialEqSlice ImmutableOrdSlice
|
syn keyword rustTrait SliceExt SliceConcatExt
|
||||||
syn keyword rustTrait Slice VectorVector
|
syn keyword rustTrait Str StrExt
|
||||||
syn keyword rustTrait MutableSliceAllocating
|
syn keyword rustTrait String ToString
|
||||||
syn keyword rustTrait String
|
|
||||||
syn keyword rustTrait Vec
|
syn keyword rustTrait Vec
|
||||||
|
" FIXME: remove when path reform lands
|
||||||
"syn keyword rustFunction sync_channel channel
|
syn keyword rustTrait Path GenericPath
|
||||||
syn keyword rustTrait SyncSender Sender Receiver
|
" FIXME: remove when I/O reform lands
|
||||||
"syn keyword rustFunction spawn
|
syn keyword rustTrait Buffer Writer Reader Seek BufferPrelude
|
||||||
|
|
||||||
"syn keyword rustConstant GC
|
|
||||||
|
|
||||||
syn keyword rustSelf self
|
|
||||||
syn keyword rustBoolean true false
|
|
||||||
|
|
||||||
" Other syntax {{{2
|
" Other syntax {{{2
|
||||||
|
syn keyword rustSelf self
|
||||||
|
syn keyword rustBoolean true false
|
||||||
|
|
||||||
" If foo::bar changes to foo.bar, change this ("::" to "\.").
|
" If foo::bar changes to foo.bar, change this ("::" to "\.").
|
||||||
" If foo::bar changes to Foo::bar, change this (first "\w" to "\u").
|
" If foo::bar changes to Foo::bar, change this (first "\w" to "\u").
|
||||||
@@ -151,25 +121,26 @@ 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}\)/
|
||||||
syn match rustEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{8}\)/
|
syn match rustEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{8}\)/
|
||||||
|
syn match rustEscapeUnicode display contained /\\u{\x\{1,6}}/
|
||||||
syn match rustStringContinuation display contained /\\\n\s*/
|
syn match rustStringContinuation display contained /\\\n\s*/
|
||||||
syn region rustString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation
|
syn region rustString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation
|
||||||
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell
|
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell
|
||||||
syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell
|
syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell
|
||||||
|
|
||||||
syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDeriving
|
syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDerive
|
||||||
syn region rustDeriving start="deriving(" end=")" contained contains=rustTrait
|
syn region rustDerive start="derive(" end=")" contained contains=rustTrait
|
||||||
|
|
||||||
" Number literals
|
" Number literals
|
||||||
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(8\|16\|32\|64\)\=\)\="
|
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(s\|8\|16\|32\|64\)\)\="
|
||||||
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
|
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
|
||||||
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
|
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
|
||||||
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
|
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(s\|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,
|
||||||
@@ -193,7 +164,7 @@ syn match rustCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/
|
|||||||
" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII).
|
" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII).
|
||||||
syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/
|
syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/
|
||||||
syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode
|
syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode
|
||||||
syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid
|
syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\|u{\x\{1,6}}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid
|
||||||
|
|
||||||
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
|
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
|
||||||
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
|
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
|
||||||
@@ -263,12 +234,12 @@ 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
|
||||||
hi def link rustAttribute PreProc
|
hi def link rustAttribute PreProc
|
||||||
hi def link rustDeriving PreProc
|
hi def link rustDerive PreProc
|
||||||
hi def link rustStorage StorageClass
|
hi def link rustStorage StorageClass
|
||||||
hi def link rustObsoleteStorage Error
|
hi def link rustObsoleteStorage Error
|
||||||
hi def link rustLifetime Special
|
hi def link rustLifetime Special
|
||||||
@@ -280,9 +251,9 @@ hi def link rustBoxPlacementExpr rustKeyword
|
|||||||
|
|
||||||
" Other Suggestions:
|
" Other Suggestions:
|
||||||
" hi rustAttribute ctermfg=cyan
|
" hi rustAttribute ctermfg=cyan
|
||||||
" hi rustDeriving ctermfg=cyan
|
" hi rustDerive 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
|
||||||
|
|||||||
@@ -1,22 +1,40 @@
|
|||||||
if version < 600
|
" Vim syntax file
|
||||||
syntax clear
|
" Language: Scala
|
||||||
elseif exists("b:current_syntax")
|
" Maintainer: Derek Wyatt
|
||||||
finish
|
" URL: https://github.com/derekwyatt/vim-scala
|
||||||
|
" License: Apache 2
|
||||||
|
" ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if !exists('main_syntax')
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let main_syntax = 'scala'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
scriptencoding utf-8
|
scriptencoding utf-8
|
||||||
|
|
||||||
let b:current_syntax = "scala"
|
let b:current_syntax = "scala"
|
||||||
|
|
||||||
|
" Allows for embedding, see #59; main_syntax convention instead? Refactor TOP
|
||||||
|
"
|
||||||
|
" The @Spell here is a weird hack, it means *exclude* if the first group is
|
||||||
|
" TOP. Otherwise we get spelling errors highlighted on code elements that
|
||||||
|
" match scalaBlock, even with `syn spell notoplevel`.
|
||||||
function! s:ContainedGroup()
|
function! s:ContainedGroup()
|
||||||
try
|
try
|
||||||
silent syn list @scala
|
silent syn list @scala
|
||||||
return '@scala'
|
return '@scala,@NoSpell'
|
||||||
catch /E392/
|
catch /E392/
|
||||||
return 'TOP'
|
return 'TOP,@Spell'
|
||||||
endtry
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
syn include @scalaHtml syntax/html.vim " Doc comment HTML
|
||||||
|
unlet! b:current_syntax
|
||||||
|
|
||||||
syn case match
|
syn case match
|
||||||
syn sync minlines=200 maxlines=1000
|
syn sync minlines=200 maxlines=1000
|
||||||
|
|
||||||
@@ -37,7 +55,9 @@ syn match scalaSymbol /'[_A-Za-z0-9$]\+/
|
|||||||
hi link scalaSymbol Number
|
hi link scalaSymbol Number
|
||||||
|
|
||||||
syn match scalaChar /'.'/
|
syn match scalaChar /'.'/
|
||||||
syn match scalaEscapedChar /\\[\\"ntbrf]/
|
syn match scalaChar /'\\[\\"'ntbrf]'/ contains=scalaEscapedChar
|
||||||
|
syn match scalaChar /'\\u[A-Fa-f0-9]\{4}'/ contains=scalaUnicodeChar
|
||||||
|
syn match scalaEscapedChar /\\[\\"'ntbrf]/
|
||||||
syn match scalaUnicodeChar /\\u[A-Fa-f0-9]\{4}/
|
syn match scalaUnicodeChar /\\u[A-Fa-f0-9]\{4}/
|
||||||
hi link scalaChar Character
|
hi link scalaChar Character
|
||||||
hi link scalaEscapedChar Function
|
hi link scalaEscapedChar Function
|
||||||
@@ -58,6 +78,9 @@ syn match scalaInstanceHash /#/ contained nextgroup=scalaInstanceDeclaration
|
|||||||
hi link scalaInstanceDeclaration Special
|
hi link scalaInstanceDeclaration Special
|
||||||
hi link scalaInstanceHash Type
|
hi link scalaInstanceHash Type
|
||||||
|
|
||||||
|
syn match scalaUnimplemented /???/
|
||||||
|
hi link scalaUnimplemented ERROR
|
||||||
|
|
||||||
syn match scalaCapitalWord /\<[A-Z][A-Za-z0-9$]*\>/
|
syn match scalaCapitalWord /\<[A-Z][A-Za-z0-9$]*\>/
|
||||||
hi link scalaCapitalWord Special
|
hi link scalaCapitalWord Special
|
||||||
|
|
||||||
@@ -97,39 +120,45 @@ hi link scalaCaseFollowing Special
|
|||||||
syn keyword scalaKeywordModifier abstract override final lazy implicit implicitly private protected sealed null require super
|
syn keyword scalaKeywordModifier abstract override final lazy implicit implicitly private protected sealed null require super
|
||||||
hi link scalaKeywordModifier Function
|
hi link scalaKeywordModifier Function
|
||||||
|
|
||||||
syn keyword scalaSpecial this true false package import ne eq
|
syn keyword scalaSpecial this true false ne eq
|
||||||
syn keyword scalaSpecial new nextgroup=scalaInstanceDeclaration skipwhite
|
syn keyword scalaSpecial new nextgroup=scalaInstanceDeclaration skipwhite
|
||||||
syn match scalaSpecial "\%(=>\|⇒\|<-\|←\|->\|→\)"
|
syn match scalaSpecial "\%(=>\|⇒\|<-\|←\|->\|→\)"
|
||||||
syn match scalaSpecial /`[^`]*`/ " Backtick literals
|
syn match scalaSpecial /`[^`]*`/ " Backtick literals
|
||||||
hi link scalaSpecial PreProc
|
hi link scalaSpecial PreProc
|
||||||
|
|
||||||
|
syn keyword scalaExternal package import
|
||||||
|
hi link scalaExternal Include
|
||||||
|
|
||||||
syn match scalaStringEmbeddedQuote /\\"/ contained
|
syn match scalaStringEmbeddedQuote /\\"/ contained
|
||||||
syn region scalaString start=/"/ end=/"/ contains=scalaStringEmbeddedQuote,scalaEscapedChar,scalaUnicodeChar
|
syn region scalaString start=/"/ end=/"/ contains=scalaStringEmbeddedQuote,scalaEscapedChar,scalaUnicodeChar
|
||||||
hi link scalaString String
|
hi link scalaString String
|
||||||
hi link scalaStringEmbeddedQuote String
|
hi link scalaStringEmbeddedQuote String
|
||||||
|
|
||||||
syn region scalaIString matchgroup=Special start=/\<[a-zA-Z][a-zA-Z0-9_]*"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
syn region scalaIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
||||||
syn region scalaTripleIString matchgroup=Special start=/\<[a-zA-Z][a-zA-Z0-9_]*"""/ end=/"""\%([^"]\|$\)/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
syn region scalaTripleIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"""/ end=/"""\%([^"]\|$\)/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
||||||
hi link scalaIString String
|
hi link scalaIString String
|
||||||
hi link scalaTripleIString String
|
hi link scalaTripleIString String
|
||||||
|
|
||||||
syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained
|
syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained
|
||||||
exe 'syn region scalaInterpolationB matchgroup=scalaInterpolation start=/\${/ end=/}/ contained contains=' . s:ContainedGroup()
|
exe 'syn region scalaInterpolationB matchgroup=scalaInterpolationBoundary start=/\${/ end=/}/ contained contains=' . s:ContainedGroup()
|
||||||
hi link scalaInterpolation Function
|
hi link scalaInterpolation Function
|
||||||
hi link scalaInterpolationB Normal
|
hi link scalaInterpolationB Normal
|
||||||
|
|
||||||
syn region scalaFString matchgroup=Special start=/f"/ skip=/\\"/ end=/"/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
syn region scalaFString matchgroup=scalaInterpolationBrackets start=/f"/ skip=/\\"/ end=/"/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
||||||
syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+\(%[-A-Za-z0-9\.]\+\)\?/ contained
|
syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+\(%[-A-Za-z0-9\.]\+\)\?/ contained
|
||||||
exe 'syn region scalaFInterpolationB matchgroup=scalaFInterpolation start=/${/ end=/}\(%[-A-Za-z0-9\.]\+\)\?/ contained contains=' . s:ContainedGroup()
|
exe 'syn region scalaFInterpolationB matchgroup=scalaInterpolationBoundary start=/${/ end=/}\(%[-A-Za-z0-9\.]\+\)\?/ contained contains=' . s:ContainedGroup()
|
||||||
hi link scalaFString String
|
hi link scalaFString String
|
||||||
hi link scalaFInterpolation Function
|
hi link scalaFInterpolation Function
|
||||||
hi link scalaFInterpolationB Normal
|
hi link scalaFInterpolationB Normal
|
||||||
|
|
||||||
syn region scalaTripleString start=/"""/ end=/"""\%([^"]\|$\)/ contains=scalaEscapedChar,scalaUnicodeChar
|
syn region scalaTripleString start=/"""/ end=/"""\%([^"]\|$\)/ contains=scalaEscapedChar,scalaUnicodeChar
|
||||||
syn region scalaTripleFString matchgroup=Special start=/f"""/ end=/"""\%([^"]\|$\)/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
syn region scalaTripleFString matchgroup=scalaInterpolationBrackets start=/f"""/ end=/"""\%([^"]\|$\)/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
|
||||||
hi link scalaTripleString String
|
hi link scalaTripleString String
|
||||||
hi link scalaTripleFString String
|
hi link scalaTripleFString String
|
||||||
|
|
||||||
|
hi link scalaInterpolationBrackets Special
|
||||||
|
hi link scalaInterpolationBoundary Function
|
||||||
|
|
||||||
syn match scalaNumber /\<0[dDfFlL]\?\>/ " Just a bare 0
|
syn match scalaNumber /\<0[dDfFlL]\?\>/ " Just a bare 0
|
||||||
syn match scalaNumber /\<[1-9]\d*[dDfFlL]\?\>/ " A multi-digit number - octal numbers with leading 0's are deprecated in Scala
|
syn match scalaNumber /\<[1-9]\d*[dDfFlL]\?\>/ " A multi-digit number - octal numbers with leading 0's are deprecated in Scala
|
||||||
syn match scalaNumber /\<0[xX][0-9a-fA-F]\+[dDfFlL]\?\>/ " Hex number
|
syn match scalaNumber /\<0[xX][0-9a-fA-F]\+[dDfFlL]\?\>/ " Hex number
|
||||||
@@ -140,29 +169,35 @@ hi link scalaNumber Number
|
|||||||
|
|
||||||
syn region scalaRoundBrackets start="(" end=")" skipwhite contained contains=scalaTypeDeclaration,scalaSquareBrackets,scalaRoundBrackets
|
syn region scalaRoundBrackets start="(" end=")" skipwhite contained contains=scalaTypeDeclaration,scalaSquareBrackets,scalaRoundBrackets
|
||||||
|
|
||||||
syn region scalaSquareBrackets matchgroup=Type start="\[" end="\]" skipwhite nextgroup=scalaTypeExtension contains=scalaTypeDeclaration,scalaSquareBrackets,scalaTypeOperator,scalaTypeAnnotationParameter
|
syn region scalaSquareBrackets matchgroup=scalaSquareBracketsBrackets start="\[" end="\]" skipwhite nextgroup=scalaTypeExtension contains=scalaTypeDeclaration,scalaSquareBrackets,scalaTypeOperator,scalaTypeAnnotationParameter
|
||||||
syn match scalaTypeOperator /[-+=:<>]\+/ contained
|
syn match scalaTypeOperator /[-+=:<>]\+/ contained
|
||||||
syn match scalaTypeAnnotationParameter /@\<[`_A-Za-z0-9$]\+\>/ contained
|
syn match scalaTypeAnnotationParameter /@\<[`_A-Za-z0-9$]\+\>/ contained
|
||||||
|
hi link scalaSquareBracketsBrackets Type
|
||||||
hi link scalaTypeOperator Keyword
|
hi link scalaTypeOperator Keyword
|
||||||
hi link scalaTypeAnnotationParameter Function
|
hi link scalaTypeAnnotationParameter Function
|
||||||
|
|
||||||
syn region scalaMultilineComment start="/\*" end="\*/" contains=scalaMultilineComment,scalaDocLinks,scalaParameterAnnotation,scalaCommentAnnotation,scalaCommentCodeBlock,@scalaHtml keepend
|
syn match scalaShebang "\%^#!.*" display
|
||||||
|
syn region scalaMultilineComment start="/\*" end="\*/" contains=scalaMultilineComment,scalaDocLinks,scalaParameterAnnotation,scalaCommentAnnotation,scalaTodo,scalaCommentCodeBlock,@scalaHtml,@Spell keepend
|
||||||
syn match scalaCommentAnnotation "@[_A-Za-z0-9$]\+" contained
|
syn match scalaCommentAnnotation "@[_A-Za-z0-9$]\+" contained
|
||||||
syn match scalaParameterAnnotation "@param" nextgroup=scalaParamAnnotationValue skipwhite contained
|
syn match scalaParameterAnnotation "@param" nextgroup=scalaParamAnnotationValue skipwhite contained
|
||||||
syn match scalaParamAnnotationValue /[`_A-Za-z0-9$]\+/ contained
|
syn match scalaParamAnnotationValue /[`_A-Za-z0-9$]\+/ contained
|
||||||
syn region scalaDocLinks start="\[\[" end="\]\]" contained
|
syn region scalaDocLinks start="\[\[" end="\]\]" contained
|
||||||
syn region scalaCommentCodeBlock matchgroup=Keyword start="{{{" end="}}}" contained
|
syn region scalaCommentCodeBlock matchgroup=Keyword start="{{{" end="}}}" contained
|
||||||
|
syn match scalaTodo "\vTODO|FIXME|XXX" contained
|
||||||
|
hi link scalaShebang Comment
|
||||||
hi link scalaMultilineComment Comment
|
hi link scalaMultilineComment Comment
|
||||||
hi link scalaDocLinks Function
|
hi link scalaDocLinks Function
|
||||||
hi link scalaParameterAnnotation Function
|
hi link scalaParameterAnnotation Function
|
||||||
hi link scalaParamAnnotationValue Keyword
|
hi link scalaParamAnnotationValue Keyword
|
||||||
hi link scalaCommentAnnotation Function
|
hi link scalaCommentAnnotation Function
|
||||||
|
hi link scalaCommentCodeBlockBrackets String
|
||||||
hi link scalaCommentCodeBlock String
|
hi link scalaCommentCodeBlock String
|
||||||
|
hi link scalaTodo Todo
|
||||||
|
|
||||||
syn match scalaAnnotation /@\<[`_A-Za-z0-9$]\+\>/
|
syn match scalaAnnotation /@\<[`_A-Za-z0-9$]\+\>/
|
||||||
hi link scalaAnnotation PreProc
|
hi link scalaAnnotation PreProc
|
||||||
|
|
||||||
syn match scalaTrailingComment "//.*$"
|
syn match scalaTrailingComment "//.*$" contains=scalaTodo,@Spell
|
||||||
hi link scalaTrailingComment Comment
|
hi link scalaTrailingComment Comment
|
||||||
|
|
||||||
syn match scalaAkkaFSM /goto([^)]*)\_s\+\<using\>/ contains=scalaAkkaFSMGotoUsing
|
syn match scalaAkkaFSM /goto([^)]*)\_s\+\<using\>/ contains=scalaAkkaFSMGotoUsing
|
||||||
@@ -178,3 +213,11 @@ syn match scalaAkkaFSMGotoUsing /\<using\>/
|
|||||||
syn match scalaAkkaFSMGotoUsing /\<goto\>/
|
syn match scalaAkkaFSMGotoUsing /\<goto\>/
|
||||||
hi link scalaAkkaFSM PreProc
|
hi link scalaAkkaFSM PreProc
|
||||||
hi link scalaAkkaFSMGotoUsing PreProc
|
hi link scalaAkkaFSMGotoUsing PreProc
|
||||||
|
|
||||||
|
let b:current_syntax = 'scala'
|
||||||
|
|
||||||
|
if main_syntax ==# 'scala'
|
||||||
|
unlet main_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
" vim:set sw=2 sts=2 ts=8 et:
|
||||||
|
|||||||
97
syntax/tap.vim
Normal file
97
syntax/tap.vim
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: Verbose TAP Output
|
||||||
|
" Maintainer: Rufus Cable <rufus@threebytesfull.com>
|
||||||
|
" Remark: Simple syntax highlighting for TAP output
|
||||||
|
" License:
|
||||||
|
" Copyright: (c) 2008-2013 Rufus Cable
|
||||||
|
" Last Change: {{LAST_CHANGE}}
|
||||||
|
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn match tapTestDiag /^ *#.*/ contains=tapTestTodo
|
||||||
|
syn match tapTestTime /^ *\[\d\d:\d\d:\d\d\].*/ contains=tapTestFile
|
||||||
|
syn match tapTestFile /\w\+\/[^. ]*/ contained
|
||||||
|
syn match tapTestFileWithDot /\w\+\/[^ ]*/ contained
|
||||||
|
|
||||||
|
syn match tapTestPlan /^ *\d\+\.\.\d\+$/
|
||||||
|
|
||||||
|
" tapTest is a line like 'ok 1', 'not ok 2', 'ok 3 - xxxx'
|
||||||
|
syn match tapTest /^ *\(not \)\?ok \d\+.*/ contains=tapTestStatusOK,tapTestStatusNotOK,tapTestLine
|
||||||
|
|
||||||
|
" tapTestLine is the line without the ok/not ok status - i.e. number and
|
||||||
|
" optional message
|
||||||
|
syn match tapTestLine /\d\+\( .*\|$\)/ contains=tapTestNumber,tapTestLoadMessage,tapTestTodo,tapTestSkip contained
|
||||||
|
|
||||||
|
" turn ok/not ok messages green/red respectively
|
||||||
|
syn match tapTestStatusOK /ok/ contained
|
||||||
|
syn match tapTestStatusNotOK /not ok/ contained
|
||||||
|
|
||||||
|
" highlight todo tests
|
||||||
|
syn match tapTestTodo /\(# TODO\|Failed (TODO)\) .*$/ contained contains=tapTestTodoRev
|
||||||
|
syn match tapTestTodoRev /\<TODO\>/ contained
|
||||||
|
|
||||||
|
" highlight skipped tests
|
||||||
|
syn match tapTestSkip /# skip .*$/ contained contains=tapTestSkipTag
|
||||||
|
syn match tapTestSkipTag /\(# \)\@<=skip\>/ contained
|
||||||
|
|
||||||
|
" look behind so "ok 123" and "not ok 124" match test number
|
||||||
|
syn match tapTestNumber /\(ok \)\@<=\d\d*/ contained
|
||||||
|
syn match tapTestLoadMessage /\*\*\*.*\*\*\*/ contained contains=tapTestThreeStars,tapTestFileWithDot
|
||||||
|
syn match tapTestThreeStars /\*\*\*/ contained
|
||||||
|
|
||||||
|
syn region tapTestRegion start=/^ *\(not \)\?ok.*$/me=e+1 end=/^\(\(not \)\?ok\|# Looks like you planned \|All tests successful\|Bailout called\)/me=s-1 fold transparent excludenl
|
||||||
|
syn region tapTestResultsOKRegion start=/^\(All tests successful\|Result: PASS\)/ end=/$/
|
||||||
|
syn region tapTestResultsNotOKRegion start=/^\(# Looks like you planned \|Bailout called\|# Looks like you failed \|Result: FAIL\)/ end=/$/
|
||||||
|
syn region tapTestResultsSummaryRegion start=/^Test Summary Report/ end=/^Files=.*$/ contains=tapTestResultsSummaryHeading,tapTestResultsSummaryNotOK
|
||||||
|
|
||||||
|
syn region tapTestResultsSummaryHeading start=/^Test Summary Report/ end=/^-\+$/ contained
|
||||||
|
syn region tapTestResultsSummaryNotOK start=/TODO passed:/ end=/$/ contained
|
||||||
|
|
||||||
|
syn region tapTestInstructionsRegion start=/\%1l/ end=/^$/
|
||||||
|
|
||||||
|
set foldtext=TAPTestLine_foldtext()
|
||||||
|
function! TAPTestLine_foldtext()
|
||||||
|
let line = getline(v:foldstart)
|
||||||
|
let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
|
||||||
|
return sub
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
set foldminlines=5
|
||||||
|
set foldcolumn=2
|
||||||
|
set foldenable
|
||||||
|
set foldmethod=syntax
|
||||||
|
syn sync fromstart
|
||||||
|
|
||||||
|
if !exists("did_tapverboseoutput_syntax_inits")
|
||||||
|
let did_tapverboseoutput_syntax_inits = 1
|
||||||
|
|
||||||
|
hi tapTestStatusOK term=bold ctermfg=green guifg=Green
|
||||||
|
hi tapTestStatusNotOK term=reverse ctermfg=black ctermbg=red guifg=Black guibg=Red
|
||||||
|
hi tapTestTodo term=bold ctermfg=yellow ctermbg=black guifg=Yellow guibg=Black
|
||||||
|
hi tapTestTodoRev term=reverse ctermfg=black ctermbg=yellow guifg=Black guibg=Yellow
|
||||||
|
hi tapTestSkip term=bold ctermfg=lightblue guifg=LightBlue
|
||||||
|
hi tapTestSkipTag term=reverse ctermfg=black ctermbg=lightblue guifg=Black guibg=LightBlue
|
||||||
|
hi tapTestTime term=bold ctermfg=blue guifg=Blue
|
||||||
|
hi tapTestFile term=reverse ctermfg=black ctermbg=yellow guibg=Black guifg=Yellow
|
||||||
|
hi tapTestLoadedFile term=bold ctermfg=black ctermbg=cyan guibg=Cyan guifg=Black
|
||||||
|
hi tapTestThreeStars term=reverse ctermfg=blue guifg=Blue
|
||||||
|
hi tapTestPlan term=bold ctermfg=yellow guifg=Yellow
|
||||||
|
|
||||||
|
hi link tapTestFileWithDot tapTestLoadedFile
|
||||||
|
hi link tapTestNumber Number
|
||||||
|
hi link tapTestDiag Comment
|
||||||
|
|
||||||
|
hi tapTestRegion ctermbg=green
|
||||||
|
|
||||||
|
hi tapTestResultsOKRegion ctermbg=green ctermfg=black
|
||||||
|
hi tapTestResultsNotOKRegion ctermbg=red ctermfg=black
|
||||||
|
|
||||||
|
hi tapTestResultsSummaryHeading ctermbg=blue ctermfg=white
|
||||||
|
hi tapTestResultsSummaryNotOK ctermbg=red ctermfg=black
|
||||||
|
|
||||||
|
hi tapTestInstructionsRegion ctermbg=lightmagenta ctermfg=black
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:current_syntax="tapVerboseOutput"
|
||||||
98
syntax/thrift.vim
Normal file
98
syntax/thrift.vim
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: Thrift
|
||||||
|
" Maintainer: Martin Smith <martin@facebook.com>
|
||||||
|
" Last Change: $Date: $
|
||||||
|
"
|
||||||
|
" $Id: $
|
||||||
|
"
|
||||||
|
" Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
" or more contributor license agreements. See the NOTICE file
|
||||||
|
" distributed with this work for additional information
|
||||||
|
" regarding copyright ownership. The ASF licenses this file
|
||||||
|
" to you under the Apache License, Version 2.0 (the
|
||||||
|
" "License"); you may not use this file except in compliance
|
||||||
|
" with the License. You may obtain a copy of the License at
|
||||||
|
"
|
||||||
|
" http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
"
|
||||||
|
" Unless required by applicable law or agreed to in writing,
|
||||||
|
" software distributed under the License is distributed on an
|
||||||
|
" "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
" KIND, either express or implied. See the License for the
|
||||||
|
" specific language governing permissions and limitations
|
||||||
|
" under the License.
|
||||||
|
"
|
||||||
|
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Todo
|
||||||
|
syn keyword thriftTodo TODO todo FIXME fixme XXX xxx contained
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
syn match thriftComment "#.*" contains=thriftTodo,@Spell
|
||||||
|
syn region thriftComment start="/\*" end="\*/" contains=thriftTodo,@Spell
|
||||||
|
syn match thriftComment "//.\{-}\(?>\|$\)\@="
|
||||||
|
|
||||||
|
" String
|
||||||
|
syn region thriftStringDouble matchgroup=None start=+"+ end=+"+
|
||||||
|
|
||||||
|
" Number
|
||||||
|
syn match thriftNumber "-\=\<\d\+\>" contained
|
||||||
|
|
||||||
|
" Keywords
|
||||||
|
syn keyword thriftStatement namespace
|
||||||
|
syn keyword thriftInclude include
|
||||||
|
syn keyword thriftKeyword xsd_all xsd_optional xsd_nillable xsd_attrs
|
||||||
|
syn keyword thriftKeyword cpp_include cpp_type const optional required
|
||||||
|
syn keyword thriftStatement throws typedef
|
||||||
|
syn keyword thriftBasicTypes void bool byte string binary
|
||||||
|
syn keyword thriftBasicTypes i16 i32 i64 double
|
||||||
|
syn keyword thriftType map list set
|
||||||
|
syn keyword thriftClass struct exception enum
|
||||||
|
syn region thriftString start=+"+ end=+"+
|
||||||
|
|
||||||
|
" Special
|
||||||
|
syn match thriftNumber "\d\+:"
|
||||||
|
|
||||||
|
" Structure
|
||||||
|
syn keyword thriftStructure service oneway extends
|
||||||
|
"async" { return tok_async; }
|
||||||
|
"exception" { return tok_xception; }
|
||||||
|
"extends" { return tok_extends; }
|
||||||
|
"throws" { return tok_throws; }
|
||||||
|
"service" { return tok_service; }
|
||||||
|
"enum" { return tok_enum; }
|
||||||
|
"const" { return tok_const; }
|
||||||
|
|
||||||
|
if version >= 508 || !exists("did_thrift_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_thrift_syn_inits = 1
|
||||||
|
command! -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command! -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
HiLink thriftComment Comment
|
||||||
|
HiLink thriftKeyword Special
|
||||||
|
HiLink thriftBasicTypes Type
|
||||||
|
HiLink thriftType Type
|
||||||
|
HiLink thriftStructure StorageClass
|
||||||
|
HiLink thriftTodo Todo
|
||||||
|
HiLink thriftString String
|
||||||
|
HiLink thriftNumber Number
|
||||||
|
HiLink thriftSpecial Special
|
||||||
|
HiLink thriftStructure Structure
|
||||||
|
HiLink thriftStatement Statement
|
||||||
|
HiLink thriftInclude Include
|
||||||
|
HiLink thriftClass Type
|
||||||
|
HiLink thriftString String
|
||||||
|
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:current_syntax = "thrift"
|
||||||
|
|
||||||
302
syntax/tmux.vim
302
syntax/tmux.vim
@@ -1,8 +1,22 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: tmux(1) configuration file
|
" Language: tmux(1) configuration file
|
||||||
" Maintainer: Tiago Cunha <me@tiagocunha.org>
|
" Maintainer: Tiago Cunha <tcunha@users.sourceforge.net>
|
||||||
" Last Change: $Date: 2010-07-27 18:29:07 $
|
" Last Change: $Date: 2010-07-27 18:29:07 $
|
||||||
" License: This file is placed in the public domain.
|
" License: This file is placed in the public domain.
|
||||||
|
"
|
||||||
|
" To install this file:
|
||||||
|
"
|
||||||
|
" - Drop the file in the syntax directory into runtimepath (such as
|
||||||
|
" ~/.vim/syntax/tmux.vim).
|
||||||
|
" - Make the filetype recognisable by adding the following to filetype.vim
|
||||||
|
" (~/.vim/filetype.vim):
|
||||||
|
"
|
||||||
|
" augroup filetypedetect
|
||||||
|
" au BufNewFile,BufRead .tmux.conf*,tmux.conf* setf tmux
|
||||||
|
" augroup END
|
||||||
|
"
|
||||||
|
" - Switch on syntax highlighting by adding "syntax enable" to .vimrc.
|
||||||
|
"
|
||||||
|
|
||||||
if version < 600
|
if version < 600
|
||||||
syntax clear
|
syntax clear
|
||||||
@@ -16,64 +30,238 @@ syntax case match
|
|||||||
syn keyword tmuxAction any current none
|
syn keyword tmuxAction any current none
|
||||||
syn keyword tmuxBoolean off on
|
syn keyword tmuxBoolean off on
|
||||||
|
|
||||||
syn keyword tmuxCmds detach[-client] ls list-sessions neww new-window
|
syn keyword tmuxCmds
|
||||||
syn keyword tmuxCmds bind[-key] unbind[-key] prev[ious-window] last[-window]
|
\ attach[-session]
|
||||||
syn keyword tmuxCmds lsk list-keys set[-option] renamew rename-window selectw
|
\ bind[-key]
|
||||||
syn keyword tmuxCmds select-window lsw list-windows attach[-session]
|
\ break-pane
|
||||||
syn keyword tmuxCmds send-prefix refresh[-client] killw kill-window lsc
|
\ breakp
|
||||||
syn keyword tmuxCmds list-clients linkw link-window unlinkw unlink-window
|
\ capture-pane
|
||||||
syn keyword tmuxCmds next[-window] send[-keys] swapw swap-window
|
\ capturep
|
||||||
syn keyword tmuxCmds rename[-session] kill-session switchc switch-client
|
\ choose-buffer
|
||||||
syn keyword tmuxCmds has[-session] copy-mode pasteb paste-buffer
|
\ choose-client
|
||||||
syn keyword tmuxCmds new[-session] start[-server] kill-server setw
|
\ choose-list
|
||||||
syn keyword tmuxCmds set-window-option show[-options] showw show-window-options
|
\ choose-session
|
||||||
syn keyword tmuxCmds command-prompt setb set-buffer showb show-buffer lsb
|
\ choose-tree
|
||||||
syn keyword tmuxCmds list-buffers deleteb delete-buffer lscm list-commands
|
\ choose-window
|
||||||
syn keyword tmuxCmds movew move-window respawnw respawn-window
|
\ clear-history
|
||||||
syn keyword tmuxCmds source[-file] info server-info clock-mode lock[-server]
|
\ clearhist
|
||||||
syn keyword tmuxCmds saveb save-buffer killp
|
\ clock-mode
|
||||||
syn keyword tmuxCmds kill-pane resizep resize-pane selectp select-pane swapp
|
\ command-prompt
|
||||||
syn keyword tmuxCmds swap-pane splitw split-window choose-session
|
\ confirm[-before]
|
||||||
syn keyword tmuxCmds choose-window loadb load-buffer copyb copy-buffer suspendc
|
\ copy-mode
|
||||||
syn keyword tmuxCmds suspend-client findw find-window breakp break-pane nextl
|
\ delete-buffer
|
||||||
syn keyword tmuxCmds next-layout rotatew rotate-window confirm[-before]
|
\ deleteb
|
||||||
syn keyword tmuxCmds clearhist clear-history selectl select-layout if[-shell]
|
\ detach[-client]
|
||||||
syn keyword tmuxCmds display[-message] setenv set-environment showenv
|
\ display[-message]
|
||||||
syn keyword tmuxCmds show-environment choose-client displayp display-panes
|
\ display-panes
|
||||||
syn keyword tmuxCmds run[-shell] lockc lock-client locks lock-session lsp
|
\ displayp
|
||||||
syn keyword tmuxCmds list-panes pipep pipe-pane showmsgs show-messages capturep
|
\ find-window
|
||||||
syn keyword tmuxCmds capture-pane joinp join-pane choose-buffer
|
\ findw
|
||||||
|
\ has[-session]
|
||||||
|
\ if[-shell]
|
||||||
|
\ join-pane
|
||||||
|
\ joinp
|
||||||
|
\ kill-pane
|
||||||
|
\ killp
|
||||||
|
\ kill-server
|
||||||
|
\ kill-session
|
||||||
|
\ kill-window
|
||||||
|
\ killw
|
||||||
|
\ last-pane
|
||||||
|
\ lastp
|
||||||
|
\ last[-window]
|
||||||
|
\ link-window
|
||||||
|
\ linkw
|
||||||
|
\ list-buffers
|
||||||
|
\ lsb
|
||||||
|
\ list-clients
|
||||||
|
\ lsc
|
||||||
|
\ list-commands
|
||||||
|
\ lscm
|
||||||
|
\ list-keys
|
||||||
|
\ lsk
|
||||||
|
\ list-panes
|
||||||
|
\ lsp
|
||||||
|
\ list-sessions
|
||||||
|
\ ls
|
||||||
|
\ list-windows
|
||||||
|
\ lsw
|
||||||
|
\ load-buffer
|
||||||
|
\ loadb
|
||||||
|
\ lock-client
|
||||||
|
\ lockc
|
||||||
|
\ lock[-server]
|
||||||
|
\ lock-session
|
||||||
|
\ locks
|
||||||
|
\ move-pane
|
||||||
|
\ movep
|
||||||
|
\ move-window
|
||||||
|
\ movew
|
||||||
|
\ new[-session]
|
||||||
|
\ next-layout
|
||||||
|
\ nextl
|
||||||
|
\ next[-window]
|
||||||
|
\ paste-buffer
|
||||||
|
\ pasteb
|
||||||
|
\ pipe-pane
|
||||||
|
\ pipep
|
||||||
|
\ previous-layout
|
||||||
|
\ prevl
|
||||||
|
\ prev[ious-window]
|
||||||
|
\ refresh[-client]
|
||||||
|
\ rename[-session]
|
||||||
|
\ rename-window
|
||||||
|
\ renamew
|
||||||
|
\ resize-pane
|
||||||
|
\ resizep
|
||||||
|
\ respawn-pane
|
||||||
|
\ respawnp
|
||||||
|
\ respawn-window
|
||||||
|
\ respawnw
|
||||||
|
\ rotate-window
|
||||||
|
\ rotatew
|
||||||
|
\ run[-shell]
|
||||||
|
\ save-buffer
|
||||||
|
\ saveb
|
||||||
|
\ select-layout
|
||||||
|
\ selectl
|
||||||
|
\ select-pane
|
||||||
|
\ selectp
|
||||||
|
\ select-window
|
||||||
|
\ selectw
|
||||||
|
\ send[-keys]
|
||||||
|
\ send-prefix
|
||||||
|
\ server-info
|
||||||
|
\ info
|
||||||
|
\ set-buffer
|
||||||
|
\ setb
|
||||||
|
\ set-environment
|
||||||
|
\ setenv
|
||||||
|
\ set[-option]
|
||||||
|
\ set-window-option
|
||||||
|
\ setw
|
||||||
|
\ show-buffer
|
||||||
|
\ showb
|
||||||
|
\ show-environment
|
||||||
|
\ showenv
|
||||||
|
\ show-messages
|
||||||
|
\ showmsgs
|
||||||
|
\ show[-options]
|
||||||
|
\ show-window-options
|
||||||
|
\ showw
|
||||||
|
\ source[-file]
|
||||||
|
\ split-window
|
||||||
|
\ splitw
|
||||||
|
\ start[-server]
|
||||||
|
\ suspend-client
|
||||||
|
\ suspendc
|
||||||
|
\ swap-pane
|
||||||
|
\ swapp
|
||||||
|
\ swap-window
|
||||||
|
\ swapw
|
||||||
|
\ switch-client
|
||||||
|
\ switchc
|
||||||
|
\ unbind[-key]
|
||||||
|
\ unlink-window
|
||||||
|
\ unlinkw
|
||||||
|
\ wait[-for]
|
||||||
|
|
||||||
syn keyword tmuxOptsSet prefix status status-fg status-bg bell-action
|
syn keyword tmuxOptsSet
|
||||||
syn keyword tmuxOptsSet default-command history-limit status-left status-right
|
\ assume-paste-time
|
||||||
syn keyword tmuxOptsSet status-interval set-titles display-time buffer-limit
|
\ base-index
|
||||||
syn keyword tmuxOptsSet status-left-length status-right-length
|
\ bell-action
|
||||||
syn keyword tmuxOptsSet message-[command-]bg lock-after-time default-path
|
\ bell-on-alert
|
||||||
syn keyword tmuxOptsSet message-[command-]attr status-attr set-remain-on-exit
|
\ buffer-limit
|
||||||
syn keyword tmuxOptsSet status-utf8 default-terminal visual-activity repeat-time
|
\ default-command
|
||||||
syn keyword tmuxOptsSet visual-bell visual-content status-justify status-keys
|
\ default-shell
|
||||||
syn keyword tmuxOptsSet terminal-overrides status-left-attr status-left-bg
|
\ default-terminal
|
||||||
syn keyword tmuxOptsSet status-left-fg status-right-attr status-right-bg
|
\ destroy-unattached
|
||||||
syn keyword tmuxOptsSet status-right-fg update-environment base-index
|
\ detach-on-destroy
|
||||||
syn keyword tmuxOptsSet display-panes-colour display-panes-time default-shell
|
\ display-panes-active-colour
|
||||||
syn keyword tmuxOptsSet set-titles-string lock-command lock-server
|
\ display-panes-colour
|
||||||
syn keyword tmuxOptsSet mouse-select-pane message-limit quiet escape-time
|
\ display-panes-time
|
||||||
syn keyword tmuxOptsSet pane-active-border-bg pane-active-border-fg
|
\ display-time
|
||||||
syn keyword tmuxOptsSet pane-border-bg pane-border-fg message-[command-]fg
|
\ escape-time
|
||||||
syn keyword tmuxOptsSet display-panes-active-colour alternate-screen
|
\ exit-unattached
|
||||||
syn keyword tmuxOptsSet detach-on-destroy
|
\ focus-events
|
||||||
|
\ history-limit
|
||||||
|
\ lock-after-time
|
||||||
|
\ lock-command
|
||||||
|
\ lock-server
|
||||||
|
\ message-command-style
|
||||||
|
\ message-limit
|
||||||
|
\ message-style
|
||||||
|
\ mouse-resize-pane
|
||||||
|
\ mouse-select-pane
|
||||||
|
\ mouse-select-window
|
||||||
|
\ mouse-utf8
|
||||||
|
\ pane-active-border-style
|
||||||
|
\ pane-border-style
|
||||||
|
\ prefix
|
||||||
|
\ prefix2
|
||||||
|
\ quiet
|
||||||
|
\ renumber-windows
|
||||||
|
\ repeat-time
|
||||||
|
\ set-clipboard
|
||||||
|
\ set-remain-on-exit
|
||||||
|
\ set-titles
|
||||||
|
\ set-titles-string
|
||||||
|
\ status
|
||||||
|
\ status-interval
|
||||||
|
\ status-justify
|
||||||
|
\ status-keys
|
||||||
|
\ status-left
|
||||||
|
\ status-left-length
|
||||||
|
\ status-left-style
|
||||||
|
\ status-position
|
||||||
|
\ status-right
|
||||||
|
\ status-right-length
|
||||||
|
\ status-utf8
|
||||||
|
\ staus-right-style
|
||||||
|
\ terminal-overrides
|
||||||
|
\ update-environment
|
||||||
|
\ visual-activity
|
||||||
|
\ visual-bell
|
||||||
|
\ visual-content
|
||||||
|
\ visual-silence
|
||||||
|
\ word-separators
|
||||||
|
|
||||||
syn keyword tmuxOptsSetw monitor-activity aggressive-resize force-width
|
syn keyword tmuxOptsSetw
|
||||||
syn keyword tmuxOptsSetw force-height remain-on-exit uft8 mode-fg mode-bg
|
\ aggressive-resize
|
||||||
syn keyword tmuxOptsSetw mode-keys clock-mode-colour clock-mode-style
|
\ allow-rename
|
||||||
syn keyword tmuxOptsSetw xterm-keys mode-attr window-status-attr
|
\ alternate-screen
|
||||||
syn keyword tmuxOptsSetw window-status-bg window-status-fg automatic-rename
|
\ automatic-rename
|
||||||
syn keyword tmuxOptsSetw main-pane-width main-pane-height monitor-content
|
\ c0-change-interval
|
||||||
syn keyword tmuxOptsSetw window-status-current-attr window-status-current-bg
|
\ c0-change-trigger
|
||||||
syn keyword tmuxOptsSetw window-status-current-fg mode-mouse synchronize-panes
|
\ clock-mode-colour
|
||||||
syn keyword tmuxOptsSetw window-status-format window-status-current-format
|
\ clock-mode-style
|
||||||
syn keyword tmuxOptsSetw word-separators window-status-alert-attr
|
\ force-height
|
||||||
syn keyword tmuxOptsSetw window-status-alert-bg window-status-alert-fg
|
\ force-width
|
||||||
|
\ main-pane-height
|
||||||
|
\ main-pane-width
|
||||||
|
\ mode-keys
|
||||||
|
\ mode-mouse
|
||||||
|
\ mode-style
|
||||||
|
\ monitor-activity
|
||||||
|
\ monitor-content
|
||||||
|
\ monitor-silence
|
||||||
|
\ other-pane-height
|
||||||
|
\ other-pane-width
|
||||||
|
\ pane-base-index
|
||||||
|
\ remain-on-exit
|
||||||
|
\ synchronize-panes
|
||||||
|
\ utf8
|
||||||
|
\ window-status-activity-style
|
||||||
|
\ window-status-bell-style
|
||||||
|
\ window-status-content-style
|
||||||
|
\ window-status-current-format
|
||||||
|
\ window-status-current-style
|
||||||
|
\ window-status-format
|
||||||
|
\ window-status-last-style
|
||||||
|
\ window-status-separator
|
||||||
|
\ window-status-style
|
||||||
|
\ wrap-search
|
||||||
|
\ xterm-keys
|
||||||
|
|
||||||
syn keyword tmuxTodo FIXME NOTE TODO XXX contained
|
syn keyword tmuxTodo FIXME NOTE TODO XXX contained
|
||||||
|
|
||||||
|
|||||||
18
syntax/tomdoc.vim
Normal file
18
syntax/tomdoc.vim
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
syn keyword tomdocKeywords
|
||||||
|
\ Returns Yields Raises Examples Signature
|
||||||
|
\ containedin=.*Comment
|
||||||
|
\ contained
|
||||||
|
|
||||||
|
syn match tomdocDescriptions
|
||||||
|
\ +\s*\(Public\|Internal\|Deprecated\):+he=e-1
|
||||||
|
\ containedin=.*Comment
|
||||||
|
\ contained
|
||||||
|
|
||||||
|
syn match tomdocArguments
|
||||||
|
\ +\s*[A-Za-z0-9_\-&\*:]*\(\s*- \)+he=e-3
|
||||||
|
\ containedin=.*Comment
|
||||||
|
\ contained
|
||||||
|
|
||||||
|
hi default link tomdocDescriptions String
|
||||||
|
hi default link tomdocKeywords String
|
||||||
|
hi default link tomdocArguments HELP
|
||||||
@@ -57,8 +57,8 @@ syntax case match
|
|||||||
|
|
||||||
"" Syntax in the typeScript code"{{{
|
"" Syntax in the typeScript code"{{{
|
||||||
syn match typeScriptSpecial "\\\d\d\d\|\\."
|
syn match typeScriptSpecial "\\\d\d\d\|\\."
|
||||||
syn region typeScriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=typeScriptSpecial,@htmlPreproc
|
syn region typeScriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=typeScriptSpecial,@htmlPreproc
|
||||||
syn region typeScriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=typeScriptSpecial,@htmlPreproc
|
syn region typeScriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=typeScriptSpecial,@htmlPreproc
|
||||||
|
|
||||||
syn match typeScriptSpecialCharacter "'\\.'"
|
syn match typeScriptSpecialCharacter "'\\.'"
|
||||||
syn match typeScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
|
syn match typeScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
|
||||||
@@ -72,28 +72,28 @@ syntax match typeScriptFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\
|
|||||||
" syntax match typeScriptLabel /\(?\s*\)\@<!\<\w\+\(\s*:\)\@=/
|
" syntax match typeScriptLabel /\(?\s*\)\@<!\<\w\+\(\s*:\)\@=/
|
||||||
"}}}
|
"}}}
|
||||||
"" typeScript Prototype"{{{
|
"" typeScript Prototype"{{{
|
||||||
syntax keyword typeScriptPrototype prototype
|
syntax keyword typeScriptPrototype contained prototype
|
||||||
"}}}
|
"}}}
|
||||||
" DOM, Browser and Ajax Support {{{
|
" DOM, Browser and Ajax Support {{{
|
||||||
""""""""""""""""""""""""
|
""""""""""""""""""""""""
|
||||||
syntax keyword typeScriptBrowserObjects window navigator screen history location
|
syntax keyword typeScriptBrowserObjects window navigator screen history location
|
||||||
|
|
||||||
syntax keyword typeScriptDOMObjects document event HTMLElement Anchor Area Base Body Button Form Frame Frameset Image Link Meta Option Select Style Table TableCell TableRow Textarea
|
syntax keyword typeScriptDOMObjects document event HTMLElement Anchor Area Base Body Button Form Frame Frameset Image Link Meta Option Select Style Table TableCell TableRow Textarea
|
||||||
syntax keyword typeScriptDOMMethods createTextNode createElement insertBefore replaceChild removeChild appendChild hasChildNodes cloneNode normalize isSupported hasAttributes getAttribute setAttribute removeAttribute getAttributeNode setAttributeNode removeAttributeNode getElementsByTagName hasAttribute getElementById adoptNode close compareDocumentPosition createAttribute createCDATASection createComment createDocumentFragment createElementNS createEvent createExpression createNSResolver createProcessingInstruction createRange createTreeWalker elementFromPoint evaluate getBoxObjectFor getElementsByClassName getSelection getUserData hasFocus importNode
|
syntax keyword typeScriptDOMMethods contained createTextNode createElement insertBefore replaceChild removeChild appendChild hasChildNodes cloneNode normalize isSupported hasAttributes getAttribute setAttribute removeAttribute getAttributeNode setAttributeNode removeAttributeNode getElementsByTagName hasAttribute getElementById adoptNode close compareDocumentPosition createAttribute createCDATASection createComment createDocumentFragment createElementNS createEvent createExpression createNSResolver createProcessingInstruction createRange createTreeWalker elementFromPoint evaluate getBoxObjectFor getElementsByClassName getSelection getUserData hasFocus importNode
|
||||||
syntax keyword typeScriptDOMProperties nodeName nodeValue nodeType parentNode childNodes firstChild lastChild previousSibling nextSibling attributes ownerDocument namespaceURI prefix localName tagName
|
syntax keyword typeScriptDOMProperties contained nodeName nodeValue nodeType parentNode childNodes firstChild lastChild previousSibling nextSibling attributes ownerDocument namespaceURI prefix localName tagName
|
||||||
|
|
||||||
syntax keyword typeScriptAjaxObjects XMLHttpRequest
|
syntax keyword typeScriptAjaxObjects XMLHttpRequest
|
||||||
syntax keyword typeScriptAjaxProperties readyState responseText responseXML statusText
|
syntax keyword typeScriptAjaxProperties contained readyState responseText responseXML statusText
|
||||||
syntax keyword typeScriptAjaxMethods onreadystatechange abort getAllResponseHeaders getResponseHeader open send setRequestHeader
|
syntax keyword typeScriptAjaxMethods contained onreadystatechange abort getAllResponseHeaders getResponseHeader open send setRequestHeader
|
||||||
|
|
||||||
syntax keyword typeScriptPropietaryObjects ActiveXObject
|
syntax keyword typeScriptPropietaryObjects ActiveXObject
|
||||||
syntax keyword typeScriptPropietaryMethods attachEvent detachEvent cancelBubble returnValue
|
syntax keyword typeScriptPropietaryMethods contained attachEvent detachEvent cancelBubble returnValue
|
||||||
|
|
||||||
syntax keyword typeScriptHtmlElemProperties className clientHeight clientLeft clientTop clientWidth dir href id innerHTML lang length offsetHeight offsetLeft offsetParent offsetTop offsetWidth scrollHeight scrollLeft scrollTop scrollWidth style tabIndex target title
|
syntax keyword typeScriptHtmlElemProperties contained className clientHeight clientLeft clientTop clientWidth dir href id innerHTML lang length offsetHeight offsetLeft offsetParent offsetTop offsetWidth scrollHeight scrollLeft scrollTop scrollWidth style tabIndex target title
|
||||||
|
|
||||||
syntax keyword typeScriptEventListenerKeywords blur click focus mouseover mouseout load item
|
syntax keyword typeScriptEventListenerKeywords contained blur click focus mouseover mouseout load item
|
||||||
|
|
||||||
syntax keyword typeScriptEventListenerMethods scrollIntoView addEventListener dispatchEvent removeEventListener preventDefault stopPropagation
|
syntax keyword typeScriptEventListenerMethods contained scrollIntoView addEventListener dispatchEvent removeEventListener preventDefault stopPropagation
|
||||||
" }}}
|
" }}}
|
||||||
"" Programm Keywords"{{{
|
"" Programm Keywords"{{{
|
||||||
syntax keyword typeScriptSource import export
|
syntax keyword typeScriptSource import export
|
||||||
@@ -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 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"{{{
|
||||||
|
|
||||||
@@ -165,33 +165,34 @@ if exists("typeScript_enable_domhtmlcss")
|
|||||||
syntax keyword typeScriptCssStyles contained marks maxHeight maxWidth minHeight minWidth opacity MozOpacity overflow overflowX overflowY verticalAlign visibility zoom cssText
|
syntax keyword typeScriptCssStyles contained marks maxHeight maxWidth minHeight minWidth opacity MozOpacity overflow overflowX overflowY verticalAlign visibility zoom cssText
|
||||||
syntax keyword typeScriptCssStyles contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor
|
syntax keyword typeScriptCssStyles contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor
|
||||||
"}}}
|
"}}}
|
||||||
" Highlight ways"{{{
|
|
||||||
syntax match typeScriptDotNotation "\." nextgroup=typeScriptPrototype,typeScriptDomElemAttrs,typeScriptDomElemFuncs,typeScriptHtmlElemAttrs,typeScriptHtmlElemFuncs
|
|
||||||
syntax match typeScriptDotNotation "\.style\." nextgroup=typeScriptCssStyles
|
|
||||||
"}}}
|
|
||||||
endif "DOM/HTML/CSS
|
endif "DOM/HTML/CSS
|
||||||
|
|
||||||
|
" Highlight ways"{{{
|
||||||
|
syntax match typeScriptDotNotation "\." nextgroup=typeScriptPrototype,typeScriptDomElemAttrs,typeScriptDomElemFuncs,typeScriptDOMMethods,typeScriptDOMProperties,typeScriptHtmlElemAttrs,typeScriptHtmlElemFuncs,typeScriptHtmlElemProperties,typeScriptAjaxProperties,typeScriptAjaxMethods,typeScriptPropietaryMethods,typeScriptEventListenerMethods skipwhite skipnl
|
||||||
|
syntax match typeScriptDotNotation "\.style\." nextgroup=typeScriptCssStyles
|
||||||
|
"}}}
|
||||||
|
|
||||||
"" end DOM/HTML/CSS specified things""}}}
|
"" end DOM/HTML/CSS specified things""}}}
|
||||||
|
|
||||||
|
|
||||||
"" Code blocks
|
"" Code blocks
|
||||||
syntax cluster typeScriptAll contains=typeScriptComment,typeScriptLineComment,typeScriptDocComment,typeScriptStringD,typeScriptStringS,typeScriptRegexpString,typeScriptNumber,typeScriptFloat,typeScriptLabel,typeScriptSource,typeScriptType,typeScriptOperator,typeScriptBoolean,typeScriptNull,typeScriptFuncKeyword,typeScriptConditional,typeScriptGlobal,typeScriptRepeat,typeScriptBranch,typeScriptStatement,typeScriptGlobalObjects,typeScriptMessage,typeScriptIdentifier,typeScriptExceptions,typeScriptReserved,typeScriptDeprecated,typeScriptDomErrNo,typeScriptDomNodeConsts,typeScriptHtmlEvents,typeScriptDotNotation,typeScriptBrowserObjects,typeScriptDOMObjects,typeScriptAjaxObjects,typeScriptPropietaryObjects,typeScriptDOMMethods,typeScriptHtmlElemProperties,typeScriptDOMProperties,typeScriptEventListenerKeywords,typeScriptEventListenerMethods,typeScriptAjaxProperties,typeScriptAjaxMethods,typeScriptFuncArg
|
syntax cluster typeScriptAll contains=typeScriptComment,typeScriptLineComment,typeScriptDocComment,typeScriptStringD,typeScriptStringS,typeScriptRegexpString,typeScriptNumber,typeScriptFloat,typeScriptLabel,typeScriptSource,typeScriptType,typeScriptOperator,typeScriptBoolean,typeScriptNull,typeScriptFuncKeyword,typeScriptConditional,typeScriptGlobal,typeScriptRepeat,typeScriptBranch,typeScriptStatement,typeScriptGlobalObjects,typeScriptMessage,typeScriptIdentifier,typeScriptExceptions,typeScriptReserved,typeScriptDeprecated,typeScriptDomErrNo,typeScriptDomNodeConsts,typeScriptHtmlEvents,typeScriptDotNotation,typeScriptBrowserObjects,typeScriptDOMObjects,typeScriptAjaxObjects,typeScriptPropietaryObjects,typeScriptDOMMethods,typeScriptHtmlElemProperties,typeScriptDOMProperties,typeScriptEventListenerKeywords,typeScriptEventListenerMethods,typeScriptAjaxProperties,typeScriptAjaxMethods,typeScriptFuncArg
|
||||||
|
|
||||||
if main_syntax == "typeScript"
|
if main_syntax == "typescript"
|
||||||
syntax sync clear
|
syntax sync clear
|
||||||
syntax sync ccomment typeScriptComment minlines=200
|
syntax sync ccomment typeScriptComment minlines=200
|
||||||
" syntax sync match typeScriptHighlight grouphere typeScriptBlock /{/
|
" syntax sync match typeScriptHighlight grouphere typeScriptBlock /{/
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syntax keyword typeScriptFuncKeyword function contained
|
syntax keyword typeScriptFuncKeyword function
|
||||||
syntax region typeScriptFuncDef start="function" end="\([^)]*\)" contains=typeScriptFuncKeyword,typeScriptFuncArg keepend
|
"syntax region typeScriptFuncDef start="function" end="\(.*\)" contains=typeScriptFuncKeyword,typeScriptFuncArg keepend
|
||||||
syntax match typeScriptFuncArg "\(([^()]*)\)" contains=typeScriptParens,typeScriptFuncComma contained
|
"syntax match typeScriptFuncArg "\(([^()]*)\)" contains=typeScriptParens,typeScriptFuncComma contained
|
||||||
syntax match typeScriptFuncComma /,/ contained
|
"syntax match typeScriptFuncComma /,/ contained
|
||||||
" syntax region typeScriptFuncBlock contained matchgroup=typeScriptFuncBlock start="{" end="}" contains=@typeScriptAll,typeScriptParensErrA,typeScriptParensErrB,typeScriptParen,typeScriptBracket,typeScriptBlock fold
|
" syntax region typeScriptFuncBlock contained matchgroup=typeScriptFuncBlock start="{" end="}" contains=@typeScriptAll,typeScriptParensErrA,typeScriptParensErrB,typeScriptParen,typeScriptBracket,typeScriptBlock fold
|
||||||
|
|
||||||
syn match typeScriptBraces "[{}\[\]]"
|
syn match typeScriptBraces "[{}\[\]]"
|
||||||
syn match typeScriptParens "[()]"
|
syn match typeScriptParens "[()]"
|
||||||
syn match typeScriptOpSymbols "=\{1,3}\|!==\|!=\|<\|>\|>=\|<=\|++\|+=\|--\|-="
|
syn match typeScriptOpSymbols "=\{1,3}\|!==\|!=\|<\|>\|>=\|<=\|++\|+=\|--\|-="
|
||||||
syn match typeScriptEndColons "[;,]"
|
syn match typeScriptEndColons "[;,]"
|
||||||
syn match typeScriptLogicSymbols "\(&&\)\|\(||\)"
|
syn match typeScriptLogicSymbols "\(&&\)\|\(||\)"
|
||||||
|
|
||||||
@@ -204,7 +205,7 @@ syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend
|
|||||||
setl foldtext=FoldText()
|
setl foldtext=FoldText()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
au FileType typeScript call TypeScriptFold()
|
au FileType typescript call TypeScriptFold()
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
@@ -280,28 +281,29 @@ if version >= 508 || !exists("did_typeScript_syn_inits")
|
|||||||
HiLink typeScriptHtmlElemFuncs PreProc
|
HiLink typeScriptHtmlElemFuncs PreProc
|
||||||
|
|
||||||
HiLink typeScriptCssStyles Label
|
HiLink typeScriptCssStyles Label
|
||||||
" Ajax Highlighting
|
|
||||||
HiLink typeScriptBrowserObjects Constant
|
|
||||||
|
|
||||||
HiLink typeScriptDOMObjects Constant
|
" Ajax Highlighting
|
||||||
HiLink typeScriptDOMMethods Exception
|
HiLink typeScriptBrowserObjects Constant
|
||||||
HiLink typeScriptDOMProperties Type
|
|
||||||
|
|
||||||
HiLink typeScriptAjaxObjects htmlH1
|
HiLink typeScriptDOMObjects Constant
|
||||||
HiLink typeScriptAjaxMethods Exception
|
HiLink typeScriptDOMMethods Function
|
||||||
HiLink typeScriptAjaxProperties Type
|
HiLink typeScriptDOMProperties Special
|
||||||
|
|
||||||
HiLink typeScriptFuncDef Title
|
HiLink typeScriptAjaxObjects Constant
|
||||||
HiLink typeScriptFuncArg Special
|
HiLink typeScriptAjaxMethods Function
|
||||||
HiLink typeScriptFuncComma Operator
|
HiLink typeScriptAjaxProperties Special
|
||||||
|
|
||||||
HiLink typeScriptHtmlEvents Special
|
HiLink typeScriptFuncDef Title
|
||||||
HiLink typeScriptHtmlElemProperties Type
|
HiLink typeScriptFuncArg Special
|
||||||
|
HiLink typeScriptFuncComma Operator
|
||||||
|
|
||||||
HiLink typeScriptEventListenerKeywords Keyword
|
HiLink typeScriptHtmlEvents Special
|
||||||
|
HiLink typeScriptHtmlElemProperties Special
|
||||||
|
|
||||||
HiLink typeScriptNumber Number
|
HiLink typeScriptEventListenerKeywords Keyword
|
||||||
HiLink typeScriptPropietaryObjects Constant
|
|
||||||
|
HiLink typeScriptNumber Number
|
||||||
|
HiLink typeScriptPropietaryObjects Constant
|
||||||
|
|
||||||
delcommand HiLink
|
delcommand HiLink
|
||||||
endif
|
endif
|
||||||
@@ -312,8 +314,8 @@ endif
|
|||||||
syntax cluster htmltypeScript contains=@typeScriptAll,typeScriptBracket,typeScriptParen,typeScriptBlock,typeScriptParenError
|
syntax cluster htmltypeScript contains=@typeScriptAll,typeScriptBracket,typeScriptParen,typeScriptBlock,typeScriptParenError
|
||||||
syntax cluster typeScriptExpression contains=@typeScriptAll,typeScriptBracket,typeScriptParen,typeScriptBlock,typeScriptParenError,@htmlPreproc
|
syntax cluster typeScriptExpression contains=@typeScriptAll,typeScriptBracket,typeScriptParen,typeScriptBlock,typeScriptParenError,@htmlPreproc
|
||||||
|
|
||||||
let b:current_syntax = "typeScript"
|
let b:current_syntax = "typescript"
|
||||||
if main_syntax == 'typeScript'
|
if main_syntax == 'typescript'
|
||||||
unlet main_syntax
|
unlet main_syntax
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
200
syntax/vala.vim
Normal file
200
syntax/vala.vim
Normal file
@@ -0,0 +1,200 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: Vala
|
||||||
|
" Maintainers: Emmanuele Bassi <ebassi@gnome.org>
|
||||||
|
" Hans Vercammen <hveso3@gmail.com>
|
||||||
|
" pancake <pancake@nopcode.org>
|
||||||
|
" Sebastian Reichel <sre@ring0.de>
|
||||||
|
" Last Change: 2012-02-19
|
||||||
|
" Filenames: *.vala *.vapi
|
||||||
|
"
|
||||||
|
" REFERENCES:
|
||||||
|
" [1] http://live.gnome.org/Vala
|
||||||
|
"
|
||||||
|
" TODO: Possibly when reaching vala 1.0 release
|
||||||
|
" - validate code attributes
|
||||||
|
" - better error checking for known errors
|
||||||
|
" - full support for valadoc
|
||||||
|
"
|
||||||
|
" add vala in /usr/share/vim/vim73/scripts.vim below ruby
|
||||||
|
" to have shebang support
|
||||||
|
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:vala_cpo_save = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
" Types
|
||||||
|
syn keyword valaType bool char double float size_t ssize_t string unichar void
|
||||||
|
syn keyword valaType int int8 int16 int32 int64 long short
|
||||||
|
syn keyword valaType uint uint8 uint16 uint32 uint64 ulong ushort
|
||||||
|
" Storage keywords
|
||||||
|
syn keyword valaStorage class delegate enum errordomain interface namespace struct
|
||||||
|
" repeat / condition / label
|
||||||
|
syn keyword valaRepeat break continue do for foreach return while
|
||||||
|
syn keyword valaConditional else if switch assert
|
||||||
|
" User Labels
|
||||||
|
syn keyword valaLabel case default
|
||||||
|
|
||||||
|
" Modifiers
|
||||||
|
syn keyword valaModifier abstract const dynamic ensures extern inline internal override
|
||||||
|
syn keyword valaModifier private protected public requires signal static virtual volatile weak
|
||||||
|
syn keyword valaModifier async owned unowned
|
||||||
|
" Constants
|
||||||
|
syn keyword valaConstant false null true
|
||||||
|
" Exceptions
|
||||||
|
syn keyword valaException try catch finally throw
|
||||||
|
" Unspecified Statements
|
||||||
|
syn keyword valaUnspecifiedStatement as base construct delete get in is lock new out params ref sizeof set this throws typeof using value var yield
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
syn cluster valaCommentGroup contains=valaTodo
|
||||||
|
syn keyword valaTodo contained TODO FIXME XXX NOTE
|
||||||
|
|
||||||
|
" valadoc Comments (ported from javadoc comments in java.vim)
|
||||||
|
" TODO: need to verify valadoc syntax
|
||||||
|
if !exists("vala_ignore_valadoc")
|
||||||
|
syn cluster valaDocCommentGroup contains=valaDocTags,valaDocSeeTag
|
||||||
|
syn region valaDocTags contained start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}"
|
||||||
|
syn match valaDocTags contained "@\(param\|exception\|throws\|since\)\s\+\S\+" contains=valaDocParam
|
||||||
|
syn match valaDocParam contained "\s\S\+"
|
||||||
|
syn match valaDocTags contained "@\(author\|brief\|version\|return\|deprecated\)\>"
|
||||||
|
syn region valaDocSeeTag contained matchgroup=valaDocTags start="@see\s\+" matchgroup=NONE end="\_."re=e-1 contains=valaDocSeeTagParam
|
||||||
|
syn match valaDocSeeTagParam contained @"\_[^"]\+"\|<a\s\+\_.\{-}</a>\|\(\k\|\.\)*\(#\k\+\((\_[^)]\+)\)\=\)\=@ extend
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Comment Strings (ported from c.vim)
|
||||||
|
if exists("vala_comment_strings")
|
||||||
|
syn match valaCommentSkip contained "^\s*\*\($\|\s\+\)"
|
||||||
|
syn region valaCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=valaSpecialChar,valaCommentSkip
|
||||||
|
syn region valaComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=valaSpecialChar
|
||||||
|
syn cluster valaCommentStringGroup contains=valaCommentString,valaCharacter,valaNumber
|
||||||
|
|
||||||
|
syn region valaCommentL start="//" end="$" keepend contains=@valaCommentGroup,valaComment2String,valaCharacter,valaNumber,valaSpaceError,@Spell
|
||||||
|
syn region valaComment matchgroup=valaCommentStart start="/\*" end="\*/" contains=@valaCommentGroup,@valaCommentStringGroup,valaCommentStartError,valaSpaceError,@Spell extend fold
|
||||||
|
if !exists("vala_ignore_valadoc")
|
||||||
|
syn region valaDocComment matchgroup=valaCommentStart start="/\*\*" end="\*/" keepend contains=@valaCommentGroup,@valaDocCommentGroup,@valaCommentStringGroup,valaCommentStartError,valaSpaceError,@Spell
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
syn region valaCommentL start="//" end="$" keepend contains=@valaCommentGroup,valaSpaceError,@Spell
|
||||||
|
syn region valaComment matchgroup=valaCommentStart start="/\*" end="\*/" contains=@valaCommentGroup,valaCommentStartError,valaSpaceError,@Spell
|
||||||
|
if !exists("vala_ignore_valadoc")
|
||||||
|
syn region valaDocComment matchgroup=valaCommentStart start="/\*\*" end="\*/" keepend contains=@valaCommentGroup,@valaDocCommentGroup,valaCommentStartError,valaSpaceError,@Spell
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn region valaPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1
|
||||||
|
syn match valaPreCondit display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
|
||||||
|
|
||||||
|
" Comment if 0 blocks (ported from c.vim)
|
||||||
|
if !exists("vala_no_if0")
|
||||||
|
syn region valaCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=valaCppOut2 fold
|
||||||
|
syn region valaCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=valaSpaceError,valaCppSkip
|
||||||
|
syn region valaCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=valaSpaceError,valaCppSkip
|
||||||
|
endif
|
||||||
|
|
||||||
|
" match comment errors
|
||||||
|
syntax match valaCommentError display "\*/"
|
||||||
|
syntax match valaCommentStartError display "/\*"me=e-1 contained
|
||||||
|
" match the special comment /**/
|
||||||
|
syn match valaComment "/\*\*/"
|
||||||
|
|
||||||
|
" Vala Code Attributes
|
||||||
|
syn region valaAttribute start="^\s*\[" end="\]$" contains=valaComment,valaString keepend
|
||||||
|
syn region valaAttribute start="\[CCode" end="\]" contains=valaComment,valaString
|
||||||
|
|
||||||
|
" Avoid escaped keyword matching
|
||||||
|
syn match valaUserContent display "@\I*"
|
||||||
|
|
||||||
|
" Strings and constants
|
||||||
|
syn match valaSpecialError contained "\\."
|
||||||
|
syn match valaSpecialCharError contained "[^']"
|
||||||
|
syn match valaSpecialChar contained +\\["\\'0abfnrtvx]+
|
||||||
|
syn region valaString start=+"+ end=+"+ end=+$+ contains=valaSpecialChar,valaSpecialError,valaUnicodeNumber,@Spell
|
||||||
|
syn region valaVerbatimString start=+"""+ end=+"""+ contains=@Spell
|
||||||
|
syn match valaUnicodeNumber +\\\(u\x\{4}\|U\x\{8}\)+ contained contains=valaUnicodeSpecifier
|
||||||
|
syn match valaUnicodeSpecifier +\\[uU]+ contained
|
||||||
|
syn match valaCharacter "'[^']*'" contains=valaSpecialChar,valaSpecialCharError
|
||||||
|
syn match valaCharacter "'\\''" contains=valaSpecialChar
|
||||||
|
syn match valaCharacter "'[^\\]'"
|
||||||
|
syn match valaNumber display "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
|
||||||
|
syn match valaNumber display "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
|
||||||
|
syn match valaNumber display "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
|
||||||
|
syn match valaNumber display "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
|
||||||
|
|
||||||
|
" when wanted, highlight trailing white space
|
||||||
|
if exists("vala_space_errors")
|
||||||
|
if !exists("vala_no_trail_space_error")
|
||||||
|
syn match valaSpaceError display excludenl "\s\+$"
|
||||||
|
endif
|
||||||
|
if !exists("vala_no_tab_space_error")
|
||||||
|
syn match valaSpaceError display " \+\t"me=e-1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" when wanted, set minimum lines for comment syntax syncing
|
||||||
|
if exists("vala_minlines")
|
||||||
|
let b:vala_minlines = vala_minlines
|
||||||
|
else
|
||||||
|
let b:vala_minlines = 50
|
||||||
|
endif
|
||||||
|
exec "syn sync ccomment valaComment minlines=" . b:vala_minlines
|
||||||
|
|
||||||
|
" code folding
|
||||||
|
syn region valaBlock start="{" end="}" transparent fold
|
||||||
|
|
||||||
|
" The default highlighting.
|
||||||
|
hi def link valaType Type
|
||||||
|
hi def link valaStorage StorageClass
|
||||||
|
hi def link valaRepeat Repeat
|
||||||
|
hi def link valaConditional Conditional
|
||||||
|
hi def link valaLabel Label
|
||||||
|
hi def link valaModifier StorageClass
|
||||||
|
hi def link valaConstant Constant
|
||||||
|
hi def link valaException Exception
|
||||||
|
hi def link valaUnspecifiedStatement Statement
|
||||||
|
hi def link valaUnspecifiedKeyword Keyword
|
||||||
|
hi def link valaContextualStatement Statement
|
||||||
|
|
||||||
|
hi def link valaCommentError Error
|
||||||
|
hi def link valaCommentStartError Error
|
||||||
|
hi def link valaSpecialError Error
|
||||||
|
hi def link valaSpecialCharError Error
|
||||||
|
hi def link valaSpaceError Error
|
||||||
|
|
||||||
|
hi def link valaTodo Todo
|
||||||
|
hi def link valaCommentL valaComment
|
||||||
|
hi def link valaCommentStart valaComment
|
||||||
|
hi def link valaCommentSkip valaComment
|
||||||
|
hi def link valaComment Comment
|
||||||
|
hi def link valaDocComment Comment
|
||||||
|
hi def link valaDocTags Special
|
||||||
|
hi def link valaDocParam Function
|
||||||
|
hi def link valaDocSeeTagParam Function
|
||||||
|
hi def link valaAttribute PreCondit
|
||||||
|
|
||||||
|
hi def link valaCommentString valaString
|
||||||
|
hi def link valaComment2String valaString
|
||||||
|
hi def link valaString String
|
||||||
|
hi def link valaVerbatimString String
|
||||||
|
hi def link valaCharacter Character
|
||||||
|
hi def link valaSpecialChar SpecialChar
|
||||||
|
hi def link valaNumber Number
|
||||||
|
hi def link valaUnicodeNumber SpecialChar
|
||||||
|
hi def link valaUnicodeSpecifier SpecialChar
|
||||||
|
|
||||||
|
hi def link valaPreCondit PreCondit
|
||||||
|
|
||||||
|
if !exists("vala_no_if0")
|
||||||
|
hi def link valaCppSkip valaCppOut
|
||||||
|
hi def link valaCppOut2 valaCppOut
|
||||||
|
hi def link valaCppOut Comment
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:current_syntax = "vala"
|
||||||
|
|
||||||
|
let &cpo = s:vala_cpo_save
|
||||||
|
unlet s:vala_cpo_save
|
||||||
|
|
||||||
|
" vim: ts=8
|
||||||
67
syntax/velocity.vim
Normal file
67
syntax/velocity.vim
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
" Vim syntax file
|
||||||
|
" Language: Velocity HTML template
|
||||||
|
" Maintainer: Hsiaoming Young <http://lepture.com>
|
||||||
|
" Last Change: 2012 Jan 09
|
||||||
|
|
||||||
|
" For version 5.x: Clear all syntax items
|
||||||
|
" For version 6.x: Quit when a syntax file was already loaded
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("main_syntax")
|
||||||
|
let main_syntax = 'html'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if version < 600
|
||||||
|
so <sfile>:p:h/html.vim
|
||||||
|
else
|
||||||
|
runtime! syntax/html.vim
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn keyword velocityTodo FIXME TODO contained
|
||||||
|
syn region velocitySpec start="@" end=" " oneline contained
|
||||||
|
syn region velocityComment start="#\*" end="\*#" contains=velocityTodo,velocitySpec
|
||||||
|
syn match velocityComment /##.*/ contains=velocityTodo,velocitySpec
|
||||||
|
syn region velocityString start='"' end='"' oneline display
|
||||||
|
syn region velocityString start="'" end="'" oneline display
|
||||||
|
syn match velocityNumber "[-+]\=\d\+\(\.\d*\)\=" display
|
||||||
|
syn region velocityList start='\[' end='\]' oneline contained contains=velocityString,velocityNumber
|
||||||
|
syn match velocityMath /=\|-\|+\|\/\|\*\|%/ contained
|
||||||
|
syn match velocityBlock /#[a-z]\{2,\}/ contains=velocityStatement
|
||||||
|
syn match velocityBlock /#[a-z]\{2,\}(.\+)/ contains=velocityStatement,velocityVar,velocityString,velocityNumber,velocityMath,velocityList
|
||||||
|
syn keyword velocityStatement in set if else elseif end foreach include parse macro cmsparse stop break evaluate define contained
|
||||||
|
|
||||||
|
syn match velocityVar /$!\?[a-zA-Z][a-zA-Z0-9_-]\+\(\.\?[a-zA-Z0-9]*\)\+/ contains=velocityFunction display containedin=ALL
|
||||||
|
syn match velocityVar /$!\?{[a-zA-Z][a-zA-Z0-9_-]\+}/ display containedin=ALL
|
||||||
|
syn match velocityFunction /[a-zA-Z][a-zA-Z0-9_-]\+\(\.[a-zA-Z][a-zA-Z0-9_-]\+\)\+([^)]*)/ contains=velocityString,velocityNumber,velocityList,velocityMath,velocityVar,velocityFunction display containedin=velocityBlock
|
||||||
|
|
||||||
|
" Define the default highlighting.
|
||||||
|
" For version 5.7 and earlier: only when not done already
|
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||||
|
if version >= 508 || !exists("did_velocity_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_velocity_syn_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
HiLink velocityString String
|
||||||
|
HiLink velocityNumber Number
|
||||||
|
HiLink velocityList Constant
|
||||||
|
HiLink velocityBlock PreProc
|
||||||
|
HiLink velocitySpec Special
|
||||||
|
HiLink velocityVar Identifier
|
||||||
|
HiLink velocityFunction Function
|
||||||
|
HiLink velocityStatement Statement
|
||||||
|
HiLink velocityComment Comment
|
||||||
|
HiLink velocityTodo Todo
|
||||||
|
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:current_syntax = "velocity"
|
||||||
Reference in New Issue
Block a user