First commit
This commit is contained in:
108
.vim/syntax/asm.vim
Normal file
108
.vim/syntax/asm.vim
Normal file
@@ -0,0 +1,108 @@
|
||||
" Vim syntax file
|
||||
" Language: GNU Assembler
|
||||
" Maintainer: Erik Wognsen <erik.wognsen@gmail.com>
|
||||
" Previous maintainer:
|
||||
" Kevin Dahlhausen <kdahlhaus@yahoo.com>
|
||||
" Last Change: 2010 Apr 18
|
||||
|
||||
" Thanks to Ori Avtalion for feedback on the comment markers!
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.0 and later: Quit when a syntax file was already loaded
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn case ignore
|
||||
|
||||
" storage types
|
||||
syn match asmType "\.long"
|
||||
syn match asmType "\.ascii"
|
||||
syn match asmType "\.asciz"
|
||||
syn match asmType "\.byte"
|
||||
syn match asmType "\.double"
|
||||
syn match asmType "\.float"
|
||||
syn match asmType "\.hword"
|
||||
syn match asmType "\.int"
|
||||
syn match asmType "\.octa"
|
||||
syn match asmType "\.quad"
|
||||
syn match asmType "\.short"
|
||||
syn match asmType "\.single"
|
||||
syn match asmType "\.space"
|
||||
syn match asmType "\.string"
|
||||
syn match asmType "\.word"
|
||||
|
||||
syn match asmLabel "[a-z_][a-z0-9_]*:"he=e-1
|
||||
syn match asmIdentifier "[a-z_][a-z0-9_]*"
|
||||
|
||||
" Various #'s as defined by GAS ref manual sec 3.6.2.1
|
||||
" Technically, the first decNumber def is actually octal,
|
||||
" since the value of 0-7 octal is the same as 0-7 decimal,
|
||||
" I prefer to map it as decimal:
|
||||
syn match decNumber "0\+[1-7]\=[\t\n$,; ]"
|
||||
syn match decNumber "[1-9]\d*"
|
||||
syn match octNumber "0[0-7][0-7]\+"
|
||||
syn match hexNumber "0[xX][0-9a-fA-F]\+"
|
||||
syn match binNumber "0[bB][0-1]*"
|
||||
|
||||
syn keyword asmTodo contained TODO
|
||||
|
||||
" GAS supports various comment markers as described here:
|
||||
" http://sourceware.org/binutils/docs-2.19/as/Comments.html
|
||||
" I have commented out the ARM comment marker "@" by default as I think more
|
||||
" people are using "@" with the .type directive. See
|
||||
" http://sourceware.org/binutils/docs-2.19/as/Type.html
|
||||
syn region asmComment start="/\*" end="\*/" contains=asmTodo
|
||||
syn match asmComment "[#;!|].*" contains=asmTodo
|
||||
" syn match asmComment "@.*" contains=asmTodo
|
||||
|
||||
syn match asmInclude "\.include"
|
||||
syn match asmCond "\.if"
|
||||
syn match asmCond "\.else"
|
||||
syn match asmCond "\.endif"
|
||||
syn match asmMacro "\.macro"
|
||||
syn match asmMacro "\.endm"
|
||||
|
||||
syn match asmDirective "\.[a-z][a-z]\+"
|
||||
|
||||
|
||||
syn case match
|
||||
|
||||
" 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_asm_syntax_inits")
|
||||
if version < 508
|
||||
let did_asm_syntax_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
" The default methods for highlighting. Can be overridden later
|
||||
HiLink asmSection Special
|
||||
HiLink asmLabel Label
|
||||
HiLink asmComment Comment
|
||||
HiLink asmTodo Todo
|
||||
HiLink asmDirective Statement
|
||||
|
||||
HiLink asmInclude Include
|
||||
HiLink asmCond PreCondit
|
||||
HiLink asmMacro Macro
|
||||
|
||||
HiLink hexNumber Number
|
||||
HiLink decNumber Number
|
||||
HiLink octNumber Number
|
||||
HiLink binNumber Number
|
||||
|
||||
HiLink asmIdentifier Identifier
|
||||
HiLink asmType Type
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "asm"
|
||||
|
||||
" vim: ts=8
|
||||
279
.vim/syntax/c.vim
Executable file
279
.vim/syntax/c.vim
Executable file
@@ -0,0 +1,279 @@
|
||||
" 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
|
||||
|
||||
68
.vim/syntax/cpp.vim
Executable file
68
.vim/syntax/cpp.vim
Executable file
@@ -0,0 +1,68 @@
|
||||
" Vim syntax file
|
||||
" Language: C++ special highlighting for STL classes and methods
|
||||
" Maintainer: Nathan Skvirsky
|
||||
" Last Change: 2006 Oct 22
|
||||
|
||||
" 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
|
||||
|
||||
" Read the C syntax to start with
|
||||
if version < 600
|
||||
so <sfile>:p:h/c.vim
|
||||
else
|
||||
runtime! syntax/c.vim
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
|
||||
" C++ extentions
|
||||
|
||||
syn keyword cppSTL abort abs accumulate acos adjacent_difference adjacent_find adjacent_find_if any append asctime asin assert assign at atan atan2 atexit atof atoi atol auto_ptr back back_inserter bad bad_alloc bad_cast bad_exception bad_typeid badbit beg begin binary_compose binary_negate binary_search bind2nd binder1st binder2nd bitset bsearch c_str calloc capacity ceil cerr cin clear clearerr clock clog close compare compose1 compose2 const_iterator construct copy copy_backward copy_n cos cosh count count_if cout ctime data deque destroy difference_type difftime div divides domain_error empty end endl eof eofbit equal equal_range erase exception exit exp fabs fail failbit failure fclose feof ferror fflush fgetc fgetpos fgets fill fill_n find find_end find_first_not_of find_first_of find_if find_last_not_of find_last_of first flags flip floor flush fmod fopen for_each fprintf fputc fputs fread free freopen frexp front fscanf fseek fsetpos fstream ftell fwrite gcount generate generate_n get get_temporary_buffer getc getchar getenv getline gets gmtime good goodbit greater greater_equal hash_map hash_multimap hash_multiset hash_set ifstream ignore in includes inner_product inplace_merge insert inserter invalid_argument ios ios_base iostate iota is_heap is_open is_sorted isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace istream istream_iterator istringstream isupper isxdigit iter_swap iterator iterator_category key_comp ldiv length length_error less less_equal lexicographical_compare lexicographical_compare_3way list localtime log log10 logic_error logical_and logical_not logical_or longjmp lower_bound make_heap malloc map max max_element max_size mem_fun mem_fun1 mem_fun1_ref mem_fun_ref memchr memcpy memmove memset merge min min_element minus mismatch mktime modf modulus multimap multiplies multiset negate next_permutation npos nth_element numeric_limits ofstream open ostream ostream_iterator ostringstream out_of_range overflow_error pair partial_sort partial_sort_copy partial_sum partition peek perror plus pointer pointer_to_binary_function pointer_to_unary_function pop pop_back pop_front pop_heap pow power precision prev_permutation printf ptr_fun push push_back push_front push_heap put putback putc putchar puts qsort raise rand random_sample random_sample_n random_shuffle range_error rbegin rdbuf rdstate read realloc reference remove remove_copy remove_copy_if remove_if rename rend replace replace_copy replace_copy_if replace_if reserve reset resize return_temporary_buffer reverse reverse_copy reverse_iterator rewind rfind rotate rotate_copy runtime_error scanf search search_n second seekg seekp set set_difference set_intersection set_symmetric_difference set_union setbuf setf setjmp setlocale setvbuf signal sin sinh size size_t size_type sort sort_heap splice sprintf sqrt srand sscanf stable_partition stable_sort std str strcat strchr strcmp strcoll strcpy strcspn strerror strftime string strlen strncat strncmp strncpy strpbrk strrchr strspn strstr strtod strtok strtol strtoul strxfrm substr swap swap_ranges sync_with_stdio system tan tanh tellg tellp temporary_buffer test time time_t tmpfile tmpnam to_string to_ulong tolower top toupper transform unary_compose unary_negate underflow_error unget ungetc uninitialized_copy uninitialized_copy_n uninitialized_fill uninitialized_fill_n unique unique_copy unsetf upper_bound va_arg value_comp value_type vector vfprintf vprintf vsprintf width write
|
||||
|
||||
syn keyword cppStatement new delete this friend using
|
||||
syn keyword cppAccess public protected private
|
||||
syn keyword cppType inline virtual explicit export bool wchar_t
|
||||
syn keyword cppExceptions throw try catch
|
||||
syn keyword cppOperator operator typeid
|
||||
syn keyword cppOperator and bitor or xor compl bitand and_eq or_eq xor_eq not not_eq
|
||||
syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*<"me=e-1
|
||||
syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*$"
|
||||
syn keyword cppStorageClass mutable
|
||||
syn keyword cppStructure class typename template namespace
|
||||
syn keyword cppNumber NPOS
|
||||
syn keyword cppBoolean true false
|
||||
|
||||
" The minimum and maximum operators in GNU C++
|
||||
syn match cppMinMax "[<>]?"
|
||||
|
||||
" Default highlighting
|
||||
if version >= 508 || !exists("did_cpp_syntax_inits")
|
||||
if version < 508
|
||||
let did_cpp_syntax_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
HiLink cppAccess cppStatement
|
||||
HiLink cppCast cppStatement
|
||||
HiLink cppExceptions Exception
|
||||
HiLink cppOperator Operator
|
||||
HiLink cppStatement Statement
|
||||
HiLink cppSTL Identifier
|
||||
HiLink cppNCBI Special
|
||||
HiLink cppType Type
|
||||
HiLink cppStorageClass StorageClass
|
||||
HiLink cppStructure Structure
|
||||
HiLink cppNumber Number
|
||||
HiLink cppBoolean Boolean
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "cpp"
|
||||
|
||||
" vim: ts=8
|
||||
|
||||
45
.vim/syntax/cvsannotate.vim
Normal file
45
.vim/syntax/cvsannotate.vim
Normal file
@@ -0,0 +1,45 @@
|
||||
" Vim syntax file
|
||||
" Language: CVS annotate output
|
||||
" Maintainer: Bob Hiestand <bob.hiestand@gmail.com>
|
||||
" Remark: Used by the cvscommand plugin. Originally written by Mathieu
|
||||
" Clabaut
|
||||
" License:
|
||||
" Copyright (c) Bob Hiestand
|
||||
"
|
||||
" 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.
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn match cvsDate /\d\d-...-\d\d/ contained
|
||||
syn match cvsName /(\S* /hs=s+1,he=e-1 contained nextgroup=cvsDate
|
||||
syn match cvsVer /^\d\+\(\.\d\+\)\+/ contained nextgroup=cvsName
|
||||
syn region cvsHead start="^\d\+\.\d\+" end="):" contains=cvsVer,cvsName,cvsDate
|
||||
|
||||
if !exists("did_cvsannotate_syntax_inits")
|
||||
let did_cvsannotate_syntax_inits = 1
|
||||
hi link cvsDate Comment
|
||||
hi link cvsName Type
|
||||
hi link cvsVer Statement
|
||||
endif
|
||||
|
||||
let b:current_syntax="CVSAnnotate"
|
||||
44
.vim/syntax/gitannotate.vim
Normal file
44
.vim/syntax/gitannotate.vim
Normal file
@@ -0,0 +1,44 @@
|
||||
" Vim syntax file
|
||||
" Language: git annotate output
|
||||
" Maintainer: Bob Hiestand <bob.hiestand@gmail.com>
|
||||
" Remark: Used by the vcscommand plugin.
|
||||
" License:
|
||||
" Copyright (c) Bob Hiestand
|
||||
"
|
||||
" 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.
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn region gitName start="(\@<=" end="\( \d\d\d\d-\)\@=" contained
|
||||
syn match gitCommit /^\^\?\x\+/ contained
|
||||
syn match gitDate /\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d [+-]\d\d\d\d/ contained
|
||||
syn match gitLineNumber /\d\+)\@=/ contained
|
||||
syn region gitAnnotation start="^" end=") " oneline keepend contains=gitCommit,gitLineNumber,gitDate,gitName
|
||||
|
||||
if !exists("did_gitannotate_syntax_inits")
|
||||
let did_gitannotate_syntax_inits = 1
|
||||
hi link gitName Type
|
||||
hi link gitCommit Statement
|
||||
hi link gitDate Comment
|
||||
hi link gitLineNumber Label
|
||||
endif
|
||||
|
||||
let b:current_syntax="gitAnnotate"
|
||||
40
.vim/syntax/hgannotate.vim
Normal file
40
.vim/syntax/hgannotate.vim
Normal file
@@ -0,0 +1,40 @@
|
||||
" Vim syntax file
|
||||
" Language: HG annotate output
|
||||
" Maintainer: Bob Hiestand <bob.hiestand@gmail.com>
|
||||
" Remark: Used by the vcscommand plugin.
|
||||
" License:
|
||||
" Copyright (c) Bob Hiestand
|
||||
"
|
||||
" 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.
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn match hgVer /\d\+/ contained
|
||||
syn match hgName /^\s*\S\+/ contained
|
||||
syn match hgHead /^\s*\S\+\s\+\d\+:/ contains=hgVer,hgName
|
||||
|
||||
if !exists("did_hgannotate_syntax_inits")
|
||||
let did_hgannotate_syntax_inits = 1
|
||||
hi link hgName Type
|
||||
hi link hgVer Statement
|
||||
endif
|
||||
|
||||
let b:current_syntax="hgAnnotate"
|
||||
880
.vim/syntax/html.vim
Normal file
880
.vim/syntax/html.vim
Normal file
@@ -0,0 +1,880 @@
|
||||
" syntax file
|
||||
" Language: HTML
|
||||
" " Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
||||
" " URL: http://www.fleiner.com/vim/syntax/html.vim
|
||||
" " Last Change: 2006 Jun 19
|
||||
"
|
||||
" " Please check :help html.vim for some comments and a description of the
|
||||
" options
|
||||
"
|
||||
" " For version 5.x: Clear all syntax items
|
||||
" " For version 6.x: Quit when a syntax file was already loaded
|
||||
" if !exists("main_syntax")
|
||||
" if version < 600
|
||||
" syntax clear
|
||||
" elseif exists("b:current_syntax")
|
||||
" finish
|
||||
" endif
|
||||
" let main_syntax = 'html'
|
||||
" endif
|
||||
"
|
||||
" " don't use standard HiLink, it will not work with included
|
||||
" syntax files
|
||||
" if version < 508
|
||||
" command! -nargs=+ HtmlHiLink hi link <args>
|
||||
" else
|
||||
" command! -nargs=+ HtmlHiLink hi def link <args>
|
||||
" endif
|
||||
"
|
||||
" syntax spell toplevel
|
||||
"
|
||||
" syn case ignore
|
||||
"
|
||||
" " mark illegal characters
|
||||
" syn match htmlError "[<>&]"
|
||||
"
|
||||
"
|
||||
" " tags
|
||||
" syn region htmlString contained start=+"+ end=+"+
|
||||
" contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
|
||||
" syn region htmlString contained start=+'+ end=+'+
|
||||
" contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
|
||||
" syn match htmlValue contained "=[\t ]*[^'" \t>][^
|
||||
" \t>]*"hs=s+1
|
||||
" contains=javaScriptExpression,@htmlPreproc
|
||||
" syn region htmlEndTag start=+</+
|
||||
" end=+>+ contains=htmlTagN,htmlTagError
|
||||
" syn region htmlTag start=+<[^/]+
|
||||
" end=+>+
|
||||
" contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster
|
||||
" syn match htmlTagN contained
|
||||
" +<\s*[-a-zA-Z0-9]\++hs=s+1
|
||||
" contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
|
||||
" syn match htmlTagN contained
|
||||
" +</\s*[-a-zA-Z0-9]\++hs=s+2
|
||||
" contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
|
||||
" syn match htmlTagError contained "[^>]<"ms=s+1
|
||||
"
|
||||
"
|
||||
" " tag names
|
||||
" syn keyword htmlTagName contained address applet area a
|
||||
" base basefont
|
||||
" syn keyword htmlTagName contained big blockquote br
|
||||
" caption center
|
||||
" syn keyword htmlTagName contained cite code dd dfn dir
|
||||
" div dl dt font
|
||||
" syn keyword htmlTagName contained form hr html img
|
||||
" syn keyword htmlTagName contained input isindex kbd li
|
||||
" link map menu
|
||||
" syn keyword htmlTagName contained meta ol option param
|
||||
" pre p samp span
|
||||
" syn keyword htmlTagName contained select small strike
|
||||
" sub sup
|
||||
" syn keyword htmlTagName contained table td textarea th
|
||||
" tr tt ul var xmp
|
||||
" syn match htmlTagName contained
|
||||
" "\<\(b\|i\|u\|h[1-6]\|em\|strong\|head\|body\|title\)\>"
|
||||
"
|
||||
" " new html 4.0 tags
|
||||
" syn keyword htmlTagName contained abbr acronym bdo
|
||||
" button col label
|
||||
" syn keyword htmlTagName contained colgroup del fieldset
|
||||
" iframe ins legend
|
||||
" syn keyword htmlTagName contained object optgroup q s
|
||||
" tbody tfoot thead
|
||||
"
|
||||
" " legal arg names
|
||||
" syn keyword htmlArg contained action
|
||||
" syn keyword htmlArg contained align alink alt archive
|
||||
" background bgcolor
|
||||
" syn keyword htmlArg contained border bordercolor
|
||||
" cellpadding
|
||||
" syn keyword htmlArg contained cellspacing checked class
|
||||
" clear code codebase color
|
||||
" syn keyword htmlArg contained cols colspan content
|
||||
" coords enctype face
|
||||
" syn keyword htmlArg contained gutter height hspace id
|
||||
" syn keyword htmlArg contained link lowsrc marginheight
|
||||
" syn keyword htmlArg contained marginwidth maxlength
|
||||
" method name prompt
|
||||
" syn keyword htmlArg contained rel rev rows rowspan
|
||||
" scrolling selected shape
|
||||
" syn keyword htmlArg contained size src start target text
|
||||
" type url
|
||||
" syn keyword htmlArg contained usemap ismap valign value
|
||||
" vlink vspace width wrap
|
||||
" syn match htmlArg contained
|
||||
" "\<\(http-equiv\|href\|title\)="me=e-1
|
||||
"
|
||||
" " Netscape extensions
|
||||
" syn keyword htmlTagName contained frame noframes
|
||||
" frameset nobr blink
|
||||
" syn keyword htmlTagName contained layer ilayer nolayer
|
||||
" spacer
|
||||
" syn keyword htmlArg contained frameborder noresize
|
||||
" pagex pagey above below
|
||||
" syn keyword htmlArg contained left top visibility
|
||||
" clip id noshade
|
||||
" syn match htmlArg contained "\<z-index\>"
|
||||
"
|
||||
" " Microsoft extensions
|
||||
" syn keyword htmlTagName contained marquee
|
||||
"
|
||||
" " html 4.0 arg names
|
||||
" syn match htmlArg contained
|
||||
" "\<\(accept-charset\|label\)\>"
|
||||
" syn keyword htmlArg contained abbr accept accesskey axis
|
||||
" char charoff charset
|
||||
" syn keyword htmlArg contained cite classid codetype
|
||||
" compact data datetime
|
||||
" syn keyword htmlArg contained declare defer dir disabled
|
||||
" for frame
|
||||
" syn keyword htmlArg contained headers hreflang lang
|
||||
" language longdesc
|
||||
" syn keyword htmlArg contained multiple nohref nowrap
|
||||
" object profile readonly
|
||||
" syn keyword htmlArg contained rules scheme scope span
|
||||
" standby style
|
||||
" syn keyword htmlArg contained summary tabindex valuetype
|
||||
" version
|
||||
"
|
||||
" " special characters
|
||||
" syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
|
||||
"
|
||||
" " Comments (the real ones or the old netscape ones)
|
||||
" if exists("html_wrong_comments")
|
||||
" syn region htmlComment start=+<!--+
|
||||
" end=+--\s*>+
|
||||
" else
|
||||
" syn region htmlComment start=+<!+
|
||||
" end=+>+ contains=htmlCommentPart,htmlCommentError
|
||||
" syn match htmlCommentError contained "[^><!]"
|
||||
" syn region htmlCommentPart contained start=+--+
|
||||
" end=+--\s*+ contains=@htmlPreProc
|
||||
" endif
|
||||
" syn region htmlComment
|
||||
" start=+<!DOCTYPE+ keepend end=+>+
|
||||
"
|
||||
" " server-parsed commands
|
||||
" syn region htmlPreProc start=+<!--#+ end=+-->+
|
||||
" contains=htmlPreStmt,htmlPreError,htmlPreAttr
|
||||
" syn match htmlPreStmt contained
|
||||
" "<!--#\(config\|echo\|exec\|fsize\|flastmod\|include\|printenv\|set\|if\|elif\|else\|endif\|geoguide\)\>"
|
||||
" syn match htmlPreError contained
|
||||
" "<!--#\S*"ms=s+4
|
||||
" syn match htmlPreAttr contained
|
||||
" "\w\+=[^"]\S\+"
|
||||
" contains=htmlPreProcAttrError,htmlPreProcAttrName
|
||||
" syn region htmlPreAttr contained
|
||||
" start=+\w\+="+ skip=+\\\\\|\\"+ end=+"+
|
||||
" contains=htmlPreProcAttrName keepend
|
||||
" syn match htmlPreProcAttrError contained
|
||||
" "\w\+="he=e-1
|
||||
" syn match htmlPreProcAttrName contained
|
||||
" "\(expr\|errmsg\|sizefmt\|timefmt\|var\|cgi\|cmd\|file\|virtual\|value\)="he=e-1
|
||||
"
|
||||
" if !exists("html_no_rendering")
|
||||
" " rendering
|
||||
" syn cluster htmlTop
|
||||
" contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc
|
||||
"
|
||||
" syn region htmlBold start="<b\>"
|
||||
" end="</b>"me=e-4
|
||||
" contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
|
||||
" syn region htmlBold
|
||||
" start="<strong\>"
|
||||
" end="</strong>"me=e-9
|
||||
" contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
|
||||
" syn region htmlBoldUnderline
|
||||
" contained start="<u\>"
|
||||
" end="</u>"me=e-4
|
||||
" contains=@htmlTop,htmlBoldUnderlineItalic
|
||||
" syn region htmlBoldItalic
|
||||
" contained start="<i\>"
|
||||
" end="</i>"me=e-4
|
||||
" contains=@htmlTop,htmlBoldItalicUnderline
|
||||
" syn region htmlBoldItalic
|
||||
" contained start="<em\>"
|
||||
" end="</em>"me=e-5
|
||||
" contains=@htmlTop,htmlBoldItalicUnderline
|
||||
" syn region
|
||||
" htmlBoldUnderlineItalic
|
||||
" contained start="<i\>"
|
||||
" end="</i>"me=e-4
|
||||
" contains=@htmlTop
|
||||
" syn region
|
||||
" htmlBoldUnderlineItalic
|
||||
" contained start="<em\>"
|
||||
" end="</em>"me=e-5
|
||||
" contains=@htmlTop
|
||||
" syn region
|
||||
" htmlBoldItalicUnderline
|
||||
" contained start="<u\>"
|
||||
" end="</u>"me=e-4
|
||||
" contains=@htmlTop,htmlBoldUnderlineItalic
|
||||
"
|
||||
" syn region
|
||||
" htmlUnderline
|
||||
" start="<u\>"
|
||||
" end="</u>"me=e-4
|
||||
" contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic
|
||||
" syn region
|
||||
" htmlUnderlineBold
|
||||
" contained
|
||||
" start="<b\>"
|
||||
" end="</b>"me=e-4
|
||||
" contains=@htmlTop,htmlUnderlineBoldItalic
|
||||
" syn region
|
||||
" htmlUnderlineBold
|
||||
" contained
|
||||
" start="<strong\>"
|
||||
" end="</strong>"me=e-9
|
||||
" contains=@htmlTop,htmlUnderlineBoldItalic
|
||||
" syn region
|
||||
" htmlUnderlineItalic
|
||||
" contained
|
||||
" start="<i\>"
|
||||
" end="</i>"me=e-4
|
||||
" contains=@htmlTop,htmlUnderlineItalicBold
|
||||
" syn region
|
||||
" htmlUnderlineItalic
|
||||
" contained
|
||||
" start="<em\>"
|
||||
" end="</em>"me=e-5
|
||||
" contains=@htmlTop,htmlUnderlineItalicBold
|
||||
" syn region
|
||||
" htmlUnderlineItalicBold
|
||||
" contained
|
||||
" start="<b\>"
|
||||
" end="</b>"me=e-4
|
||||
" contains=@htmlTop
|
||||
" syn region
|
||||
" htmlUnderlineItalicBold
|
||||
" contained
|
||||
" start="<strong\>"
|
||||
" end="</strong>"me=e-9
|
||||
" contains=@htmlTop
|
||||
" syn
|
||||
" region
|
||||
" htmlUnderlineBoldItalic
|
||||
" contained
|
||||
" start="<i\>"
|
||||
" end="</i>"me=e-4
|
||||
" contains=@htmlTop
|
||||
" syn
|
||||
" region
|
||||
" htmlUnderlineBoldItalic
|
||||
" contained
|
||||
" start="<em\>"
|
||||
" end="</em>"me=e-5
|
||||
" contains=@htmlTop
|
||||
"
|
||||
" syn
|
||||
" region
|
||||
" htmlItalic
|
||||
" start="<i\>"
|
||||
" end="</i>"me=e-4
|
||||
" contains=@htmlTop,htmlItalicBold,htmlItalicUnderline
|
||||
" syn
|
||||
" region
|
||||
" htmlItalic
|
||||
" start="<em\>"
|
||||
" end="</em>"me=e-5
|
||||
" contains=@htmlTop
|
||||
" syn
|
||||
" region
|
||||
" htmlItalicBold
|
||||
" contained
|
||||
" start="<b\>"
|
||||
" end="</b>"me=e-4
|
||||
" contains=@htmlTop,htmlItalicBoldUnderline
|
||||
" syn
|
||||
" region
|
||||
" htmlItalicBold
|
||||
" contained
|
||||
" start="<strong\>"
|
||||
" end="</strong>"me=e-9
|
||||
" contains=@htmlTop,htmlItalicBoldUnderline
|
||||
" syn
|
||||
" region
|
||||
" htmlItalicBoldUnderline
|
||||
" contained
|
||||
" start="<u\>"
|
||||
" end="</u>"me=e-4
|
||||
" contains=@htmlTop
|
||||
" syn
|
||||
" region
|
||||
" htmlItalicUnderline
|
||||
" contained
|
||||
" start="<u\>"
|
||||
" end="</u>"me=e-4
|
||||
" contains=@htmlTop,htmlItalicUnderlineBold
|
||||
" syn
|
||||
" region
|
||||
" htmlItalicUnderlineBold
|
||||
" contained
|
||||
" start="<b\>"
|
||||
" end="</b>"me=e-4
|
||||
" contains=@htmlTop
|
||||
" syn
|
||||
" region
|
||||
" htmlItalicUnderlineBold
|
||||
" contained
|
||||
" start="<strong\>"
|
||||
" end="</strong>"me=e-9
|
||||
" contains=@htmlTop
|
||||
"
|
||||
" syn
|
||||
" region
|
||||
" htmlLink
|
||||
" start="<a\>\_[^>]*\<href\>"
|
||||
" end="</a>"me=e-4
|
||||
" contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
|
||||
" syn
|
||||
" region
|
||||
" htmlH1
|
||||
" start="<h1\>"
|
||||
" end="</h1>"me=e-5
|
||||
" contains=@htmlTop
|
||||
" syn
|
||||
" region
|
||||
" htmlH2
|
||||
" start="<h2\>"
|
||||
" end="</h2>"me=e-5
|
||||
" contains=@htmlTop
|
||||
" syn
|
||||
" region
|
||||
" htmlH3
|
||||
" start="<h3\>"
|
||||
" end="</h3>"me=e-5
|
||||
" contains=@htmlTop
|
||||
" syn
|
||||
" region
|
||||
" htmlH4
|
||||
" start="<h4\>"
|
||||
" end="</h4>"me=e-5
|
||||
" contains=@htmlTop
|
||||
" syn
|
||||
" region
|
||||
" htmlH5
|
||||
" start="<h5\>"
|
||||
" end="</h5>"me=e-5
|
||||
" contains=@htmlTop
|
||||
" syn
|
||||
" region
|
||||
" htmlH6
|
||||
" start="<h6\>"
|
||||
" end="</h6>"me=e-5
|
||||
" contains=@htmlTop
|
||||
" syn
|
||||
" region
|
||||
" htmlHead
|
||||
" start="<head\>"
|
||||
" end="</head>"me=e-7
|
||||
" end="<body\>"me=e-5
|
||||
" end="<h[1-6]\>"me=e-3
|
||||
" contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,javaScript,cssStyle,@htmlPreproc
|
||||
" syn
|
||||
" region
|
||||
" htmlTitle
|
||||
" start="<title\>"
|
||||
" end="</title>"me=e-8
|
||||
" contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
|
||||
" endif
|
||||
"
|
||||
" syn
|
||||
" keyword
|
||||
" htmlTagName
|
||||
" contained
|
||||
" noscript
|
||||
" syn
|
||||
" keyword
|
||||
" htmlSpecialTagName
|
||||
" contained
|
||||
" script
|
||||
" style
|
||||
" if
|
||||
" main_syntax
|
||||
" !=
|
||||
" 'java'
|
||||
" ||
|
||||
" exists("java_javascript")
|
||||
" "
|
||||
" JAVA
|
||||
" SCRIPT
|
||||
" syn
|
||||
" include
|
||||
" @htmlJavaScript
|
||||
" syntax/javascript.vim
|
||||
" unlet
|
||||
" b:current_syntax
|
||||
" syn
|
||||
" region
|
||||
" javaScript
|
||||
" start=+<script[^>]*>+
|
||||
" keepend
|
||||
" end=+</script>+me=s-1
|
||||
" contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
|
||||
" syn
|
||||
" region
|
||||
" htmlScriptTag
|
||||
" contained
|
||||
" start=+<script+
|
||||
" end=+>+
|
||||
" contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
|
||||
" HtmlHiLink
|
||||
" htmlScriptTag
|
||||
" htmlTag
|
||||
"
|
||||
" "
|
||||
" html
|
||||
" events
|
||||
" (i.e.
|
||||
" arguments
|
||||
" that
|
||||
" include
|
||||
" javascript
|
||||
" commands)
|
||||
" if
|
||||
" exists("html_extended_events")
|
||||
" syn
|
||||
" region
|
||||
" htmlEvent
|
||||
" contained
|
||||
" start=+\<on\a\+\s*=[\t
|
||||
" ]*'+
|
||||
" end=+'+
|
||||
" contains=htmlEventSQ
|
||||
" syn
|
||||
" region
|
||||
" htmlEvent
|
||||
" contained
|
||||
" start=+\<on\a\+\s*=[\t
|
||||
" ]*"+
|
||||
" end=+"+
|
||||
" contains=htmlEventDQ
|
||||
" else
|
||||
" syn
|
||||
" region
|
||||
" htmlEvent
|
||||
" contained
|
||||
" start=+\<on\a\+\s*=[\t
|
||||
" ]*'+
|
||||
" end=+'+
|
||||
" keepend
|
||||
" contains=htmlEventSQ
|
||||
" syn
|
||||
" region
|
||||
" htmlEvent
|
||||
" contained
|
||||
" start=+\<on\a\+\s*=[\t
|
||||
" ]*"+
|
||||
" end=+"+
|
||||
" keepend
|
||||
" contains=htmlEventDQ
|
||||
" endif
|
||||
" syn
|
||||
" region
|
||||
" htmlEventSQ
|
||||
" contained
|
||||
" start=+'+ms=s+1
|
||||
" end=+'+me=s-1
|
||||
" contains=@htmlJavaScript
|
||||
" syn
|
||||
" region
|
||||
" htmlEventDQ
|
||||
" contained
|
||||
" start=+"+ms=s+1
|
||||
" end=+"+me=s-1
|
||||
" contains=@htmlJavaScript
|
||||
" HtmlHiLink
|
||||
" htmlEventSQ
|
||||
" htmlEvent
|
||||
" HtmlHiLink
|
||||
" htmlEventDQ
|
||||
" htmlEvent
|
||||
"
|
||||
" "
|
||||
" a
|
||||
" javascript
|
||||
" expression
|
||||
" is
|
||||
" used
|
||||
" as
|
||||
" an
|
||||
" arg
|
||||
" value
|
||||
" syn
|
||||
" region
|
||||
" javaScriptExpression
|
||||
" contained
|
||||
" start=+&{+
|
||||
" keepend
|
||||
" end=+};+
|
||||
" contains=@htmlJavaScript,@htmlPreproc
|
||||
" endif
|
||||
"
|
||||
" if
|
||||
" main_syntax
|
||||
" !=
|
||||
" 'java'
|
||||
" ||
|
||||
" exists("java_vb")
|
||||
" "
|
||||
" VB
|
||||
" SCRIPT
|
||||
" syn
|
||||
" include
|
||||
" @htmlVbScript
|
||||
" syntax/vb.vim
|
||||
" unlet
|
||||
" b:current_syntax
|
||||
" syn
|
||||
" region
|
||||
" javaScript
|
||||
" start=+<script
|
||||
" [^>]*language
|
||||
" *=[^>]*vbscript[^>]*>+
|
||||
" keepend
|
||||
" end=+</script>+me=s-1
|
||||
" contains=@htmlVbScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
|
||||
" endif
|
||||
"
|
||||
" syn
|
||||
" cluster
|
||||
" htmlJavaScript
|
||||
" add=@htmlPreproc
|
||||
"
|
||||
" if
|
||||
" main_syntax
|
||||
" !=
|
||||
" 'java'
|
||||
" ||
|
||||
" exists("java_css")
|
||||
" "
|
||||
" embedded
|
||||
" style
|
||||
" sheets
|
||||
" syn
|
||||
" keyword
|
||||
" htmlArg
|
||||
" contained
|
||||
" media
|
||||
" syn
|
||||
" include
|
||||
" @htmlCss
|
||||
" syntax/css.vim
|
||||
" unlet
|
||||
" b:current_syntax
|
||||
" syn
|
||||
" region
|
||||
" cssStyle
|
||||
" start=+<style+
|
||||
" keepend
|
||||
" end=+</style>+
|
||||
" contains=@htmlCss,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc
|
||||
" syn
|
||||
" match
|
||||
" htmlCssStyleComment
|
||||
" contained
|
||||
" "\(<!--\|-->\)"
|
||||
" syn
|
||||
" region
|
||||
" htmlCssDefinition
|
||||
" matchgroup=htmlArg
|
||||
" start='style="'
|
||||
" keepend
|
||||
" matchgroup=htmlString
|
||||
" end='"'
|
||||
" contains=css.*Attr,css.*Prop,cssComment,cssLength,cssColor,cssURL,cssImportant,cssError,cssString,@htmlPreproc
|
||||
" HtmlHiLink
|
||||
" htmlStyleArg
|
||||
" htmlString
|
||||
" endif
|
||||
"
|
||||
" if
|
||||
" main_syntax
|
||||
" ==
|
||||
" "html"
|
||||
" "
|
||||
" synchronizing
|
||||
" (does
|
||||
" not
|
||||
" always
|
||||
" work
|
||||
" if
|
||||
" a
|
||||
" comment
|
||||
" includes
|
||||
" legal
|
||||
" "
|
||||
" html
|
||||
" tags,
|
||||
" but
|
||||
" doing
|
||||
" it
|
||||
" right
|
||||
" would
|
||||
" mean
|
||||
" to
|
||||
" always
|
||||
" start
|
||||
" "
|
||||
" at
|
||||
" the
|
||||
" first
|
||||
" line,
|
||||
" which
|
||||
" is
|
||||
" too
|
||||
" slow)
|
||||
" syn
|
||||
" sync
|
||||
" match
|
||||
" htmlHighlight
|
||||
" groupthere
|
||||
" NONE
|
||||
" "<[/a-zA-Z]"
|
||||
" syn
|
||||
" sync
|
||||
" match
|
||||
" htmlHighlight
|
||||
" groupthere
|
||||
" javaScript
|
||||
" "<script"
|
||||
" syn
|
||||
" sync
|
||||
" match
|
||||
" htmlHighlightSkip
|
||||
" "^.*['\"].*$"
|
||||
" syn
|
||||
" sync
|
||||
" minlines=10
|
||||
" endif
|
||||
"
|
||||
" "
|
||||
" The
|
||||
" default
|
||||
" highlighting.
|
||||
" if
|
||||
" version
|
||||
" >=
|
||||
" 508
|
||||
" ||
|
||||
" !exists("did_html_syn_inits")
|
||||
" if
|
||||
" version
|
||||
" <
|
||||
" 508
|
||||
" let
|
||||
" did_html_syn_inits
|
||||
" =
|
||||
" 1
|
||||
" endif
|
||||
" HtmlHiLink
|
||||
" htmlTag
|
||||
" Function
|
||||
" HtmlHiLink
|
||||
" htmlEndTag
|
||||
" Identifier
|
||||
" HtmlHiLink
|
||||
" htmlArg
|
||||
" Type
|
||||
" HtmlHiLink
|
||||
" htmlTagName
|
||||
" htmlStatement
|
||||
" HtmlHiLink
|
||||
" htmlSpecialTagName
|
||||
" Exception
|
||||
" HtmlHiLink
|
||||
" htmlValue
|
||||
" String
|
||||
" HtmlHiLink
|
||||
" htmlSpecialChar
|
||||
" Special
|
||||
"
|
||||
" if
|
||||
" !exists("html_no_rendering")
|
||||
" HtmlHiLink
|
||||
" htmlH1
|
||||
" Title
|
||||
" HtmlHiLink
|
||||
" htmlH2
|
||||
" htmlH1
|
||||
" HtmlHiLink
|
||||
" htmlH3
|
||||
" htmlH2
|
||||
" HtmlHiLink
|
||||
" htmlH4
|
||||
" htmlH3
|
||||
" HtmlHiLink
|
||||
" htmlH5
|
||||
" htmlH4
|
||||
" HtmlHiLink
|
||||
" htmlH6
|
||||
" htmlH5
|
||||
" HtmlHiLink
|
||||
" htmlHead
|
||||
" PreProc
|
||||
" HtmlHiLink
|
||||
" htmlTitle
|
||||
" Title
|
||||
" HtmlHiLink
|
||||
" htmlBoldItalicUnderline
|
||||
" htmlBoldUnderlineItalic
|
||||
" HtmlHiLink
|
||||
" htmlUnderlineBold
|
||||
" htmlBoldUnderline
|
||||
" HtmlHiLink
|
||||
" htmlUnderlineItalicBold
|
||||
" htmlBoldUnderlineItalic
|
||||
" HtmlHiLink
|
||||
" htmlUnderlineBoldItalic
|
||||
" htmlBoldUnderlineItalic
|
||||
" HtmlHiLink
|
||||
" htmlItalicUnderline
|
||||
" htmlUnderlineItalic
|
||||
" HtmlHiLink
|
||||
" htmlItalicBold
|
||||
" htmlBoldItalic
|
||||
" HtmlHiLink
|
||||
" htmlItalicBoldUnderline
|
||||
" htmlBoldUnderlineItalic
|
||||
" HtmlHiLink
|
||||
" htmlItalicUnderlineBold
|
||||
" htmlBoldUnderlineItalic
|
||||
" HtmlHiLink
|
||||
" htmlLink
|
||||
" Underlined
|
||||
" if
|
||||
" !exists("html_my_rendering")
|
||||
" hi
|
||||
" def
|
||||
" htmlBold
|
||||
" term=bold
|
||||
" cterm=bold
|
||||
" gui=bold
|
||||
" hi
|
||||
" def
|
||||
" htmlBoldUnderline
|
||||
" term=bold,underline
|
||||
" cterm=bold,underline
|
||||
" gui=bold,underline
|
||||
" hi
|
||||
" def
|
||||
" htmlBoldItalic
|
||||
" term=bold,italic
|
||||
" cterm=bold,italic
|
||||
" gui=bold,italic
|
||||
" hi
|
||||
" def
|
||||
" htmlBoldUnderlineItalic
|
||||
" term=bold,italic,underline
|
||||
" cterm=bold,italic,underline
|
||||
" gui=bold,italic,underline
|
||||
" hi
|
||||
" def
|
||||
" htmlUnderline
|
||||
" term=underline
|
||||
" cterm=underline
|
||||
" gui=underline
|
||||
" hi
|
||||
" def
|
||||
" htmlUnderlineItalic
|
||||
" term=italic,underline
|
||||
" cterm=italic,underline
|
||||
" gui=italic,underline
|
||||
" hi
|
||||
" def
|
||||
" htmlItalic
|
||||
" term=italic
|
||||
" cterm=italic
|
||||
" gui=italic
|
||||
" endif
|
||||
" endif
|
||||
"
|
||||
" HtmlHiLink
|
||||
" htmlPreStmt
|
||||
" PreProc
|
||||
" HtmlHiLink
|
||||
" htmlPreError
|
||||
" Error
|
||||
" HtmlHiLink
|
||||
" htmlPreProc
|
||||
" PreProc
|
||||
" HtmlHiLink
|
||||
" htmlPreAttr
|
||||
" String
|
||||
" HtmlHiLink
|
||||
" htmlPreProcAttrName
|
||||
" PreProc
|
||||
" HtmlHiLink
|
||||
" htmlPreProcAttrError
|
||||
" Error
|
||||
" HtmlHiLink
|
||||
" htmlSpecial
|
||||
" Special
|
||||
" HtmlHiLink
|
||||
" htmlSpecialChar
|
||||
" Special
|
||||
" HtmlHiLink
|
||||
" htmlString
|
||||
" String
|
||||
" HtmlHiLink
|
||||
" htmlStatement
|
||||
" Statement
|
||||
" HtmlHiLink
|
||||
" htmlComment
|
||||
" Comment
|
||||
" HtmlHiLink
|
||||
" htmlCommentPart
|
||||
" Comment
|
||||
" HtmlHiLink
|
||||
" htmlValue
|
||||
" String
|
||||
" HtmlHiLink
|
||||
" htmlCommentError
|
||||
" htmlError
|
||||
" HtmlHiLink
|
||||
" htmlTagError
|
||||
" htmlError
|
||||
" HtmlHiLink
|
||||
" htmlEvent
|
||||
" javaScript
|
||||
" HtmlHiLink
|
||||
" htmlError
|
||||
" Error
|
||||
"
|
||||
" HtmlHiLink
|
||||
" javaScript
|
||||
" Special
|
||||
" HtmlHiLink
|
||||
" javaScriptExpression
|
||||
" javaScript
|
||||
" HtmlHiLink
|
||||
" htmlCssStyleComment
|
||||
" Comment
|
||||
" HtmlHiLink
|
||||
" htmlCssDefinition
|
||||
" Special
|
||||
" endif
|
||||
"
|
||||
" delcommand
|
||||
" HtmlHiLink
|
||||
"
|
||||
" let
|
||||
" b:current_syntax
|
||||
" =
|
||||
" "html"
|
||||
"
|
||||
" if
|
||||
" main_syntax
|
||||
" ==
|
||||
" 'html'
|
||||
" unlet
|
||||
" main_syntax
|
||||
" endif
|
||||
"
|
||||
" "
|
||||
" vim:
|
||||
" ts=8
|
||||
1134
.vim/syntax/java.vim
Normal file
1134
.vim/syntax/java.vim
Normal file
File diff suppressed because it is too large
Load Diff
246
.vim/syntax/javascript.vim
Normal file
246
.vim/syntax/javascript.vim
Normal file
@@ -0,0 +1,246 @@
|
||||
" Vim syntax file
|
||||
" Language: JavaScript
|
||||
" Maintainer: Yi Zhao (ZHAOYI) <zzlinux AT hotmail DOT com>
|
||||
" Last Change: June 4, 2009
|
||||
" Version: 0.7.7
|
||||
" Changes: Add "undefined" as a type keyword
|
||||
"
|
||||
" TODO:
|
||||
" - Add the HTML syntax inside the JSDoc
|
||||
|
||||
if !exists("main_syntax")
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
let main_syntax = 'javascript'
|
||||
endif
|
||||
|
||||
"" Drop fold if it set but VIM doesn't support it.
|
||||
let b:javascript_fold='true'
|
||||
if version < 600 " Don't support the old version
|
||||
unlet! b:javascript_fold
|
||||
endif
|
||||
|
||||
"" dollar sigh is permittd anywhere in an identifier
|
||||
setlocal iskeyword+=$
|
||||
|
||||
syntax sync fromstart
|
||||
|
||||
"" JavaScript comments
|
||||
syntax keyword javaScriptCommentTodo TODO FIXME XXX TBD contained
|
||||
syntax region javaScriptLineComment start=+\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell
|
||||
syntax region javaScriptLineComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell fold
|
||||
syntax region javaScriptCvsTag start="\$\cid:" end="\$" oneline contained
|
||||
syntax region javaScriptComment start="/\*" end="\*/" contains=javaScriptCommentTodo,javaScriptCvsTag,@Spell fold
|
||||
|
||||
"" JSDoc support start
|
||||
if !exists("javascript_ignore_javaScriptdoc")
|
||||
syntax case ignore
|
||||
|
||||
"" syntax coloring for javadoc comments (HTML)
|
||||
"syntax include @javaHtml <sfile>:p:h/html.vim
|
||||
"unlet b:current_syntax
|
||||
|
||||
syntax region javaScriptDocComment matchgroup=javaScriptComment start="/\*\*\s*$" end="\*/" contains=javaScriptDocTags,javaScriptCommentTodo,javaScriptCvsTag,@javaScriptHtml,@Spell fold
|
||||
syntax match javaScriptDocTags contained "@\(param\|argument\|requires\|exception\|throws\|type\|class\|extends\|see\|link\|member\|module\|method\|title\|namespace\|optional\|default\|base\|file\)\>" nextgroup=javaScriptDocParam,javaScriptDocSeeTag skipwhite
|
||||
syntax match javaScriptDocTags contained "@\(beta\|deprecated\|description\|fileoverview\|author\|license\|version\|returns\=\|constructor\|private\|protected\|final\|ignore\|addon\|exec\)\>"
|
||||
syntax match javaScriptDocParam contained "\%(#\|\w\|\.\|:\|\/\)\+"
|
||||
syntax region javaScriptDocSeeTag contained matchgroup=javaScriptDocSeeTag start="{" end="}" contains=javaScriptDocTags
|
||||
|
||||
syntax case match
|
||||
endif "" JSDoc end
|
||||
|
||||
syntax case match
|
||||
|
||||
"" Syntax in the JavaScript code
|
||||
syntax match javaScriptSpecial "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\."
|
||||
syntax region javaScriptStringD start=+"+ skip=+\\\\\|\\$"+ end=+"+ contains=javaScriptSpecial,@htmlPreproc
|
||||
syntax region javaScriptStringS start=+'+ skip=+\\\\\|\\$'+ end=+'+ contains=javaScriptSpecial,@htmlPreproc
|
||||
syntax region javaScriptRegexpString start=+/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gim]\{,3}+ contains=javaScriptSpecial,@htmlPreproc oneline
|
||||
syntax match javaScriptNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
|
||||
syntax match javaScriptFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
|
||||
syntax match javaScriptLabel /\(?\s*\)\@<!\<\w\+\(\s*:\)\@=/
|
||||
|
||||
"" JavaScript Prototype
|
||||
syntax keyword javaScriptPrototype prototype
|
||||
|
||||
"" Programm Keywords
|
||||
syntax keyword javaScriptSource import export
|
||||
syntax keyword javaScriptType const this undefined var void yield
|
||||
syntax keyword javaScriptOperator delete new in instanceof let typeof
|
||||
syntax keyword javaScriptBoolean true false
|
||||
syntax keyword javaScriptNull null
|
||||
|
||||
"" Statement Keywords
|
||||
syntax keyword javaScriptConditional if else
|
||||
syntax keyword javaScriptRepeat do while for
|
||||
syntax keyword javaScriptBranch break continue switch case default return
|
||||
syntax keyword javaScriptStatement try catch throw with finally
|
||||
|
||||
syntax keyword javaScriptGlobalObjects Array Boolean Date Function Infinity JavaArray JavaClass JavaObject JavaPackage Math Number NaN Object Packages RegExp String Undefined java netscape sun
|
||||
|
||||
syntax keyword javaScriptExceptions Error EvalError RangeError ReferenceError SyntaxError TypeError URIError
|
||||
|
||||
syntax keyword javaScriptFutureKeys abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public
|
||||
|
||||
"" DOM/HTML/CSS specified things
|
||||
|
||||
" DOM2 Objects
|
||||
syntax keyword javaScriptGlobalObjects DOMImplementation DocumentFragment Document Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction
|
||||
syntax keyword javaScriptExceptions DOMException
|
||||
|
||||
" DOM2 CONSTANT
|
||||
syntax keyword javaScriptDomErrNo INDEX_SIZE_ERR DOMSTRING_SIZE_ERR HIERARCHY_REQUEST_ERR WRONG_DOCUMENT_ERR INVALID_CHARACTER_ERR NO_DATA_ALLOWED_ERR NO_MODIFICATION_ALLOWED_ERR NOT_FOUND_ERR NOT_SUPPORTED_ERR INUSE_ATTRIBUTE_ERR INVALID_STATE_ERR SYNTAX_ERR INVALID_MODIFICATION_ERR NAMESPACE_ERR INVALID_ACCESS_ERR
|
||||
syntax keyword javaScriptDomNodeConsts ELEMENT_NODE ATTRIBUTE_NODE TEXT_NODE CDATA_SECTION_NODE ENTITY_REFERENCE_NODE ENTITY_NODE PROCESSING_INSTRUCTION_NODE COMMENT_NODE DOCUMENT_NODE DOCUMENT_TYPE_NODE DOCUMENT_FRAGMENT_NODE NOTATION_NODE
|
||||
|
||||
" HTML events and internal variables
|
||||
syntax case ignore
|
||||
syntax keyword javaScriptHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize
|
||||
syntax case match
|
||||
|
||||
" Follow stuff should be highligh within a special context
|
||||
" While it can't be handled with context depended with Regex based highlight
|
||||
" So, turn it off by default
|
||||
if exists("javascript_enable_domhtmlcss")
|
||||
|
||||
" DOM2 things
|
||||
syntax match javaScriptDomElemAttrs contained /\%(nodeName\|nodeValue\|nodeType\|parentNode\|childNodes\|firstChild\|lastChild\|previousSibling\|nextSibling\|attributes\|ownerDocument\|namespaceURI\|prefix\|localName\|tagName\)\>/
|
||||
syntax match javaScriptDomElemFuncs contained /\%(insertBefore\|replaceChild\|removeChild\|appendChild\|hasChildNodes\|cloneNode\|normalize\|isSupported\|hasAttributes\|getAttribute\|setAttribute\|removeAttribute\|getAttributeNode\|setAttributeNode\|removeAttributeNode\|getElementsByTagName\|getAttributeNS\|setAttributeNS\|removeAttributeNS\|getAttributeNodeNS\|setAttributeNodeNS\|getElementsByTagNameNS\|hasAttribute\|hasAttributeNS\)\>/ nextgroup=javaScriptParen skipwhite
|
||||
" HTML things
|
||||
syntax match javaScriptHtmlElemAttrs contained /\%(className\|clientHeight\|clientLeft\|clientTop\|clientWidth\|dir\|id\|innerHTML\|lang\|length\|offsetHeight\|offsetLeft\|offsetParent\|offsetTop\|offsetWidth\|scrollHeight\|scrollLeft\|scrollTop\|scrollWidth\|style\|tabIndex\|title\)\>/
|
||||
syntax match javaScriptHtmlElemFuncs contained /\%(blur\|click\|focus\|scrollIntoView\|addEventListener\|dispatchEvent\|removeEventListener\|item\)\>/ nextgroup=javaScriptParen skipwhite
|
||||
|
||||
" CSS Styles in JavaScript
|
||||
syntax keyword javaScriptCssStyles contained color font fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight letterSpacing lineBreak lineHeight quotes rubyAlign rubyOverhang rubyPosition
|
||||
syntax keyword javaScriptCssStyles contained textAlign textAlignLast textAutospace textDecoration textIndent textJustify textJustifyTrim textKashidaSpace textOverflowW6 textShadow textTransform textUnderlinePosition
|
||||
syntax keyword javaScriptCssStyles contained unicodeBidi whiteSpace wordBreak wordSpacing wordWrap writingMode
|
||||
syntax keyword javaScriptCssStyles contained bottom height left position right top width zIndex
|
||||
syntax keyword javaScriptCssStyles contained border borderBottom borderLeft borderRight borderTop borderBottomColor borderLeftColor borderTopColor borderBottomStyle borderLeftStyle borderRightStyle borderTopStyle borderBottomWidth borderLeftWidth borderRightWidth borderTopWidth borderColor borderStyle borderWidth borderCollapse borderSpacing captionSide emptyCells tableLayout
|
||||
syntax keyword javaScriptCssStyles contained margin marginBottom marginLeft marginRight marginTop outline outlineColor outlineStyle outlineWidth padding paddingBottom paddingLeft paddingRight paddingTop
|
||||
syntax keyword javaScriptCssStyles contained listStyle listStyleImage listStylePosition listStyleType
|
||||
syntax keyword javaScriptCssStyles contained background backgroundAttachment backgroundColor backgroundImage gackgroundPosition backgroundPositionX backgroundPositionY backgroundRepeat
|
||||
syntax keyword javaScriptCssStyles contained clear clip clipBottom clipLeft clipRight clipTop content counterIncrement counterReset cssFloat cursor direction display filter layoutGrid layoutGridChar layoutGridLine layoutGridMode layoutGridType
|
||||
syntax keyword javaScriptCssStyles contained marks maxHeight maxWidth minHeight minWidth opacity MozOpacity overflow overflowX overflowY verticalAlign visibility zoom cssText
|
||||
syntax keyword javaScriptCssStyles contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor
|
||||
|
||||
" Highlight ways
|
||||
syntax match javaScriptDotNotation "\." nextgroup=javaScriptPrototype,javaScriptDomElemAttrs,javaScriptDomElemFuncs,javaScriptHtmlElemAttrs,javaScriptHtmlElemFuncs
|
||||
syntax match javaScriptDotNotation "\.style\." nextgroup=javaScriptCssStyles
|
||||
|
||||
endif "DOM/HTML/CSS
|
||||
|
||||
"" end DOM/HTML/CSS specified things
|
||||
|
||||
|
||||
"" Code blocks
|
||||
syntax cluster javaScriptAll contains=javaScriptComment,javaScriptLineComment,javaScriptDocComment,javaScriptStringD,javaScriptStringS,javaScriptRegexpString,javaScriptNumber,javaScriptFloat,javaScriptLabel,javaScriptSource,javaScriptType,javaScriptOperator,javaScriptBoolean,javaScriptNull,javaScriptFunction,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptStatement,javaScriptGlobalObjects,javaScriptExceptions,javaScriptFutureKeys,javaScriptDomErrNo,javaScriptDomNodeConsts,javaScriptHtmlEvents,javaScriptDotNotation
|
||||
syntax region javaScriptBracket matchgroup=javaScriptBracket transparent start="\[" end="\]" contains=@javaScriptAll,javaScriptParensErrB,javaScriptParensErrC,javaScriptBracket,javaScriptParen,javaScriptBlock,@htmlPreproc
|
||||
syntax region javaScriptParen matchgroup=javaScriptParen transparent start="(" end=")" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrC,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc
|
||||
syntax region javaScriptBlock matchgroup=javaScriptBlock transparent start="{" end="}" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc
|
||||
|
||||
"" catch errors caused by wrong parenthesis
|
||||
syntax match javaScriptParensError ")\|}\|\]"
|
||||
syntax match javaScriptParensErrA contained "\]"
|
||||
syntax match javaScriptParensErrB contained ")"
|
||||
syntax match javaScriptParensErrC contained "}"
|
||||
|
||||
if main_syntax == "javascript"
|
||||
syntax sync clear
|
||||
syntax sync ccomment javaScriptComment minlines=200
|
||||
syntax sync match javaScriptHighlight grouphere javaScriptBlock /{/
|
||||
endif
|
||||
|
||||
"" Fold control
|
||||
if exists("b:javascript_fold")
|
||||
syntax match javaScriptFunction /\<function\>/ nextgroup=javaScriptFuncName skipwhite
|
||||
syntax match javaScriptOpAssign /=\@<!=/ nextgroup=javaScriptFuncBlock skipwhite skipempty
|
||||
syntax region javaScriptFuncName contained matchgroup=javaScriptFuncName start=/\%(\$\|\w\)*\s*(/ end=/)/ contains=javaScriptLineComment,javaScriptComment nextgroup=javaScriptFuncBlock skipwhite skipempty
|
||||
syntax region javaScriptFuncBlock contained matchgroup=javaScriptFuncBlock start="{" end="}" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock fold
|
||||
|
||||
if &l:filetype=='javascript' && !&diff
|
||||
" Fold setting
|
||||
" Redefine the foldtext (to show a JS function outline) and foldlevel
|
||||
" only if the entire buffer is JavaScript, but not if JavaScript syntax
|
||||
" is embedded in another syntax (e.g. HTML).
|
||||
setlocal foldmethod=syntax
|
||||
setlocal foldlevel=4
|
||||
endif
|
||||
else
|
||||
syntax keyword javaScriptFunction function
|
||||
setlocal foldmethod<
|
||||
setlocal foldlevel<
|
||||
endif
|
||||
|
||||
" Define the default highlighting.
|
||||
" For version 5.7 and earlier: only when not done already
|
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||
if version >= 508 || !exists("did_javascript_syn_inits")
|
||||
if version < 508
|
||||
let did_javascript_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
HiLink javaScriptComment Comment
|
||||
HiLink javaScriptLineComment Comment
|
||||
HiLink javaScriptDocComment Comment
|
||||
HiLink javaScriptCommentTodo Todo
|
||||
HiLink javaScriptCvsTag Function
|
||||
HiLink javaScriptDocTags Special
|
||||
HiLink javaScriptDocSeeTag Function
|
||||
HiLink javaScriptDocParam Function
|
||||
HiLink javaScriptStringS String
|
||||
HiLink javaScriptStringD String
|
||||
HiLink javaScriptRegexpString String
|
||||
HiLink javaScriptCharacter Character
|
||||
HiLink javaScriptPrototype Type
|
||||
HiLink javaScriptConditional Conditional
|
||||
HiLink javaScriptBranch Conditional
|
||||
HiLink javaScriptRepeat Repeat
|
||||
HiLink javaScriptStatement Statement
|
||||
HiLink javaScriptFunction Function
|
||||
HiLink javaScriptError Error
|
||||
HiLink javaScriptParensError Error
|
||||
HiLink javaScriptParensErrA Error
|
||||
HiLink javaScriptParensErrB Error
|
||||
HiLink javaScriptParensErrC Error
|
||||
HiLink javaScriptOperator Operator
|
||||
HiLink javaScriptType Type
|
||||
HiLink javaScriptNull Type
|
||||
HiLink javaScriptNumber Number
|
||||
HiLink javaScriptFloat Number
|
||||
HiLink javaScriptBoolean Boolean
|
||||
HiLink javaScriptLabel Label
|
||||
HiLink javaScriptSpecial Special
|
||||
HiLink javaScriptSource Special
|
||||
HiLink javaScriptGlobalObjects Special
|
||||
HiLink javaScriptExceptions Special
|
||||
|
||||
HiLink javaScriptDomErrNo Constant
|
||||
HiLink javaScriptDomNodeConsts Constant
|
||||
HiLink javaScriptDomElemAttrs Label
|
||||
HiLink javaScriptDomElemFuncs PreProc
|
||||
|
||||
HiLink javaScriptHtmlEvents Special
|
||||
HiLink javaScriptHtmlElemAttrs Label
|
||||
HiLink javaScriptHtmlElemFuncs PreProc
|
||||
|
||||
HiLink javaScriptCssStyles Label
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
" Define the htmlJavaScript for HTML syntax html.vim
|
||||
"syntax clear htmlJavaScript
|
||||
"syntax clear javaScriptExpression
|
||||
syntax cluster htmlJavaScript contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError
|
||||
syntax cluster javaScriptExpression contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError,@htmlPreproc
|
||||
|
||||
let b:current_syntax = "javascript"
|
||||
if main_syntax == 'javascript'
|
||||
unlet main_syntax
|
||||
endif
|
||||
|
||||
" vim: ts=4
|
||||
536
.vim/syntax/perl.vim
Normal file
536
.vim/syntax/perl.vim
Normal file
@@ -0,0 +1,536 @@
|
||||
" Vim syntax file
|
||||
" Language: Perl
|
||||
" Maintainer: Lukas Mai <l.mai@web.de>
|
||||
" Last Change: 2008-08-08
|
||||
"
|
||||
" Standard perl syntax file for vim by Nick Hibma <nick@van-laarhoven.org>
|
||||
" Modified by Lukas Mai
|
||||
"
|
||||
" Original version: Sonia Heimann <niania@netsurf.org>
|
||||
" Thanks to many people for their contribution.
|
||||
|
||||
" The following parameters are available for tuning the
|
||||
" perl syntax highlighting, with defaults given:
|
||||
"
|
||||
" unlet perl_include_pod
|
||||
" unlet perl_no_scope_in_variables
|
||||
" unlet perl_no_extended_vars
|
||||
" unlet perl_string_as_statement
|
||||
" unlet perl_no_sync_on_sub
|
||||
" unlet perl_no_sync_on_global_var
|
||||
" let perl_sync_dist = 100
|
||||
" unlet perl_fold
|
||||
" unlet perl_fold_blocks
|
||||
" let perl_nofold_packages = 1
|
||||
" let perl_nofold_subs = 1
|
||||
|
||||
if version < 600
|
||||
echoerr ">=vim-6.0 is required to run perl-mauke.vim"
|
||||
finish
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" POD starts with ^=<word> and ends with ^=cut
|
||||
|
||||
if exists("perl_include_pod")
|
||||
" Include a while extra syntax file
|
||||
syn include @Pod syntax/pod.vim
|
||||
unlet b:current_syntax
|
||||
if exists("perl_fold")
|
||||
syn region perlPOD start="^=[a-z]" end="^=cut" contains=@Pod,@Spell,perlTodo keepend fold
|
||||
syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend fold
|
||||
else
|
||||
syn region perlPOD start="^=[a-z]" end="^=cut" contains=@Pod,@Spell,perlTodo keepend
|
||||
syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend
|
||||
endif
|
||||
else
|
||||
" Use only the bare minimum of rules
|
||||
if exists("perl_fold")
|
||||
syn region perlPOD start="^=[a-z]" end="^=cut" fold
|
||||
else
|
||||
syn region perlPOD start="^=[a-z]" end="^=cut"
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
syn cluster perlTop contains=TOP
|
||||
syn region perlGenericBlock matchgroup=perlGenericBlock start="{" end="}" contained transparent
|
||||
|
||||
|
||||
" All keywords
|
||||
"
|
||||
syn match perlConditional "\<\%(if\|elsif\|unless\|given\|when\|default\)\>"
|
||||
syn match perlConditional "\<else\>" nextgroup=perlElseIfError skipwhite skipnl skipempty
|
||||
syn match perlRepeat "\<\%(while\|for\%(each\)\=\|do\|until\|continue\)\>"
|
||||
syn match perlOperator "\<\%(defined\|undef\|eq\|ne\|[gl][et]\|cmp\|not\|and\|or\|xor\|not\|bless\|ref\|do\)\>"
|
||||
syn match perlControl "\<\%(BEGIN\|CHECK\|INIT\|END\|UNITCHECK\)\>"
|
||||
|
||||
syn match perlStatementStorage "\<\%(my\|our\|local\|state\)\>"
|
||||
syn match perlStatementControl "\<\%(return\|last\|next\|redo\|goto\|break\)\>"
|
||||
syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|uc\%(first\)\=\)\>"
|
||||
syn match perlStatementRegexp "\<\%(pos\|quotemeta\|split\|study\)\>"
|
||||
syn match perlStatementNumeric "\<\%(abs\|atan2\|cos\|exp\|hex\|int\|log\|oct\|rand\|sin\|sqrt\|srand\)\>"
|
||||
syn match perlStatementList "\<\%(splice\|unshift\|shift\|push\|pop\|join\|reverse\|grep\|map\|sort\|unpack\)\>"
|
||||
syn match perlStatementHash "\<\%(delete\|each\|exists\|keys\|values\)\>"
|
||||
syn match perlStatementIOfunc "\<\%(syscall\|dbmopen\|dbmclose\)\>"
|
||||
syn match perlStatementFiledesc "\<\%(binmode\|close\%(dir\)\=\|eof\|fileno\|getc\|lstat\|printf\=\|read\%(dir\|line\|pipe\)\|rewinddir\|say\|select\|stat\|tell\%(dir\)\=\|write\)\>" nextgroup=perlFiledescStatementNocomma skipwhite
|
||||
syn match perlStatementFiledesc "\<\%(fcntl\|flock\|ioctl\|open\%(dir\)\=\|read\|seek\%(dir\)\=\|sys\%(open\|read\|seek\|write\)\|truncate\)\>" nextgroup=perlFiledescStatementComma skipwhite
|
||||
syn match perlStatementVector "\<vec\>"
|
||||
syn match perlStatementFiles "\<\%(ch\%(dir\|mod\|own\|root\)\|glob\|link\|mkdir\|readlink\|rename\|rmdir\|symlink\|umask\|unlink\|utime\)\>"
|
||||
syn match perlStatementFiles "-[rwxoRWXOezsfdlpSbctugkTBMAC]\>"
|
||||
syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\)\>"
|
||||
syn match perlStatementInclude "\<require\>"
|
||||
syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autouse\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\="
|
||||
syn match perlStatementProc "\<\%(alarm\|exec\|fork\|get\%(pgrp\|ppid\|priority\)\|kill\|pipe\|set\%(pgrp\|priority\)\|sleep\|system\|times\|wait\%(pid\)\=\)\>"
|
||||
syn match perlStatementSocket "\<\%(acept\|bind\|connect\|get\%(peername\|sock\%(name\|opt\)\)\|listen\|recv\|send\|setsockopt\|shutdown\|socket\%(pair\)\=\)\>"
|
||||
syn match perlStatementIPC "\<\%(msg\%(ctl\|get\|rcv\|snd\)\|sem\%(ctl\|get\|op\)\|shm\%(ctl\|get\|read\|write\)\)\>"
|
||||
syn match perlStatementNetwork "\<\%(\%(end\|[gs]et\)\%(host\|net\|proto\|serv\)ent\|get\%(\%(host\|net\)by\%(addr\|name\)\|protoby\%(name\|number\)\|servby\%(name\|port\)\)\)\>"
|
||||
syn match perlStatementPword "\<\%(get\%(pw\%(uid\|nam\)\|gr\%(gid\|nam\)\|login\)\)\|\%(end\|[gs]et\)\%(pw\|gr\)ent\>"
|
||||
syn match perlStatementTime "\<\%(gmtime\|localtime\|time\)\>"
|
||||
|
||||
syn match perlStatementMisc "\<\%(warn\|formline\|reset\|scalar\|prototype\|lock\|tied\=\|untie\)\>"
|
||||
|
||||
syn keyword perlTodo TODO TBD FIXME XXX contained
|
||||
|
||||
syn region perlStatementIndirObjWrap matchgroup=perlStatementIndirObj start="\<\%(map\|grep\|sort\|print\|system\|exec\)\>\s*{" end="}" contains=@perlTop,perlGenericBlock
|
||||
|
||||
syn match perlLabel "^\s*\h\w*\s*::\@!\%(\<v\d\+\s*:\)\@<!"
|
||||
|
||||
" Perl Identifiers.
|
||||
"
|
||||
" Should be cleaned up to better handle identifiers in particular situations
|
||||
" (in hash keys for example)
|
||||
"
|
||||
" Plain identifiers: $foo, @foo, $#foo, %foo, &foo and dereferences $$foo, @$foo, etc.
|
||||
" We do not process complex things such as @{${"foo"}}. Too complicated, and
|
||||
" too slow. And what is after the -> is *not* considered as part of the
|
||||
" variable - there again, too complicated and too slow.
|
||||
|
||||
" Special variables first ($^A, ...) and ($|, $', ...)
|
||||
syn match perlVarPlain "$^[ACDEFHILMNOPRSTVWX]\="
|
||||
syn match perlVarPlain "$[\\\"\[\]'&`+*.,;=%~!?@#$<>(-]"
|
||||
syn match perlVarPlain "$\%(0\|[1-9]\d*\)"
|
||||
" Same as above, but avoids confusion in $::foo (equivalent to $main::foo)
|
||||
syn match perlVarPlain "$::\@!"
|
||||
" These variables are not recognized within matches.
|
||||
syn match perlVarNotInMatches "$[|)]"
|
||||
" This variable is not recognized within matches delimited by m//.
|
||||
syn match perlVarSlash "$/"
|
||||
|
||||
" And plain identifiers
|
||||
syn match perlPackageRef "[$@#%*&]\%(\%(::\|'\)\=\I\i*\%(\%(::\|'\)\I\i*\)*\)\=\%(::\|'\)\I"ms=s+1,me=e-1 contained
|
||||
|
||||
" To not highlight packages in variables as a scope reference - i.e. in
|
||||
" $pack::var, pack:: is a scope, just set "perl_no_scope_in_variables"
|
||||
" If you don't want complex things like @{${"foo"}} to be processed,
|
||||
" just set the variable "perl_no_extended_vars"...
|
||||
|
||||
if !exists("perl_no_scope_in_variables")
|
||||
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef
|
||||
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
else
|
||||
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)"
|
||||
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
endif
|
||||
|
||||
if !exists("perl_no_extended_vars")
|
||||
syn cluster perlExpr contains=perlStatementIndirObjWrap,perlStatementScalar,perlStatementRegexp,perlStatementNumeric,perlStatementList,perlStatementHash,perlStatementFiles,perlStatementTime,perlStatementMisc,perlVarPlain,perlVarPlain2,perlVarNotInMatches,perlVarSlash,perlVarBlock,perlVarBlock2,perlShellCommand,perlFloat,perlNumber,perlStringUnexpanded,perlString,perlQQ,perlArrow,perlGenericBlock
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*\[" end="\]" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*{" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
|
||||
syn match perlArrow "->\s*{\s*\I\i*\s*}" contains=perlVarSimpleMemberName nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
|
||||
syn region perlArrow matchgroup=perlArrow start="->\s*\$*\I\i*\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
|
||||
syn region perlVarBlock matchgroup=perlVarPlain start="\%($#\|[$@]\)\$*{" skip="\\}" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
syn region perlVarBlock2 matchgroup=perlVarPlain start="[%&*]\$*{" skip="\\}" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
syn match perlVarPlain2 "[%&*]\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
syn match perlVarPlain "\%(\$#\|[@$]\)\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\={" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
syn match perlVarSimpleMember "\%(->\)\={\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contains=perlVarSimpleMemberName contained
|
||||
syn match perlVarSimpleMemberName "\I\i*" contained
|
||||
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
|
||||
syn match perlMethod "->\$*\I\i*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod
|
||||
endif
|
||||
|
||||
" File Descriptors
|
||||
syn match perlFiledescRead "<\h\w*>"
|
||||
|
||||
syn match perlFiledescStatementComma "(\=\s*\u\w*\s*,"me=e-1 transparent contained contains=perlFiledescStatement
|
||||
syn match perlFiledescStatementNocomma "(\=\s*\u\w*\s*[^, \t]"me=e-1 transparent contained contains=perlFiledescStatement
|
||||
|
||||
syn match perlFiledescStatement "\u\w*" contained
|
||||
|
||||
" Special characters in strings and matches
|
||||
syn match perlSpecialString "\\\%(\o\{1,3}\|x\%({\x\+}\|\x\{1,2}\)\|c.\|[^cx]\)" contained extend
|
||||
syn match perlSpecialStringU2 "\\." extend contained transparent contains=NONE
|
||||
syn match perlSpecialStringU "\\\\" contained
|
||||
syn match perlSpecialMatch "\\[1-9]" contained extend
|
||||
syn match perlSpecialMatch "\\g\%(\d\+\|{\%(-\=\d\+\|\h\w*\)}\)" contained
|
||||
syn match perlSpecialMatch "\\k\%(<\h\w*>\|'\h\w*'\)" contained
|
||||
syn match perlSpecialMatch "{\d\+\%(,\%(\d\+\)\=\)\=}" contained
|
||||
syn match perlSpecialMatch "\[[]-]\=[^\[\]]*[]-]\=\]" contained
|
||||
syn match perlSpecialMatch "[+*()?.]" contained
|
||||
syn match perlSpecialMatch "(?[#:=!]" contained
|
||||
syn match perlSpecialMatch "(?[impsx]*\%(-[imsx]\+\)\=)" contained
|
||||
syn match perlSpecialMatch "(?\%([-+]\=\d\+\|R\))" contained
|
||||
syn match perlSpecialMatch "(?\%(&\|P[>=]\)\h\w*)" contained
|
||||
syn match perlSpecialMatch "(\*\%(\%(PRUNE\|SKIP\|THEN\)\%(:[^)]*\)\=\|\%(MARK\|\):[^)]*\|COMMIT\|F\%(AIL\)\=\|ACCEPT\))" contained
|
||||
|
||||
" Possible errors
|
||||
"
|
||||
" Highlight lines with only whitespace (only in blank delimited here documents) as errors
|
||||
syn match perlNotEmptyLine "^\s\+$" contained
|
||||
" Highlight '} else if (...) {', it should be '} else { if (...) { ' or
|
||||
" '} elsif (...) {'.
|
||||
syn match perlElseIfError "[^[:space:]{]\+" contained
|
||||
|
||||
" Variable interpolation
|
||||
"
|
||||
" These items are interpolated inside "" strings and similar constructs.
|
||||
syn cluster perlInterpDQ contains=perlSpecialString,perlVarPlain,perlVarNotInMatches,perlVarSlash,perlVarBlock
|
||||
" These items are interpolated inside '' strings and similar constructs.
|
||||
syn cluster perlInterpSQ contains=perlSpecialStringU,perlSpecialStringU2
|
||||
" These items are interpolated inside m// matches and s/// substitutions.
|
||||
syn cluster perlInterpSlash contains=perlSpecialString,perlSpecialMatch,perlVarPlain,perlVarBlock
|
||||
" These items are interpolated inside m## matches and s### substitutions.
|
||||
syn cluster perlInterpMatch contains=@perlInterpSlash,perlVarSlash
|
||||
|
||||
" Shell commands
|
||||
syn region perlShellCommand matchgroup=perlMatchStartEnd start="`" end="`" contains=@perlInterpDQ keepend
|
||||
|
||||
" Constants
|
||||
"
|
||||
" Numbers
|
||||
syn match perlNumber "\<\%(0\%(x\x[[:xdigit:]_]*\|b[01][01_]*\|\o[0-7_]*\|\)\|[1-9][[:digit:]_]*\)\>"
|
||||
syn match perlFloat "\<\d[[:digit:]_]*[eE][\-+]\=\d\+"
|
||||
syn match perlFloat "\<\d[[:digit:]_]*\.[[:digit:]_]*\%([eE][\-+]\=\d\+\)\="
|
||||
syn match perlFloat "\.[[:digit:]_]\+\%([eE][\-+]\=\d\+\)\="
|
||||
|
||||
syn match perlString "\<\%(v\d\+\%(\.\d\+\)*\|\d\+\%(\.\d\+\)\{2,}\)\>" contains=perlVStringV
|
||||
syn match perlVStringV "\<v" contained
|
||||
|
||||
|
||||
syn region perlParensSQ start=+(+ end=+)+ extend contained transparent contains=perlParensSQ,@perlInterpSQ keepend
|
||||
syn region perlBracketsSQ start=+\[+ end=+\]+ extend contained transparent contains=perlBracketsSQ,@perlInterpSQ keepend
|
||||
syn region perlBracesSQ start=+{+ end=+}+ extend contained transparent contains=perlBracesSQ,@perlInterpSQ keepend
|
||||
syn region perlAnglesSQ start=+<+ end=+>+ extend contained transparent contains=perlAnglesSQ,@perlInterpSQ keepend
|
||||
|
||||
syn region perlParensDQ start=+(+ end=+)+ extend contained transparent contains=perlParensDQ,@perlInterpDQ keepend
|
||||
syn region perlBracketsDQ start=+\[+ end=+\]+ extend contained transparent contains=perlBracketsDQ,@perlInterpDQ keepend
|
||||
syn region perlBracesDQ start=+{+ end=+}+ extend contained transparent contains=perlBracesDQ,@perlInterpDQ keepend
|
||||
syn region perlAnglesDQ start=+<+ end=+>+ extend contained transparent contains=perlAnglesDQ,@perlInterpDQ keepend
|
||||
|
||||
|
||||
" Simple version of searches and matches
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1[cgimopsx]*+ contains=@perlInterpMatch keepend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m#+ end=+#[cgimopsx]*+ contains=@perlInterpMatch keepend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*'+ end=+'[cgimopsx]*+ contains=@perlInterpSQ keepend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*/+ end=+/[cgimopsx]*+ contains=@perlInterpSlash keepend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*(+ end=+)[cgimopsx]*+ contains=@perlInterpMatch,perlParensDQ keepend
|
||||
|
||||
" A special case for m{}, m<> and m[] which allows for comments and extra whitespace in the pattern
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*{+ end=+}[cgimopsx]*+ contains=@perlInterpMatch,perlComment,perlBracesDQ keepend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*<+ end=+>[cgimopsx]*+ contains=@perlInterpMatch,perlAnglesDQ keepend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*\[+ end=+\][cgimopsx]*+ contains=@perlInterpMatch,perlComment,perlBracketsDQ keepend
|
||||
|
||||
" Below some hacks to recognise the // variant. This is virtually impossible to catch in all
|
||||
" cases as the / is used in so many other ways, but these should be the most obvious ones.
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start="\%([$@%&*]\@<!\%(\<split\|\<while\|\<if\|\<unless\|\.\.\|[-+*!~(\[{=]\)\s*\)\@<=/" start=+^/+ start=+\s\@<=/[^[:space:][:digit:]$@%=]\@=\%(/\_s*\%([([{$@%&*[:digit:]"'`]\|\_s\w\|[[:upper:]_abd-fhjklnqrt-wyz]\)\)\@!+ skip=+\\/+ end=+/[cgimopsx]*+ contains=@perlInterpSlash
|
||||
|
||||
|
||||
" Substitutions
|
||||
" perlMatch is the first part, perlSubstitution* is the substitution part
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1+me=e-1 contains=@perlInterpMatch nextgroup=perlSubstitutionGQQ keepend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*'+ end=+'+me=e-1 contains=@perlInterpSQ nextgroup=perlSubstitutionSQ keepend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*/+ end=+/+me=e-1 contains=@perlInterpSlash nextgroup=perlSubstitutionGQQ keepend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s#+ end=+#+me=e-1 contains=@perlInterpMatch nextgroup=perlSubstitutionGQQ keepend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*(+ end=+)+ contains=@perlInterpMatch,perlParensDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*<+ end=+>+ contains=@perlInterpMatch,perlAnglesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*\[+ end=+\]+ contains=@perlInterpMatch,perlBracketsDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*{+ end=+}+ contains=@perlInterpMatch,perlBracesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]'([{<]\)+ end=+\z1[ecgimopsx]*+ keepend contained contains=@perlInterpDQ
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+(+ end=+)[ecgimopsx]*+ contained contains=@perlInterpDQ,perlParensDQ keepend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][ecgimopsx]*+ contained contains=@perlInterpDQ,perlBracketsDQ keepend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+{+ end=+}[ecgimopsx]*+ contained contains=@perlInterpDQ,perlBracesDQ keepend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+<+ end=+>[ecgimopsx]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend
|
||||
syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[ecgimopsx]*+ contained contains=@perlInterpSQ keepend
|
||||
|
||||
" Translations
|
||||
" perlMatch is the first part, perlTranslation* is the second, translator part.
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\>\s*\z([^[:space:]([{<#]\)+ end=+\z1+me=e-1 contains=@perlInterpSQ nextgroup=perlTranslationGQ
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)#+ end=+#+me=e-1 contains=@perlInterpSQ nextgroup=perlTranslationGQ
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*\[+ end=+\]+ contains=@perlInterpSQ,perlBracketsSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*(+ end=+)+ contains=@perlInterpSQ,perlParensSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!\%(tr\|y\)\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ nextgroup=perlTranslationGQ skipwhite skipempty skipnl
|
||||
syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]([{<]\)+ end=+\z1[cds]*+ contained
|
||||
syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+(+ end=+)[cds]*+ contains=perlParensSQ contained
|
||||
syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][cds]*+ contains=perlBracketsSQ contained
|
||||
syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+{+ end=+}[cds]*+ contains=perlBracesSQ contained
|
||||
syn region perlTranslationGQ matchgroup=perlMatchStartEnd start=+<+ end=+>[cds]*+ contains=perlAnglesSQ contained
|
||||
|
||||
|
||||
" Strings and q, qq, qw and qr expressions
|
||||
|
||||
syn region perlStringUnexpanded matchgroup=perlStringStartEnd start="'" end="'" contains=@perlInterpSQ keepend
|
||||
syn region perlString matchgroup=perlStringStartEnd start=+"+ end=+"+ contains=@perlInterpDQ keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\>\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpSQ keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q#+ end=+#+ contains=@perlInterpSQ keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*(+ end=+)+ contains=@perlInterpSQ,perlParensSQ keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*\[+ end=+\]+ contains=@perlInterpSQ,perlBracketsSQ keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ keepend
|
||||
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\>\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpDQ keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]#+ end=+#+ contains=@perlInterpDQ keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\s*(+ end=+)+ contains=@perlInterpDQ,perlParensDQ keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\s*\[+ end=+\]+ contains=@perlInterpDQ,perlBracketsDQ keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\s*{+ end=+}+ contains=@perlInterpDQ,perlBracesDQ keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!q[qx]\s*<+ end=+>+ contains=@perlInterpDQ,perlAnglesDQ keepend
|
||||
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*\z([^[:space:]#([{<]\)+ end=+\z1+ contains=@perlInterpSQ keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw#+ end=+#+ contains=@perlInterpSQ keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*(+ end=+)+ contains=@perlInterpSQ,perlParensSQ keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*\[+ end=+\]+ contains=@perlInterpSQ,perlBracketsSQ keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ keepend
|
||||
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\>\s*\z([^[:space:]#([{<'/]\)+ end=+\z1[imosx]*+ contains=@perlInterpMatch keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*/+ end=+/[imosx]*+ contains=@perlInterpSlash keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr#+ end=+#[imosx]*+ contains=@perlInterpMatch keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*'+ end=+'[imosx]*+ contains=@perlInterpSQ keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*(+ end=+)[imosx]*+ contains=@perlInterpMatch,perlParensDQ keepend
|
||||
|
||||
" A special case for qr{}, qr<> and qr[] which allows for comments and extra whitespace in the pattern
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*{+ end=+}[imosx]*+ contains=@perlInterpMatch,perlBracesDQ,perlComment keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*<+ end=+>[imosx]*+ contains=@perlInterpMatch,perlAnglesDQ,perlComment keepend
|
||||
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*\[+ end=+\][imosx]*+ contains=@perlInterpMatch,perlBracketsDQ,perlComment keepend
|
||||
|
||||
" Constructs such as print <<EOF [...] EOF, 'here' documents
|
||||
"
|
||||
" 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
|
||||
" seems due to the 'auto-extending nature' of regions.
|
||||
if exists("perl_fold")
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\).*+ end=+^\z1$+ contains=@perlInterpDQ fold
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ fold
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ fold
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine fold
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine fold
|
||||
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL fold
|
||||
else
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\)+ end=+^\z1$+ contains=@perlInterpDQ
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine
|
||||
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine
|
||||
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL
|
||||
endif
|
||||
|
||||
|
||||
" Class declarations
|
||||
"
|
||||
syn match perlPackageDecl "\<package\s\+\%(\h\|::\)\%(\w\|::\)*" contains=perlStatementPackage
|
||||
syn keyword perlStatementPackage package contained
|
||||
|
||||
" Functions
|
||||
"
|
||||
syn match perlSubError "[^[:space:];{#]" contained
|
||||
if v:version == 701 && !has('patch221') " XXX I hope that's the right one
|
||||
syn match perlSubAttributes ":" contained
|
||||
else
|
||||
syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained
|
||||
syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ
|
||||
syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError
|
||||
syn match perlSubAttributes "" contained nextgroup=perlSubError
|
||||
syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
|
||||
endif
|
||||
syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
|
||||
syn match perlSubPrototype +(\_[^)]*)\_s*\|+ nextgroup=perlSubAttributes contained contains=perlSubPrototypeError
|
||||
syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype
|
||||
|
||||
syn match perlFunction +\<sub\>\_s*+ nextgroup=perlSubName
|
||||
|
||||
if !exists("perl_no_scope_in_variables")
|
||||
syn match perlFunctionPRef "\h\w*::" contained
|
||||
syn match perlFunctionName "\h\w*[^:]" contained
|
||||
else
|
||||
syn match perlFunctionName "\h[[:alnum:]_:]*" contained
|
||||
endif
|
||||
|
||||
" The => operator forces a bareword to the left of it to be interpreted as
|
||||
" a string
|
||||
syn match perlString "\<\I\i*\%(\s*=>\)\@="
|
||||
|
||||
" All other # are comments, except ^#!
|
||||
syn match perlComment "#.*" contains=perlTodo
|
||||
syn match perlSharpBang "^#!.*"
|
||||
|
||||
" Formats
|
||||
syn region perlFormat matchgroup=perlStatementIOFunc start="^\s*\<format\s\+\k\+\s*=\s*$"rs=s+6 end="^\s*\.\s*$" contains=perlFormatName,perlFormatField,perlVarPlain,perlVarPlain2
|
||||
syn match perlFormatName "format\s\+\k\+\s*="lc=7,me=e-1 contained
|
||||
syn match perlFormatField "[@^][|<>~]\+\%(\.\.\.\)\=" contained
|
||||
syn match perlFormatField "[@^]#[#.]*" contained
|
||||
syn match perlFormatField "@\*" contained
|
||||
syn match perlFormatField "@[^A-Za-z_|<>~#*]"me=e-1 contained
|
||||
syn match perlFormatField "@$" contained
|
||||
|
||||
" __END__ and __DATA__ clauses
|
||||
if exists("perl_fold")
|
||||
syntax region perlDATA start="^__\%(DATA\|END\)__$" skip="." end="." contains=perlPOD,@perlDATA fold
|
||||
else
|
||||
syntax region perlDATA start="^__\%(DATA\|END\)__$" skip="." end="." contains=perlPOD,@perlDATA
|
||||
endif
|
||||
|
||||
|
||||
"
|
||||
" Folding
|
||||
|
||||
if exists("perl_fold")
|
||||
if !exists("perl_nofold_packages")
|
||||
syn region perlPackageFold start="^package \S\+;\s*\%(#.*\)\=$" end="^1;\=\s*\%(#.*\)\=$" end="\n\+package"me=s-1 transparent fold keepend
|
||||
endif
|
||||
if !exists("perl_nofold_subs")
|
||||
syn region perlSubFold start="^\z(\s*\)\<sub\>.*[^};]$" end="^\z1}\s*\%(#.*\)\=$" transparent fold keepend
|
||||
syn region perlSubFold start="^\z(\s*\)\<\%(BEGIN\|END\|CHECK\|INIT\|UNITCHECK\)\>.*[^};]$" end="^\z1}\s*$" transparent fold keepend
|
||||
endif
|
||||
|
||||
if exists("perl_fold_blocks")
|
||||
syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)foreach\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
|
||||
syn region perlBlockFold start="^\z(\s*\)\%(do\|else\)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*while" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
|
||||
endif
|
||||
|
||||
setlocal foldmethod=syntax
|
||||
syn sync fromstart
|
||||
else
|
||||
" fromstart above seems to set minlines even if perl_fold is not set.
|
||||
syn sync minlines=0
|
||||
endif
|
||||
|
||||
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
|
||||
" The default highlighting.
|
||||
HiLink perlSharpBang PreProc
|
||||
HiLink perlControl PreProc
|
||||
HiLink perlInclude Include
|
||||
HiLink perlSpecial Special
|
||||
HiLink perlString String
|
||||
HiLink perlCharacter Character
|
||||
HiLink perlNumber Number
|
||||
HiLink perlFloat Float
|
||||
HiLink perlType Type
|
||||
HiLink perlIdentifier Identifier
|
||||
HiLink perlLabel Label
|
||||
HiLink perlStatement Statement
|
||||
HiLink perlConditional Conditional
|
||||
HiLink perlRepeat Repeat
|
||||
HiLink perlOperator Operator
|
||||
HiLink perlFunction Keyword
|
||||
HiLink perlSubName Function
|
||||
HiLink perlSubPrototype Type
|
||||
HiLink perlSubAttributes PreProc
|
||||
HiLink perlSubAttributesCont perlSubAttributes
|
||||
HiLink perlComment Comment
|
||||
HiLink perlTodo Todo
|
||||
if exists("perl_string_as_statement")
|
||||
HiLink perlStringStartEnd perlStatement
|
||||
else
|
||||
HiLink perlStringStartEnd perlString
|
||||
endif
|
||||
HiLink perlVStringV perlStringStartEnd
|
||||
HiLink perlList perlStatement
|
||||
HiLink perlMisc perlStatement
|
||||
HiLink perlVarPlain perlIdentifier
|
||||
HiLink perlVarPlain2 perlIdentifier
|
||||
HiLink perlArrow perlIdentifier
|
||||
HiLink perlFiledescRead perlIdentifier
|
||||
HiLink perlFiledescStatement perlIdentifier
|
||||
HiLink perlVarSimpleMember perlIdentifier
|
||||
HiLink perlVarSimpleMemberName perlString
|
||||
HiLink perlVarNotInMatches perlIdentifier
|
||||
HiLink perlVarSlash perlIdentifier
|
||||
HiLink perlQQ perlString
|
||||
HiLink perlHereDoc perlString
|
||||
HiLink perlStringUnexpanded perlString
|
||||
HiLink perlSubstitutionSQ perlString
|
||||
HiLink perlSubstitutionGQQ perlString
|
||||
HiLink perlTranslationGQ perlString
|
||||
HiLink perlMatch perlString
|
||||
HiLink perlMatchStartEnd perlStatement
|
||||
HiLink perlFormatName perlIdentifier
|
||||
HiLink perlFormatField perlString
|
||||
HiLink perlPackageDecl perlType
|
||||
HiLink perlStorageClass perlType
|
||||
HiLink perlPackageRef perlType
|
||||
HiLink perlStatementPackage perlStatement
|
||||
HiLink perlStatementStorage perlStatement
|
||||
HiLink perlStatementControl perlStatement
|
||||
HiLink perlStatementScalar perlStatement
|
||||
HiLink perlStatementRegexp perlStatement
|
||||
HiLink perlStatementNumeric perlStatement
|
||||
HiLink perlStatementList perlStatement
|
||||
HiLink perlStatementHash perlStatement
|
||||
HiLink perlStatementIOfunc perlStatement
|
||||
HiLink perlStatementFiledesc perlStatement
|
||||
HiLink perlStatementVector perlStatement
|
||||
HiLink perlStatementFiles perlStatement
|
||||
HiLink perlStatementFlow perlStatement
|
||||
HiLink perlStatementInclude perlStatement
|
||||
HiLink perlStatementProc perlStatement
|
||||
HiLink perlStatementSocket perlStatement
|
||||
HiLink perlStatementIPC perlStatement
|
||||
HiLink perlStatementNetwork perlStatement
|
||||
HiLink perlStatementPword perlStatement
|
||||
HiLink perlStatementTime perlStatement
|
||||
HiLink perlStatementMisc perlStatement
|
||||
HiLink perlStatementIndirObj perlStatement
|
||||
HiLink perlFunctionName perlIdentifier
|
||||
HiLink perlMethod perlIdentifier
|
||||
HiLink perlFunctionPRef perlType
|
||||
HiLink perlPOD perlComment
|
||||
HiLink perlShellCommand perlString
|
||||
HiLink perlSpecialAscii perlSpecial
|
||||
HiLink perlSpecialDollar perlSpecial
|
||||
HiLink perlSpecialString perlSpecial
|
||||
HiLink perlSpecialStringU perlSpecial
|
||||
HiLink perlSpecialMatch perlSpecial
|
||||
HiLink perlDATA perlComment
|
||||
|
||||
" Possible errors
|
||||
HiLink perlNotEmptyLine Error
|
||||
HiLink perlElseIfError Error
|
||||
HiLink perlSubPrototypeError Error
|
||||
HiLink perlSubError Error
|
||||
|
||||
delcommand HiLink
|
||||
|
||||
" Syncing to speed up processing
|
||||
"
|
||||
if !exists("perl_no_sync_on_sub")
|
||||
syn sync match perlSync grouphere NONE "^\s*\<package\s"
|
||||
syn sync match perlSync grouphere NONE "^\s*\<sub\>"
|
||||
syn sync match perlSync grouphere NONE "^}"
|
||||
endif
|
||||
|
||||
if !exists("perl_no_sync_on_global_var")
|
||||
syn sync match perlSync grouphere NONE "^$\I[[:alnum:]_:]+\s*=\s*{"
|
||||
syn sync match perlSync grouphere NONE "^[@%]\I[[:alnum:]_:]+\s*=\s*("
|
||||
endif
|
||||
|
||||
if exists("perl_sync_dist")
|
||||
execute "syn sync maxlines=" . perl_sync_dist
|
||||
else
|
||||
syn sync maxlines=100
|
||||
endif
|
||||
|
||||
syn sync match perlSyncPOD grouphere perlPOD "^=pod"
|
||||
syn sync match perlSyncPOD grouphere perlPOD "^=head"
|
||||
syn sync match perlSyncPOD grouphere perlPOD "^=item"
|
||||
syn sync match perlSyncPOD grouphere NONE "^=cut"
|
||||
|
||||
let b:current_syntax = "perl"
|
||||
|
||||
" vim: ts=8
|
||||
246
.vim/syntax/php.vim
Normal file
246
.vim/syntax/php.vim
Normal file
@@ -0,0 +1,246 @@
|
||||
" Vim syntax file
|
||||
" Language: JavaScript
|
||||
" Maintainer: Yi Zhao (ZHAOYI) <zzlinux AT hotmail DOT com>
|
||||
" Last Change: June 4, 2009
|
||||
" Version: 0.7.7
|
||||
" Changes: Add "undefined" as a type keyword
|
||||
"
|
||||
" TODO:
|
||||
" - Add the HTML syntax inside the JSDoc
|
||||
|
||||
if !exists("main_syntax")
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
let main_syntax = 'javascript'
|
||||
endif
|
||||
|
||||
"" Drop fold if it set but VIM doesn't support it.
|
||||
let b:javascript_fold='true'
|
||||
if version < 600 " Don't support the old version
|
||||
unlet! b:javascript_fold
|
||||
endif
|
||||
|
||||
"" dollar sigh is permittd anywhere in an identifier
|
||||
setlocal iskeyword+=$
|
||||
|
||||
syntax sync fromstart
|
||||
|
||||
"" JavaScript comments
|
||||
syntax keyword javaScriptCommentTodo TODO FIXME XXX TBD contained
|
||||
syntax region javaScriptLineComment start=+\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell
|
||||
syntax region javaScriptLineComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell fold
|
||||
syntax region javaScriptCvsTag start="\$\cid:" end="\$" oneline contained
|
||||
syntax region javaScriptComment start="/\*" end="\*/" contains=javaScriptCommentTodo,javaScriptCvsTag,@Spell fold
|
||||
|
||||
"" JSDoc support start
|
||||
if !exists("javascript_ignore_javaScriptdoc")
|
||||
syntax case ignore
|
||||
|
||||
"" syntax coloring for javadoc comments (HTML)
|
||||
"syntax include @javaHtml <sfile>:p:h/html.vim
|
||||
"unlet b:current_syntax
|
||||
|
||||
syntax region javaScriptDocComment matchgroup=javaScriptComment start="/\*\*\s*$" end="\*/" contains=javaScriptDocTags,javaScriptCommentTodo,javaScriptCvsTag,@javaScriptHtml,@Spell fold
|
||||
syntax match javaScriptDocTags contained "@\(param\|argument\|requires\|exception\|throws\|type\|class\|extends\|see\|link\|member\|module\|method\|title\|namespace\|optional\|default\|base\|file\)\>" nextgroup=javaScriptDocParam,javaScriptDocSeeTag skipwhite
|
||||
syntax match javaScriptDocTags contained "@\(beta\|deprecated\|description\|fileoverview\|author\|license\|version\|returns\=\|constructor\|private\|protected\|final\|ignore\|addon\|exec\)\>"
|
||||
syntax match javaScriptDocParam contained "\%(#\|\w\|\.\|:\|\/\)\+"
|
||||
syntax region javaScriptDocSeeTag contained matchgroup=javaScriptDocSeeTag start="{" end="}" contains=javaScriptDocTags
|
||||
|
||||
syntax case match
|
||||
endif "" JSDoc end
|
||||
|
||||
syntax case match
|
||||
|
||||
"" Syntax in the JavaScript code
|
||||
syntax match javaScriptSpecial "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\."
|
||||
syntax region javaScriptStringD start=+"+ skip=+\\\\\|\\$"+ end=+"+ contains=javaScriptSpecial,@htmlPreproc
|
||||
syntax region javaScriptStringS start=+'+ skip=+\\\\\|\\$'+ end=+'+ contains=javaScriptSpecial,@htmlPreproc
|
||||
syntax region javaScriptRegexpString start=+/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gim]\{,3}+ contains=javaScriptSpecial,@htmlPreproc oneline
|
||||
syntax match javaScriptNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
|
||||
syntax match javaScriptFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
|
||||
syntax match javaScriptLabel /\(?\s*\)\@<!\<\w\+\(\s*:\)\@=/
|
||||
|
||||
"" JavaScript Prototype
|
||||
syntax keyword javaScriptPrototype prototype
|
||||
|
||||
"" Programm Keywords
|
||||
syntax keyword javaScriptSource import export
|
||||
syntax keyword javaScriptType const this undefined var void yield
|
||||
syntax keyword javaScriptOperator delete new in instanceof let typeof
|
||||
syntax keyword javaScriptBoolean true false
|
||||
syntax keyword javaScriptNull null
|
||||
|
||||
"" Statement Keywords
|
||||
syntax keyword javaScriptConditional if else
|
||||
syntax keyword javaScriptRepeat do while for
|
||||
syntax keyword javaScriptBranch break continue switch case default return
|
||||
syntax keyword javaScriptStatement try catch throw with finally
|
||||
|
||||
syntax keyword javaScriptGlobalObjects Array Boolean Date Function Infinity JavaArray JavaClass JavaObject JavaPackage Math Number NaN Object Packages RegExp String Undefined java netscape sun
|
||||
|
||||
syntax keyword javaScriptExceptions Error EvalError RangeError ReferenceError SyntaxError TypeError URIError
|
||||
|
||||
syntax keyword javaScriptFutureKeys abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public
|
||||
|
||||
"" DOM/HTML/CSS specified things
|
||||
|
||||
" DOM2 Objects
|
||||
syntax keyword javaScriptGlobalObjects DOMImplementation DocumentFragment Document Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction
|
||||
syntax keyword javaScriptExceptions DOMException
|
||||
|
||||
" DOM2 CONSTANT
|
||||
syntax keyword javaScriptDomErrNo INDEX_SIZE_ERR DOMSTRING_SIZE_ERR HIERARCHY_REQUEST_ERR WRONG_DOCUMENT_ERR INVALID_CHARACTER_ERR NO_DATA_ALLOWED_ERR NO_MODIFICATION_ALLOWED_ERR NOT_FOUND_ERR NOT_SUPPORTED_ERR INUSE_ATTRIBUTE_ERR INVALID_STATE_ERR SYNTAX_ERR INVALID_MODIFICATION_ERR NAMESPACE_ERR INVALID_ACCESS_ERR
|
||||
syntax keyword javaScriptDomNodeConsts ELEMENT_NODE ATTRIBUTE_NODE TEXT_NODE CDATA_SECTION_NODE ENTITY_REFERENCE_NODE ENTITY_NODE PROCESSING_INSTRUCTION_NODE COMMENT_NODE DOCUMENT_NODE DOCUMENT_TYPE_NODE DOCUMENT_FRAGMENT_NODE NOTATION_NODE
|
||||
|
||||
" HTML events and internal variables
|
||||
syntax case ignore
|
||||
syntax keyword javaScriptHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize
|
||||
syntax case match
|
||||
|
||||
" Follow stuff should be highligh within a special context
|
||||
" While it can't be handled with context depended with Regex based highlight
|
||||
" So, turn it off by default
|
||||
if exists("javascript_enable_domhtmlcss")
|
||||
|
||||
" DOM2 things
|
||||
syntax match javaScriptDomElemAttrs contained /\%(nodeName\|nodeValue\|nodeType\|parentNode\|childNodes\|firstChild\|lastChild\|previousSibling\|nextSibling\|attributes\|ownerDocument\|namespaceURI\|prefix\|localName\|tagName\)\>/
|
||||
syntax match javaScriptDomElemFuncs contained /\%(insertBefore\|replaceChild\|removeChild\|appendChild\|hasChildNodes\|cloneNode\|normalize\|isSupported\|hasAttributes\|getAttribute\|setAttribute\|removeAttribute\|getAttributeNode\|setAttributeNode\|removeAttributeNode\|getElementsByTagName\|getAttributeNS\|setAttributeNS\|removeAttributeNS\|getAttributeNodeNS\|setAttributeNodeNS\|getElementsByTagNameNS\|hasAttribute\|hasAttributeNS\)\>/ nextgroup=javaScriptParen skipwhite
|
||||
" HTML things
|
||||
syntax match javaScriptHtmlElemAttrs contained /\%(className\|clientHeight\|clientLeft\|clientTop\|clientWidth\|dir\|id\|innerHTML\|lang\|length\|offsetHeight\|offsetLeft\|offsetParent\|offsetTop\|offsetWidth\|scrollHeight\|scrollLeft\|scrollTop\|scrollWidth\|style\|tabIndex\|title\)\>/
|
||||
syntax match javaScriptHtmlElemFuncs contained /\%(blur\|click\|focus\|scrollIntoView\|addEventListener\|dispatchEvent\|removeEventListener\|item\)\>/ nextgroup=javaScriptParen skipwhite
|
||||
|
||||
" CSS Styles in JavaScript
|
||||
syntax keyword javaScriptCssStyles contained color font fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight letterSpacing lineBreak lineHeight quotes rubyAlign rubyOverhang rubyPosition
|
||||
syntax keyword javaScriptCssStyles contained textAlign textAlignLast textAutospace textDecoration textIndent textJustify textJustifyTrim textKashidaSpace textOverflowW6 textShadow textTransform textUnderlinePosition
|
||||
syntax keyword javaScriptCssStyles contained unicodeBidi whiteSpace wordBreak wordSpacing wordWrap writingMode
|
||||
syntax keyword javaScriptCssStyles contained bottom height left position right top width zIndex
|
||||
syntax keyword javaScriptCssStyles contained border borderBottom borderLeft borderRight borderTop borderBottomColor borderLeftColor borderTopColor borderBottomStyle borderLeftStyle borderRightStyle borderTopStyle borderBottomWidth borderLeftWidth borderRightWidth borderTopWidth borderColor borderStyle borderWidth borderCollapse borderSpacing captionSide emptyCells tableLayout
|
||||
syntax keyword javaScriptCssStyles contained margin marginBottom marginLeft marginRight marginTop outline outlineColor outlineStyle outlineWidth padding paddingBottom paddingLeft paddingRight paddingTop
|
||||
syntax keyword javaScriptCssStyles contained listStyle listStyleImage listStylePosition listStyleType
|
||||
syntax keyword javaScriptCssStyles contained background backgroundAttachment backgroundColor backgroundImage gackgroundPosition backgroundPositionX backgroundPositionY backgroundRepeat
|
||||
syntax keyword javaScriptCssStyles contained clear clip clipBottom clipLeft clipRight clipTop content counterIncrement counterReset cssFloat cursor direction display filter layoutGrid layoutGridChar layoutGridLine layoutGridMode layoutGridType
|
||||
syntax keyword javaScriptCssStyles contained marks maxHeight maxWidth minHeight minWidth opacity MozOpacity overflow overflowX overflowY verticalAlign visibility zoom cssText
|
||||
syntax keyword javaScriptCssStyles contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor
|
||||
|
||||
" Highlight ways
|
||||
syntax match javaScriptDotNotation "\." nextgroup=javaScriptPrototype,javaScriptDomElemAttrs,javaScriptDomElemFuncs,javaScriptHtmlElemAttrs,javaScriptHtmlElemFuncs
|
||||
syntax match javaScriptDotNotation "\.style\." nextgroup=javaScriptCssStyles
|
||||
|
||||
endif "DOM/HTML/CSS
|
||||
|
||||
"" end DOM/HTML/CSS specified things
|
||||
|
||||
|
||||
"" Code blocks
|
||||
syntax cluster javaScriptAll contains=javaScriptComment,javaScriptLineComment,javaScriptDocComment,javaScriptStringD,javaScriptStringS,javaScriptRegexpString,javaScriptNumber,javaScriptFloat,javaScriptLabel,javaScriptSource,javaScriptType,javaScriptOperator,javaScriptBoolean,javaScriptNull,javaScriptFunction,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptStatement,javaScriptGlobalObjects,javaScriptExceptions,javaScriptFutureKeys,javaScriptDomErrNo,javaScriptDomNodeConsts,javaScriptHtmlEvents,javaScriptDotNotation
|
||||
syntax region javaScriptBracket matchgroup=javaScriptBracket transparent start="\[" end="\]" contains=@javaScriptAll,javaScriptParensErrB,javaScriptParensErrC,javaScriptBracket,javaScriptParen,javaScriptBlock,@htmlPreproc
|
||||
syntax region javaScriptParen matchgroup=javaScriptParen transparent start="(" end=")" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrC,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc
|
||||
syntax region javaScriptBlock matchgroup=javaScriptBlock transparent start="{" end="}" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc
|
||||
|
||||
"" catch errors caused by wrong parenthesis
|
||||
syntax match javaScriptParensError ")\|}\|\]"
|
||||
syntax match javaScriptParensErrA contained "\]"
|
||||
syntax match javaScriptParensErrB contained ")"
|
||||
syntax match javaScriptParensErrC contained "}"
|
||||
|
||||
if main_syntax == "javascript"
|
||||
syntax sync clear
|
||||
syntax sync ccomment javaScriptComment minlines=200
|
||||
syntax sync match javaScriptHighlight grouphere javaScriptBlock /{/
|
||||
endif
|
||||
|
||||
"" Fold control
|
||||
if exists("b:javascript_fold")
|
||||
syntax match javaScriptFunction /\<function\>/ nextgroup=javaScriptFuncName skipwhite
|
||||
syntax match javaScriptOpAssign /=\@<!=/ nextgroup=javaScriptFuncBlock skipwhite skipempty
|
||||
syntax region javaScriptFuncName contained matchgroup=javaScriptFuncName start=/\%(\$\|\w\)*\s*(/ end=/)/ contains=javaScriptLineComment,javaScriptComment nextgroup=javaScriptFuncBlock skipwhite skipempty
|
||||
syntax region javaScriptFuncBlock contained matchgroup=javaScriptFuncBlock start="{" end="}" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock fold
|
||||
|
||||
if &l:filetype=='javascript' && !&diff
|
||||
" Fold setting
|
||||
" Redefine the foldtext (to show a JS function outline) and foldlevel
|
||||
" only if the entire buffer is JavaScript, but not if JavaScript syntax
|
||||
" is embedded in another syntax (e.g. HTML).
|
||||
setlocal foldmethod=syntax
|
||||
setlocal foldlevel=4
|
||||
endif
|
||||
else
|
||||
syntax keyword javaScriptFunction function
|
||||
setlocal foldmethod<
|
||||
setlocal foldlevel<
|
||||
endif
|
||||
|
||||
" Define the default highlighting.
|
||||
" For version 5.7 and earlier: only when not done already
|
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||
if version >= 508 || !exists("did_javascript_syn_inits")
|
||||
if version < 508
|
||||
let did_javascript_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
HiLink javaScriptComment Comment
|
||||
HiLink javaScriptLineComment Comment
|
||||
HiLink javaScriptDocComment Comment
|
||||
HiLink javaScriptCommentTodo Todo
|
||||
HiLink javaScriptCvsTag Function
|
||||
HiLink javaScriptDocTags Special
|
||||
HiLink javaScriptDocSeeTag Function
|
||||
HiLink javaScriptDocParam Function
|
||||
HiLink javaScriptStringS String
|
||||
HiLink javaScriptStringD String
|
||||
HiLink javaScriptRegexpString String
|
||||
HiLink javaScriptCharacter Character
|
||||
HiLink javaScriptPrototype Type
|
||||
HiLink javaScriptConditional Conditional
|
||||
HiLink javaScriptBranch Conditional
|
||||
HiLink javaScriptRepeat Repeat
|
||||
HiLink javaScriptStatement Statement
|
||||
HiLink javaScriptFunction Function
|
||||
HiLink javaScriptError Error
|
||||
HiLink javaScriptParensError Error
|
||||
HiLink javaScriptParensErrA Error
|
||||
HiLink javaScriptParensErrB Error
|
||||
HiLink javaScriptParensErrC Error
|
||||
HiLink javaScriptOperator Operator
|
||||
HiLink javaScriptType Type
|
||||
HiLink javaScriptNull Type
|
||||
HiLink javaScriptNumber Number
|
||||
HiLink javaScriptFloat Number
|
||||
HiLink javaScriptBoolean Boolean
|
||||
HiLink javaScriptLabel Label
|
||||
HiLink javaScriptSpecial Special
|
||||
HiLink javaScriptSource Special
|
||||
HiLink javaScriptGlobalObjects Special
|
||||
HiLink javaScriptExceptions Special
|
||||
|
||||
HiLink javaScriptDomErrNo Constant
|
||||
HiLink javaScriptDomNodeConsts Constant
|
||||
HiLink javaScriptDomElemAttrs Label
|
||||
HiLink javaScriptDomElemFuncs PreProc
|
||||
|
||||
HiLink javaScriptHtmlEvents Special
|
||||
HiLink javaScriptHtmlElemAttrs Label
|
||||
HiLink javaScriptHtmlElemFuncs PreProc
|
||||
|
||||
HiLink javaScriptCssStyles Label
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
" Define the htmlJavaScript for HTML syntax html.vim
|
||||
"syntax clear htmlJavaScript
|
||||
"syntax clear javaScriptExpression
|
||||
syntax cluster htmlJavaScript contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError
|
||||
syntax cluster javaScriptExpression contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError,@htmlPreproc
|
||||
|
||||
let b:current_syntax = "javascript"
|
||||
if main_syntax == 'javascript'
|
||||
unlet main_syntax
|
||||
endif
|
||||
|
||||
" vim: ts=4
|
||||
0
.vim/syntax/pyrex.vim
Executable file
0
.vim/syntax/pyrex.vim
Executable file
374
.vim/syntax/python.vim
Normal file
374
.vim/syntax/python.vim
Normal file
@@ -0,0 +1,374 @@
|
||||
" Vim syntax file
|
||||
" Language: Python
|
||||
" Maintainer: Dmitry Vasiliev <dima@hlabs.spb.ru>
|
||||
" URL: http://www.hlabs.spb.ru/vim/python.vim
|
||||
" Last Change: 2010-04-09
|
||||
" Filenames: *.py
|
||||
" Version: 2.6.6
|
||||
"
|
||||
" Based on python.vim (from Vim 6.1 distribution)
|
||||
" by Neil Schemenauer <nas@python.ca>
|
||||
"
|
||||
" Thanks:
|
||||
"
|
||||
" Jeroen Ruigrok van der Werven
|
||||
" for the idea to highlight erroneous operators
|
||||
" Pedro Algarvio
|
||||
" for the patch to enable spell checking only for the right spots
|
||||
" (strings and comments)
|
||||
" John Eikenberry
|
||||
" for the patch fixing small typo
|
||||
" Caleb Adamantine
|
||||
" for the patch fixing highlighting for decorators
|
||||
" Andrea Riciputi
|
||||
" for the patch with new configuration options
|
||||
|
||||
"
|
||||
" Options:
|
||||
"
|
||||
" For set option do: let OPTION_NAME = 1
|
||||
" For clear option do: let OPTION_NAME = 0
|
||||
"
|
||||
" Option names:
|
||||
"
|
||||
" For highlight builtin functions and objects:
|
||||
" python_highlight_builtins
|
||||
"
|
||||
" For highlight builtin objects:
|
||||
" python_highlight_builtin_objs
|
||||
"
|
||||
" For highlight builtin funtions:
|
||||
" python_highlight_builtin_funcs
|
||||
"
|
||||
" For highlight standard exceptions:
|
||||
" python_highlight_exceptions
|
||||
"
|
||||
" For highlight string formatting:
|
||||
" python_highlight_string_formatting
|
||||
"
|
||||
" For highlight str.format syntax:
|
||||
" python_highlight_string_format
|
||||
"
|
||||
" For highlight string.Template syntax:
|
||||
" python_highlight_string_templates
|
||||
"
|
||||
" For highlight indentation errors:
|
||||
" python_highlight_indent_errors
|
||||
"
|
||||
" For highlight trailing spaces:
|
||||
" python_highlight_space_errors
|
||||
"
|
||||
" For highlight doc-tests:
|
||||
" python_highlight_doctests
|
||||
"
|
||||
" If you want all Python highlightings above:
|
||||
" python_highlight_all
|
||||
" (This option not override previously set options)
|
||||
"
|
||||
" For fast machines:
|
||||
" python_slow_sync
|
||||
"
|
||||
" For "print" builtin as function:
|
||||
" python_print_as_function
|
||||
|
||||
" 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("python_highlight_all") && python_highlight_all != 0
|
||||
" Not override previously set options
|
||||
if !exists("python_highlight_builtins")
|
||||
if !exists("python_highlight_builtin_objs")
|
||||
let python_highlight_builtin_objs = 1
|
||||
endif
|
||||
if !exists("python_highlight_builtin_funcs")
|
||||
let python_highlight_builtin_funcs = 1
|
||||
endif
|
||||
endif
|
||||
if !exists("python_highlight_exceptions")
|
||||
let python_highlight_exceptions = 1
|
||||
endif
|
||||
if !exists("python_highlight_string_formatting")
|
||||
let python_highlight_string_formatting = 1
|
||||
endif
|
||||
if !exists("python_highlight_string_format")
|
||||
let python_highlight_string_format = 1
|
||||
endif
|
||||
if !exists("python_highlight_string_templates")
|
||||
let python_highlight_string_templates = 1
|
||||
endif
|
||||
if !exists("python_highlight_indent_errors")
|
||||
let python_highlight_indent_errors = 1
|
||||
endif
|
||||
if !exists("python_highlight_space_errors")
|
||||
let python_highlight_space_errors = 1
|
||||
endif
|
||||
if !exists("python_highlight_doctests")
|
||||
let python_highlight_doctests = 1
|
||||
endif
|
||||
endif
|
||||
|
||||
" Keywords
|
||||
syn keyword pythonStatement break continue del
|
||||
syn keyword pythonStatement exec return
|
||||
syn keyword pythonStatement pass raise
|
||||
syn keyword pythonStatement global assert
|
||||
syn keyword pythonStatement lambda yield
|
||||
syn keyword pythonStatement with
|
||||
syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite
|
||||
syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" display contained
|
||||
syn keyword pythonRepeat for while
|
||||
syn keyword pythonConditional if elif else
|
||||
syn keyword pythonPreCondit import from as
|
||||
syn keyword pythonException try except finally
|
||||
syn keyword pythonOperator and in is not or
|
||||
|
||||
if !exists("python_print_as_function") || python_print_as_function == 0
|
||||
syn keyword pythonStatement print
|
||||
endif
|
||||
|
||||
" Decorators (new in Python 2.4)
|
||||
syn match pythonDecorator "@" display nextgroup=pythonDottedName skipwhite
|
||||
syn match pythonDottedName "[a-zA-Z_][a-zA-Z0-9_]*\(\.[a-zA-Z_][a-zA-Z0-9_]*\)*" display contained
|
||||
syn match pythonDot "\." display containedin=pythonDottedName
|
||||
|
||||
" Comments
|
||||
syn match pythonComment "#.*$" display contains=pythonTodo,@Spell
|
||||
syn match pythonRun "\%^#!.*$"
|
||||
syn match pythonCoding "\%^.*\(\n.*\)\?#.*coding[:=]\s*[0-9A-Za-z-_.]\+.*$"
|
||||
syn keyword pythonTodo TODO FIXME XXX contained
|
||||
|
||||
" Errors
|
||||
syn match pythonError "\<\d\+\D\+\>" display
|
||||
syn match pythonError "[$?]" display
|
||||
syn match pythonError "[&|]\{2,}" display
|
||||
syn match pythonError "[=]\{3,}" display
|
||||
|
||||
" TODO: Mixing spaces and tabs also may be used for pretty formatting multiline
|
||||
" statements. For now I don't know how to work around this.
|
||||
if exists("python_highlight_indent_errors") && python_highlight_indent_errors != 0
|
||||
syn match pythonIndentError "^\s*\( \t\|\t \)\s*\S"me=e-1 display
|
||||
endif
|
||||
|
||||
" Trailing space errors
|
||||
if exists("python_highlight_space_errors") && python_highlight_space_errors != 0
|
||||
syn match pythonSpaceError "\s\+$" display
|
||||
endif
|
||||
|
||||
" Strings
|
||||
syn region pythonString start=+[bB]\='+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonEscape,pythonEscapeError,@Spell
|
||||
syn region pythonString start=+[bB]\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonEscape,pythonEscapeError,@Spell
|
||||
syn region pythonString start=+[bB]\="""+ end=+"""+ keepend contains=pythonEscape,pythonEscapeError,pythonDocTest2,pythonSpaceError,@Spell
|
||||
syn region pythonString start=+[bB]\='''+ end=+'''+ keepend contains=pythonEscape,pythonEscapeError,pythonDocTest,pythonSpaceError,@Spell
|
||||
|
||||
syn match pythonEscape +\\[abfnrtv'"\\]+ display contained
|
||||
syn match pythonEscape "\\\o\o\=\o\=" display contained
|
||||
syn match pythonEscapeError "\\\o\{,2}[89]" display contained
|
||||
syn match pythonEscape "\\x\x\{2}" display contained
|
||||
syn match pythonEscapeError "\\x\x\=\X" display contained
|
||||
syn match pythonEscape "\\$"
|
||||
|
||||
" Unicode strings
|
||||
syn region pythonUniString start=+[uU]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError,@Spell
|
||||
syn region pythonUniString start=+[uU]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError,@Spell
|
||||
syn region pythonUniString start=+[uU]"""+ end=+"""+ keepend contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell
|
||||
syn region pythonUniString start=+[uU]'''+ end=+'''+ keepend contains=pythonEscape,pythonUniEscape,pythonEscapeError,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell
|
||||
|
||||
syn match pythonUniEscape "\\u\x\{4}" display contained
|
||||
syn match pythonUniEscapeError "\\u\x\{,3}\X" display contained
|
||||
syn match pythonUniEscape "\\U\x\{8}" display contained
|
||||
syn match pythonUniEscapeError "\\U\x\{,7}\X" display contained
|
||||
syn match pythonUniEscape "\\N{[A-Z ]\+}" display contained
|
||||
syn match pythonUniEscapeError "\\N{[^A-Z ]\+}" display contained
|
||||
|
||||
" Raw strings
|
||||
syn region pythonRawString start=+[rR]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonRawEscape,@Spell
|
||||
syn region pythonRawString start=+[rR]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonRawEscape,@Spell
|
||||
syn region pythonRawString start=+[rR]"""+ end=+"""+ keepend contains=pythonDocTest2,pythonSpaceError,@Spell
|
||||
syn region pythonRawString start=+[rR]'''+ end=+'''+ keepend contains=pythonDocTest,pythonSpaceError,@Spell
|
||||
|
||||
syn match pythonRawEscape +\\['"]+ display transparent contained
|
||||
|
||||
" Unicode raw strings
|
||||
syn region pythonUniRawString start=+[uU][rR]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError,@Spell
|
||||
syn region pythonUniRawString start=+[uU][rR]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError,@Spell
|
||||
syn region pythonUniRawString start=+[uU][rR]"""+ end=+"""+ keepend contains=pythonUniRawEscape,pythonUniRawEscapeError,pythonDocTest2,pythonSpaceError,@Spell
|
||||
syn region pythonUniRawString start=+[uU][rR]'''+ end=+'''+ keepend contains=pythonUniRawEscape,pythonUniRawEscapeError,pythonDocTest,pythonSpaceError,@Spell
|
||||
|
||||
syn match pythonUniRawEscape "\([^\\]\(\\\\\)*\)\@<=\\u\x\{4}" display contained
|
||||
syn match pythonUniRawEscapeError "\([^\\]\(\\\\\)*\)\@<=\\u\x\{,3}\X" display contained
|
||||
|
||||
if exists("python_highlight_string_formatting") && python_highlight_string_formatting != 0
|
||||
" String formatting
|
||||
syn match pythonStrFormatting "%\(([^)]\+)\)\=[-#0 +]*\d*\(\.\d\+\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString
|
||||
syn match pythonStrFormatting "%[-#0 +]*\(\*\|\d\+\)\=\(\.\(\*\|\d\+\)\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString
|
||||
endif
|
||||
|
||||
if exists("python_highlight_string_format") && python_highlight_string_format != 0
|
||||
" str.format syntax
|
||||
syn match pythonStrFormat "{{\|}}" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString
|
||||
syn match pythonStrFormat "{\([a-zA-Z_][a-zA-Z0-9_]*\|\d\+\)\(\.[a-zA-Z_][a-zA-Z0-9_]*\|\[\(\d\+\|[^!:\}]\+\)\]\)*\(![rs]\)\=\(:\({\([a-zA-Z_][a-zA-Z0-9_]*\|\d\+\)}\|\([^}]\=[<>=^]\)\=[ +-]\=#\=0\=\d*\(\.\d\+\)\=[bcdeEfFgGnoxX%]\=\)\=\)\=}" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString
|
||||
endif
|
||||
|
||||
if exists("python_highlight_string_templates") && python_highlight_string_templates != 0
|
||||
" String templates
|
||||
syn match pythonStrTemplate "\$\$" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString
|
||||
syn match pythonStrTemplate "\${[a-zA-Z_][a-zA-Z0-9_]*}" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString
|
||||
syn match pythonStrTemplate "\$[a-zA-Z_][a-zA-Z0-9_]*" contained containedin=pythonString,pythonUniString,pythonRawString,pythonUniRawString
|
||||
endif
|
||||
|
||||
if exists("python_highlight_doctests") && python_highlight_doctests != 0
|
||||
" DocTests
|
||||
syn region pythonDocTest start="^\s*>>>" end=+'''+he=s-1 end="^\s*$" contained
|
||||
syn region pythonDocTest2 start="^\s*>>>" end=+"""+he=s-1 end="^\s*$" contained
|
||||
endif
|
||||
|
||||
" Numbers (ints, longs, floats, complex)
|
||||
syn match pythonHexError "\<0[xX]\x*[g-zG-Z]\x*[lL]\=\>" display
|
||||
|
||||
syn match pythonHexNumber "\<0[xX]\x\+[lL]\=\>" display
|
||||
syn match pythonOctNumber "\<0[oO]\o\+[lL]\=\>" display
|
||||
syn match pythonBinNumber "\<0[bB][01]\+[lL]\=\>" display
|
||||
|
||||
syn match pythonNumber "\<\d\+[lLjJ]\=\>" display
|
||||
|
||||
syn match pythonFloat "\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>" display
|
||||
syn match pythonFloat "\<\d\+[eE][+-]\=\d\+[jJ]\=\>" display
|
||||
syn match pythonFloat "\<\d\+\.\d*\([eE][+-]\=\d\+\)\=[jJ]\=" display
|
||||
|
||||
syn match pythonOctError "\<0[oO]\=\o*[8-9]\d*[lL]\=\>" display
|
||||
syn match pythonBinError "\<0[bB][01]*[2-9]\d*[lL]\=\>" display
|
||||
|
||||
if exists("python_highlight_builtin_objs") && python_highlight_builtin_objs != 0
|
||||
" Builtin objects and types
|
||||
syn keyword pythonBuiltinObj True False Ellipsis None NotImplemented
|
||||
syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__
|
||||
endif
|
||||
|
||||
if exists("python_highlight_builtin_funcs") && python_highlight_builtin_funcs != 0
|
||||
" Builtin functions
|
||||
syn keyword pythonBuiltinFunc __import__ abs all any apply
|
||||
syn keyword pythonBuiltinFunc basestring bin bool buffer bytearray bytes callable
|
||||
syn keyword pythonBuiltinFunc chr classmethod cmp coerce compile complex
|
||||
syn keyword pythonBuiltinFunc delattr dict dir divmod enumerate eval
|
||||
syn keyword pythonBuiltinFunc execfile file filter float format frozenset getattr
|
||||
syn keyword pythonBuiltinFunc globals hasattr hash help hex id
|
||||
syn keyword pythonBuiltinFunc input int intern isinstance
|
||||
syn keyword pythonBuiltinFunc issubclass iter len list locals long map max
|
||||
syn keyword pythonBuiltinFunc min next object oct open ord
|
||||
syn keyword pythonBuiltinFunc pow property range
|
||||
syn keyword pythonBuiltinFunc raw_input reduce reload repr
|
||||
syn keyword pythonBuiltinFunc reversed round set setattr
|
||||
syn keyword pythonBuiltinFunc slice sorted staticmethod str sum super tuple
|
||||
syn keyword pythonBuiltinFunc type unichr unicode vars xrange zip
|
||||
|
||||
if exists("python_print_as_function") && python_print_as_function != 0
|
||||
syn keyword pythonBuiltinFunc print
|
||||
endif
|
||||
endif
|
||||
|
||||
if exists("python_highlight_exceptions") && python_highlight_exceptions != 0
|
||||
" Builtin exceptions and warnings
|
||||
syn keyword pythonExClass BaseException
|
||||
syn keyword pythonExClass Exception StandardError ArithmeticError
|
||||
syn keyword pythonExClass LookupError EnvironmentError
|
||||
|
||||
syn keyword pythonExClass AssertionError AttributeError BufferError EOFError
|
||||
syn keyword pythonExClass FloatingPointError GeneratorExit IOError
|
||||
syn keyword pythonExClass ImportError IndexError KeyError
|
||||
syn keyword pythonExClass KeyboardInterrupt MemoryError NameError
|
||||
syn keyword pythonExClass NotImplementedError OSError OverflowError
|
||||
syn keyword pythonExClass ReferenceError RuntimeError StopIteration
|
||||
syn keyword pythonExClass SyntaxError IndentationError TabError
|
||||
syn keyword pythonExClass SystemError SystemExit TypeError
|
||||
syn keyword pythonExClass UnboundLocalError UnicodeError
|
||||
syn keyword pythonExClass UnicodeEncodeError UnicodeDecodeError
|
||||
syn keyword pythonExClass UnicodeTranslateError ValueError VMSError
|
||||
syn keyword pythonExClass WindowsError ZeroDivisionError
|
||||
|
||||
syn keyword pythonExClass Warning UserWarning BytesWarning DeprecationWarning
|
||||
syn keyword pythonExClass PendingDepricationWarning SyntaxWarning
|
||||
syn keyword pythonExClass RuntimeWarning FutureWarning
|
||||
syn keyword pythonExClass ImportWarning UnicodeWarning
|
||||
endif
|
||||
|
||||
if exists("python_slow_sync") && python_slow_sync != 0
|
||||
syn sync minlines=2000
|
||||
else
|
||||
" This is fast but code inside triple quoted strings screws it up. It
|
||||
" is impossible to fix because the only way to know if you are inside a
|
||||
" triple quoted string is to start from the beginning of the file.
|
||||
syn sync match pythonSync grouphere NONE "):$"
|
||||
syn sync maxlines=200
|
||||
endif
|
||||
|
||||
if version >= 508 || !exists("did_python_syn_inits")
|
||||
if version <= 508
|
||||
let did_python_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
HiLink pythonStatement Statement
|
||||
HiLink pythonPreCondit Statement
|
||||
HiLink pythonFunction Function
|
||||
HiLink pythonConditional Conditional
|
||||
HiLink pythonRepeat Repeat
|
||||
HiLink pythonException Exception
|
||||
HiLink pythonOperator Operator
|
||||
|
||||
HiLink pythonDecorator Define
|
||||
HiLink pythonDottedName Function
|
||||
HiLink pythonDot Normal
|
||||
|
||||
HiLink pythonComment Comment
|
||||
HiLink pythonCoding Special
|
||||
HiLink pythonRun Special
|
||||
HiLink pythonTodo Todo
|
||||
|
||||
HiLink pythonError Error
|
||||
HiLink pythonIndentError Error
|
||||
HiLink pythonSpaceError Error
|
||||
|
||||
HiLink pythonString String
|
||||
HiLink pythonUniString String
|
||||
HiLink pythonRawString String
|
||||
HiLink pythonUniRawString String
|
||||
|
||||
HiLink pythonEscape Special
|
||||
HiLink pythonEscapeError Error
|
||||
HiLink pythonUniEscape Special
|
||||
HiLink pythonUniEscapeError Error
|
||||
HiLink pythonUniRawEscape Special
|
||||
HiLink pythonUniRawEscapeError Error
|
||||
|
||||
HiLink pythonStrFormatting Special
|
||||
HiLink pythonStrFormat Special
|
||||
HiLink pythonStrTemplate Special
|
||||
|
||||
HiLink pythonDocTest Special
|
||||
HiLink pythonDocTest2 Special
|
||||
|
||||
HiLink pythonNumber Number
|
||||
HiLink pythonHexNumber Number
|
||||
HiLink pythonOctNumber Number
|
||||
HiLink pythonBinNumber Number
|
||||
HiLink pythonFloat Float
|
||||
HiLink pythonOctError Error
|
||||
HiLink pythonHexError Error
|
||||
HiLink pythonBinError Error
|
||||
|
||||
HiLink pythonBuiltinObj Structure
|
||||
HiLink pythonBuiltinFunc Function
|
||||
|
||||
HiLink pythonExClass Structure
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "python"
|
||||
370
.vim/syntax/python3.0.vim
Normal file
370
.vim/syntax/python3.0.vim
Normal file
@@ -0,0 +1,370 @@
|
||||
" Vim syntax file
|
||||
" Language: Python
|
||||
" Maintainer: Dmitry Vasiliev <dima@hlabs.spb.ru>
|
||||
" URL: http://www.hlabs.spb.ru/vim/python3.0.vim
|
||||
" Last Change: 2010-11-14
|
||||
" Filenames: *.py
|
||||
" Version: 3.0.6
|
||||
"
|
||||
" Based on python.vim (from Vim 6.1 distribution)
|
||||
" by Neil Schemenauer <nas@python.ca>
|
||||
"
|
||||
" Thanks:
|
||||
"
|
||||
" Jeroen Ruigrok van der Werven
|
||||
" for the idea to highlight erroneous operators
|
||||
" Pedro Algarvio
|
||||
" for the patch to enable spell checking only for the right spots
|
||||
" (strings and comments)
|
||||
" John Eikenberry
|
||||
" for the patch fixing small typo
|
||||
" Caleb Adamantine
|
||||
" for the patch fixing highlighting for decorators
|
||||
" Andrea Riciputi
|
||||
" for the patch with new configuration options
|
||||
" Anton Butanaev
|
||||
" for the patch fixing bytes literals highlighting
|
||||
" for the patch fixing str.format syntax highlighting
|
||||
|
||||
"
|
||||
" Options:
|
||||
"
|
||||
" For set option do: let OPTION_NAME = 1
|
||||
" For clear option do: let OPTION_NAME = 0
|
||||
"
|
||||
" Option names:
|
||||
"
|
||||
" For highlight builtin functions:
|
||||
" python_highlight_builtins
|
||||
"
|
||||
" For highlight builtin objects:
|
||||
" python_highlight_builtin_objs
|
||||
"
|
||||
" For highlight builtin funtions:
|
||||
" python_highlight_builtin_funcs
|
||||
"
|
||||
" For highlight standard exceptions:
|
||||
" python_highlight_exceptions
|
||||
"
|
||||
" For highlight string formatting:
|
||||
" python_highlight_string_formatting
|
||||
"
|
||||
" For highlight str.format syntax:
|
||||
" python_highlight_string_format
|
||||
"
|
||||
" For highlight string.Template syntax:
|
||||
" python_highlight_string_templates
|
||||
"
|
||||
" For highlight indentation errors:
|
||||
" python_highlight_indent_errors
|
||||
"
|
||||
" For highlight trailing spaces:
|
||||
" python_highlight_space_errors
|
||||
"
|
||||
" For highlight doc-tests:
|
||||
" python_highlight_doctests
|
||||
"
|
||||
" If you want all Python highlightings above:
|
||||
" python_highlight_all
|
||||
" (This option not override previously set options)
|
||||
"
|
||||
" For fast machines:
|
||||
" python_slow_sync
|
||||
|
||||
" 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("python_highlight_all") && python_highlight_all != 0
|
||||
" Not override previously set options
|
||||
if !exists("python_highlight_builtins")
|
||||
if !exists("python_highlight_builtin_objs")
|
||||
let python_highlight_builtin_objs = 1
|
||||
endif
|
||||
if !exists("python_highlight_builtin_funcs")
|
||||
let python_highlight_builtin_funcs = 1
|
||||
endif
|
||||
endif
|
||||
if !exists("python_highlight_exceptions")
|
||||
let python_highlight_exceptions = 1
|
||||
endif
|
||||
if !exists("python_highlight_string_formatting")
|
||||
let python_highlight_string_formatting = 1
|
||||
endif
|
||||
if !exists("python_highlight_string_format")
|
||||
let python_highlight_string_format = 1
|
||||
endif
|
||||
if !exists("python_highlight_string_templates")
|
||||
let python_highlight_string_templates = 1
|
||||
endif
|
||||
if !exists("python_highlight_indent_errors")
|
||||
let python_highlight_indent_errors = 1
|
||||
endif
|
||||
if !exists("python_highlight_space_errors")
|
||||
let python_highlight_space_errors = 1
|
||||
endif
|
||||
if !exists("python_highlight_doctests")
|
||||
let python_highlight_doctests = 1
|
||||
endif
|
||||
endif
|
||||
|
||||
" Keywords
|
||||
syn keyword pythonStatement break continue del
|
||||
syn keyword pythonStatement exec return as
|
||||
syn keyword pythonStatement pass raise
|
||||
syn keyword pythonStatement global assert
|
||||
syn keyword pythonStatement lambda yield
|
||||
syn keyword pythonStatement with nonlocal
|
||||
syn keyword pythonStatement False None True
|
||||
syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite
|
||||
syn match pythonFunction "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
|
||||
syn keyword pythonRepeat for while
|
||||
syn keyword pythonConditional if elif else
|
||||
syn keyword pythonPreCondit import from
|
||||
syn keyword pythonException try except finally
|
||||
syn keyword pythonOperator and in is not or
|
||||
|
||||
" Decorators (new in Python 2.4)
|
||||
syn match pythonDecorator "@" display nextgroup=pythonDottedName skipwhite
|
||||
syn match pythonDottedName "[a-zA-Z_][a-zA-Z0-9_]*\(\.[a-zA-Z_][a-zA-Z0-9_]*\)*" display contained
|
||||
syn match pythonDot "\." display containedin=pythonDottedName
|
||||
|
||||
" Comments
|
||||
syn match pythonComment "#.*$" display contains=pythonTodo,@Spell
|
||||
syn match pythonRun "\%^#!.*$"
|
||||
syn match pythonCoding "\%^.*\%(\n.*\)\?#.*coding[:=]\s*[0-9A-Za-z-_.]\+.*$"
|
||||
syn keyword pythonTodo TODO FIXME XXX contained
|
||||
|
||||
" Errors
|
||||
syn match pythonError "\<\d\+\D\+\>" display
|
||||
syn match pythonError "[$?]" display
|
||||
syn match pythonError "[&|]\{2,}" display
|
||||
syn match pythonError "[=]\{3,}" display
|
||||
|
||||
" TODO: Mixing spaces and tabs also may be used for pretty formatting multiline
|
||||
" statements. For now I don't know how to work around this.
|
||||
if exists("python_highlight_indent_errors") && python_highlight_indent_errors != 0
|
||||
syn match pythonIndentError "^\s*\%( \t\|\t \)\s*\S"me=e-1 display
|
||||
endif
|
||||
|
||||
" Trailing space errors
|
||||
if exists("python_highlight_space_errors") && python_highlight_space_errors != 0
|
||||
syn match pythonSpaceError "\s\+$" display
|
||||
endif
|
||||
|
||||
" Strings
|
||||
syn region pythonString start=+'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonEscape,pythonEscapeError,@Spell
|
||||
syn region pythonString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonEscape,pythonEscapeError,@Spell
|
||||
syn region pythonString start=+"""+ end=+"""+ keepend contains=pythonEscape,pythonEscapeError,pythonDocTest2,pythonSpaceError,@Spell
|
||||
syn region pythonString start=+'''+ end=+'''+ keepend contains=pythonEscape,pythonEscapeError,pythonDocTest,pythonSpaceError,@Spell
|
||||
|
||||
syn match pythonEscape +\\[abfnrtv'"\\]+ display contained
|
||||
syn match pythonEscape "\\\o\o\=\o\=" display contained
|
||||
syn match pythonEscapeError "\\\o\{,2}[89]" display contained
|
||||
syn match pythonEscape "\\x\x\{2}" display contained
|
||||
syn match pythonEscapeError "\\x\x\=\X" display contained
|
||||
syn match pythonEscape "\\$"
|
||||
syn match pythonEscape "\\u\x\{4}" display contained
|
||||
syn match pythonEscapeError "\\u\x\{,3}\X" display contained
|
||||
syn match pythonEscape "\\U\x\{8}" display contained
|
||||
syn match pythonEscapeError "\\U\x\{,7}\X" display contained
|
||||
syn match pythonEscape "\\N{[A-Z ]\+}" display contained
|
||||
syn match pythonEscapeError "\\N{[^A-Z ]\+}" display contained
|
||||
|
||||
" Raw strings
|
||||
syn region pythonRawString start=+[bB]\=[rR]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonRawEscape,@Spell
|
||||
syn region pythonRawString start=+[bB]\=[rR]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonRawEscape,@Spell
|
||||
syn region pythonRawString start=+[bB]\=[rR]"""+ end=+"""+ keepend contains=pythonDocTest2,pythonSpaceError,@Spell
|
||||
syn region pythonRawString start=+[bB]\=[rR]'''+ end=+'''+ keepend contains=pythonDocTest,pythonSpaceError,@Spell
|
||||
|
||||
syn match pythonRawEscape +\\['"]+ display transparent contained
|
||||
|
||||
" Bytes
|
||||
syn region pythonBytes start=+[bB]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonBytesError,pythonBytesContent,@Spell
|
||||
syn region pythonBytes start=+[bB]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonBytesError,pythonBytesContent,@Spell
|
||||
syn region pythonBytes start=+[bB]"""+ end=+"""+ keepend contains=pythonBytesError,pythonBytesContent,pythonDocTest2,pythonSpaceError,@Spell
|
||||
syn region pythonBytes start=+[bB]'''+ end=+'''+ keepend contains=pythonBytesError,pythonBytesContent,pythonDocTest,pythonSpaceError,@Spell
|
||||
|
||||
syn match pythonBytesError ".\+" display contained
|
||||
syn match pythonBytesContent "[\u0000-\u00ff]\+" display contained contains=pythonBytesEscape,pythonBytesEscapeError
|
||||
|
||||
syn match pythonBytesEscape +\\[abfnrtv'"\\]+ display contained
|
||||
syn match pythonBytesEscape "\\\o\o\=\o\=" display contained
|
||||
syn match pythonBytesEscapeError "\\\o\{,2}[89]" display contained
|
||||
syn match pythonBytesEscape "\\x\x\{2}" display contained
|
||||
syn match pythonBytesEscapeError "\\x\x\=\X" display contained
|
||||
syn match pythonBytesEscape "\\$"
|
||||
|
||||
if exists("python_highlight_string_formatting") && python_highlight_string_formatting != 0
|
||||
" String formatting
|
||||
syn match pythonStrFormatting "%\%(([^)]\+)\)\=[-#0 +]*\d*\%(\.\d\+\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=pythonString,pythonRawString
|
||||
syn match pythonStrFormatting "%[-#0 +]*\%(\*\|\d\+\)\=\%(\.\%(\*\|\d\+\)\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=pythonString,pythonRawString
|
||||
endif
|
||||
|
||||
if exists("python_highlight_string_format") && python_highlight_string_format != 0
|
||||
" str.format syntax
|
||||
syn match pythonStrFormat "{{\|}}" contained containedin=pythonString,pythonRawString
|
||||
syn match pythonStrFormat "{\%(\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\d\+\)\=\%(\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\[\%(\d\+\|[^!:\}]\+\)\]\)*\%(![rsa]\)\=\%(:\%({\%(\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\d\+\)}\|\%([^}]\=[<>=^]\)\=[ +-]\=#\=0\=\d*,\=\%(\.\d\+\)\=[bcdeEfFgGnosxX%]\=\)\=\)\=}" contained containedin=pythonString,pythonRawString
|
||||
endif
|
||||
|
||||
if exists("python_highlight_string_templates") && python_highlight_string_templates != 0
|
||||
" String templates
|
||||
syn match pythonStrTemplate "\$\$" contained containedin=pythonString,pythonRawString
|
||||
syn match pythonStrTemplate "\${[a-zA-Z_][a-zA-Z0-9_]*}" contained containedin=pythonString,pythonRawString
|
||||
syn match pythonStrTemplate "\$[a-zA-Z_][a-zA-Z0-9_]*" contained containedin=pythonString,pythonRawString
|
||||
endif
|
||||
|
||||
if exists("python_highlight_doctests") && python_highlight_doctests != 0
|
||||
" DocTests
|
||||
syn region pythonDocTest start="^\s*>>>" end=+'''+he=s-1 end="^\s*$" contained
|
||||
syn region pythonDocTest2 start="^\s*>>>" end=+"""+he=s-1 end="^\s*$" contained
|
||||
endif
|
||||
|
||||
" Numbers (ints, longs, floats, complex)
|
||||
syn match pythonHexError "\<0[xX]\x*[g-zG-Z]\x*\>" display
|
||||
|
||||
syn match pythonHexNumber "\<0[xX]\x\+\>" display
|
||||
syn match pythonOctNumber "\<0[oO]\o\+\>" display
|
||||
syn match pythonBinNumber "\<0[bB][01]\+\>" display
|
||||
|
||||
syn match pythonNumberError "\<\d\+\D\>" display
|
||||
syn match pythonNumberError "\<0\d\+\>" display
|
||||
syn match pythonNumber "\<\d\>" display
|
||||
syn match pythonNumber "\<[1-9]\d\+\>" display
|
||||
syn match pythonNumber "\<\d\+[jJ]\>" display
|
||||
|
||||
syn match pythonFloat "\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>" display
|
||||
syn match pythonFloat "\<\d\+[eE][+-]\=\d\+[jJ]\=\>" display
|
||||
syn match pythonFloat "\<\d\+\.\d*\%([eE][+-]\=\d\+\)\=[jJ]\=" display
|
||||
|
||||
syn match pythonOctError "\<0[oO]\=\o*[8-9]\d*\>" display
|
||||
syn match pythonBinError "\<0[bB][01]*[2-9]\d*\>" display
|
||||
|
||||
if exists("python_highlight_builtin_objs") && python_highlight_builtin_objs != 0
|
||||
" Builtin objects and types
|
||||
syn keyword pythonBuiltinObj Ellipsis NotImplemented
|
||||
syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__
|
||||
endif
|
||||
|
||||
if exists("python_highlight_builtin_funcs") && python_highlight_builtin_funcs != 0
|
||||
" Builtin functions
|
||||
syn keyword pythonBuiltinFunc __import__ abs all any ascii
|
||||
syn keyword pythonBuiltinFunc bin bool bytearray bytes
|
||||
syn keyword pythonBuiltinFunc chr classmethod cmp compile complex
|
||||
syn keyword pythonBuiltinFunc delattr dict dir divmod enumerate eval
|
||||
syn keyword pythonBuiltinFunc exec filter float format frozenset getattr
|
||||
syn keyword pythonBuiltinFunc globals hasattr hash hex id
|
||||
syn keyword pythonBuiltinFunc input int isinstance
|
||||
syn keyword pythonBuiltinFunc issubclass iter len list locals map max
|
||||
syn keyword pythonBuiltinFunc memoryview min next object oct open ord
|
||||
syn keyword pythonBuiltinFunc pow print property range
|
||||
syn keyword pythonBuiltinFunc repr reversed round set setattr
|
||||
syn keyword pythonBuiltinFunc slice sorted staticmethod str sum super tuple
|
||||
syn keyword pythonBuiltinFunc type vars zip
|
||||
endif
|
||||
|
||||
if exists("python_highlight_exceptions") && python_highlight_exceptions != 0
|
||||
" Builtin exceptions and warnings
|
||||
syn keyword pythonExClass BaseException
|
||||
syn keyword pythonExClass Exception ArithmeticError
|
||||
syn keyword pythonExClass LookupError EnvironmentError
|
||||
|
||||
syn keyword pythonExClass AssertionError AttributeError BufferError EOFError
|
||||
syn keyword pythonExClass FloatingPointError GeneratorExit IOError
|
||||
syn keyword pythonExClass ImportError IndexError KeyError
|
||||
syn keyword pythonExClass KeyboardInterrupt MemoryError NameError
|
||||
syn keyword pythonExClass NotImplementedError OSError OverflowError
|
||||
syn keyword pythonExClass ReferenceError RuntimeError StopIteration
|
||||
syn keyword pythonExClass SyntaxError IndentationError TabError
|
||||
syn keyword pythonExClass SystemError SystemExit TypeError
|
||||
syn keyword pythonExClass UnboundLocalError UnicodeError
|
||||
syn keyword pythonExClass UnicodeEncodeError UnicodeDecodeError
|
||||
syn keyword pythonExClass UnicodeTranslateError ValueError VMSError
|
||||
syn keyword pythonExClass WindowsError ZeroDivisionError
|
||||
|
||||
syn keyword pythonExClass Warning UserWarning BytesWarning DeprecationWarning
|
||||
syn keyword pythonExClass PendingDepricationWarning SyntaxWarning
|
||||
syn keyword pythonExClass RuntimeWarning FutureWarning
|
||||
syn keyword pythonExClass ImportWarning UnicodeWarning
|
||||
endif
|
||||
|
||||
if exists("python_slow_sync") && python_slow_sync != 0
|
||||
syn sync minlines=2000
|
||||
else
|
||||
" This is fast but code inside triple quoted strings screws it up. It
|
||||
" is impossible to fix because the only way to know if you are inside a
|
||||
" triple quoted string is to start from the beginning of the file.
|
||||
syn sync match pythonSync grouphere NONE "):$"
|
||||
syn sync maxlines=200
|
||||
endif
|
||||
|
||||
if version >= 508 || !exists("did_python_syn_inits")
|
||||
if version <= 508
|
||||
let did_python_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
HiLink pythonStatement Statement
|
||||
HiLink pythonPreCondit Statement
|
||||
HiLink pythonFunction Function
|
||||
HiLink pythonConditional Conditional
|
||||
HiLink pythonRepeat Repeat
|
||||
HiLink pythonException Exception
|
||||
HiLink pythonOperator Operator
|
||||
|
||||
HiLink pythonDecorator Define
|
||||
HiLink pythonDottedName Function
|
||||
HiLink pythonDot Normal
|
||||
|
||||
HiLink pythonComment Comment
|
||||
HiLink pythonCoding Special
|
||||
HiLink pythonRun Special
|
||||
HiLink pythonTodo Todo
|
||||
|
||||
HiLink pythonError Error
|
||||
HiLink pythonIndentError Error
|
||||
HiLink pythonSpaceError Error
|
||||
|
||||
HiLink pythonString String
|
||||
HiLink pythonRawString String
|
||||
HiLink pythonEscape Special
|
||||
HiLink pythonEscapeError Error
|
||||
|
||||
HiLink pythonBytes String
|
||||
HiLink pythonBytesContent String
|
||||
HiLink pythonBytesError Error
|
||||
HiLink pythonBytesEscape Special
|
||||
HiLink pythonBytesEscapeError Error
|
||||
|
||||
HiLink pythonStrFormatting Special
|
||||
HiLink pythonStrFormat Special
|
||||
HiLink pythonStrTemplate Special
|
||||
|
||||
HiLink pythonDocTest Special
|
||||
HiLink pythonDocTest2 Special
|
||||
|
||||
HiLink pythonNumber Number
|
||||
HiLink pythonHexNumber Number
|
||||
HiLink pythonOctNumber Number
|
||||
HiLink pythonBinNumber Number
|
||||
HiLink pythonFloat Float
|
||||
HiLink pythonNumberError Error
|
||||
HiLink pythonOctError Error
|
||||
HiLink pythonHexError Error
|
||||
HiLink pythonBinError Error
|
||||
|
||||
HiLink pythonBuiltinObj Structure
|
||||
HiLink pythonBuiltinFunc Function
|
||||
|
||||
HiLink pythonExClass Structure
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "python"
|
||||
42
.vim/syntax/svkannotate.vim
Normal file
42
.vim/syntax/svkannotate.vim
Normal file
@@ -0,0 +1,42 @@
|
||||
" Vim syntax file
|
||||
" Language: SVK annotate output
|
||||
" Maintainer: Bob Hiestand <bob.hiestand@gmail.com>
|
||||
" Remark: Used by the vcscommand plugin.
|
||||
" License:
|
||||
" Copyright (c) Bob Hiestand
|
||||
"
|
||||
" 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.
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn match svkDate /\d\{4}-\d\{1,2}-\d\{1,2}/ skipwhite contained
|
||||
syn match svkName /(\s*\zs\S\+/ contained nextgroup=svkDate skipwhite
|
||||
syn match svkVer /^\s*\d\+/ contained nextgroup=svkName skipwhite
|
||||
syn region svkHead start=/^/ end="):" contains=svkVer,svkName,svkDate oneline
|
||||
|
||||
if !exists("did_svkannotate_syntax_inits")
|
||||
let did_svkannotate_syntax_inits = 1
|
||||
hi link svkName Type
|
||||
hi link svkDate Comment
|
||||
hi link svkVer Statement
|
||||
endif
|
||||
|
||||
let b:current_syntax="svkAnnotate"
|
||||
40
.vim/syntax/svnannotate.vim
Normal file
40
.vim/syntax/svnannotate.vim
Normal file
@@ -0,0 +1,40 @@
|
||||
" Vim syntax file
|
||||
" Language: SVN annotate output
|
||||
" Maintainer: Bob Hiestand <bob.hiestand@gmail.com>
|
||||
" Remark: Used by the vcscommand plugin.
|
||||
" License:
|
||||
" Copyright (c) Bob Hiestand
|
||||
"
|
||||
" 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.
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn match svnName /\S\+/ contained
|
||||
syn match svnVer /^\s*\zs\d\+/ contained nextgroup=svnName skipwhite
|
||||
syn match svnHead /^\s*\d\+\s\+\S\+/ contains=svnVer,svnName
|
||||
|
||||
if !exists("did_svnannotate_syntax_inits")
|
||||
let did_svnannotate_syntax_inits = 1
|
||||
hi link svnName Type
|
||||
hi link svnVer Statement
|
||||
endif
|
||||
|
||||
let b:current_syntax="svnAnnotate"
|
||||
31
.vim/syntax/vcscommit.vim
Normal file
31
.vim/syntax/vcscommit.vim
Normal file
@@ -0,0 +1,31 @@
|
||||
" Vim syntax file
|
||||
" Language: VCS commit file
|
||||
" Maintainer: Bob Hiestand (bob.hiestand@gmail.com)
|
||||
" License:
|
||||
" Copyright (c) Bob Hiestand
|
||||
"
|
||||
" 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.
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syntax region vcsComment start="^VCS: " end="$"
|
||||
highlight link vcsComment Comment
|
||||
let b:current_syntax = "vcscommit"
|
||||
Reference in New Issue
Block a user