mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Add support for PEG syntax (#615)
* feat: add pest syntax * feat: add pest into packages * feat: increase the package count
This commit is contained in:
@@ -7,7 +7,7 @@ A collection of language packs for Vim.
|
|||||||
> One to rule them all, one to find them, one to bring them all and in the darkness bind them.
|
> One to rule them all, one to find them, one to bring them all and in the darkness bind them.
|
||||||
|
|
||||||
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
|
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
|
||||||
- It **installs and updates 120+ times faster** than the <!--Package Count-->597<!--/Package Count--> packages it consists of.
|
- It **installs and updates 120+ times faster** than the <!--Package Count-->598<!--/Package Count--> packages it consists of.
|
||||||
- It is also more secure (scripts loaded for every filetype are generated by vim-polyglot)
|
- It is also more secure (scripts loaded for every filetype are generated by vim-polyglot)
|
||||||
- Best syntax and indentation support (no other features). Hand-selected language packs.
|
- Best syntax and indentation support (no other features). Hand-selected language packs.
|
||||||
- Automatically detects indentation (includes performance-optimized version of [vim-sleuth](https://github.com/tpope/vim-sleuth), can be disabled)
|
- Automatically detects indentation (includes performance-optimized version of [vim-sleuth](https://github.com/tpope/vim-sleuth), can be disabled)
|
||||||
@@ -138,6 +138,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
|||||||
- [odin](https://github.com/Tetralux/odin.vim) (Odin syntax highlighting for odin files)
|
- [odin](https://github.com/Tetralux/odin.vim) (Odin syntax highlighting for odin files)
|
||||||
- [opencl](https://github.com/petRUShka/vim-opencl) (OpenCL syntax highlighting for cl and opencl files)
|
- [opencl](https://github.com/petRUShka/vim-opencl) (OpenCL syntax highlighting for cl and opencl files)
|
||||||
- [perl](https://github.com/vim-perl/vim-perl) (Perl syntax highlighting for pl, al, cgi, fcgi, perl and 12 more files)
|
- [perl](https://github.com/vim-perl/vim-perl) (Perl syntax highlighting for pl, al, cgi, fcgi, perl and 12 more files)
|
||||||
|
- [pest](https://github.com/pest-parser/pest.vim) (PEG syntax for Rust Pest crate)
|
||||||
- [pgsql](https://github.com/lifepillar/pgsql.vim) (PLpgSQL syntax highlighting for pgsql files)
|
- [pgsql](https://github.com/lifepillar/pgsql.vim) (PLpgSQL syntax highlighting for pgsql files)
|
||||||
- [php](https://github.com/StanAngeloff/php.vim) (PHP syntax highlighting for php, aw, ctp, fcgi, inc and 7 more files)
|
- [php](https://github.com/StanAngeloff/php.vim) (PHP syntax highlighting for php, aw, ctp, fcgi, inc and 7 more files)
|
||||||
- [plantuml](https://github.com/aklt/plantuml-syntax) (PlantUML syntax highlighting for puml, iuml, plantuml, uml and pu files)
|
- [plantuml](https://github.com/aklt/plantuml-syntax) (PlantUML syntax highlighting for puml, iuml, plantuml, uml and pu files)
|
||||||
|
|||||||
@@ -1998,6 +1998,10 @@ if !has_key(g:polyglot_is_disabled, 'requirements')
|
|||||||
au BufNewFile,BufRead *.pip,*require.{txt,in},*requirements.{txt,in},constraints.{txt,in} setf requirements
|
au BufNewFile,BufRead *.pip,*require.{txt,in},*requirements.{txt,in},constraints.{txt,in} setf requirements
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !has_key(g:polyglot_is_disabled, 'pest')
|
||||||
|
au BufNewFile,BufRead *.pest setf pest
|
||||||
|
endif
|
||||||
|
|
||||||
if !has_key(g:polyglot_is_disabled, 'python')
|
if !has_key(g:polyglot_is_disabled, 'python')
|
||||||
au BufNewFile,BufRead *.cgi,*.fcgi,*.gyp,*.gypi,*.lmi,*.ptl,*.py,*.py3,*.pyde,*.pyi,*.pyp,*.pyt,*.pyw,*.rpy,*.smk,*.spec,*.tac,*.wsgi,*.xpy,{.,}gclient,{.,}pythonrc,{.,}pythonstartup,DEPS,SConscript,SConstruct,Snakefile,wscript setf python
|
au BufNewFile,BufRead *.cgi,*.fcgi,*.gyp,*.gypi,*.lmi,*.ptl,*.py,*.py3,*.pyde,*.pyi,*.pyp,*.pyt,*.pyw,*.rpy,*.smk,*.spec,*.tac,*.wsgi,*.xpy,{.,}gclient,{.,}pythonrc,{.,}pythonstartup,DEPS,SConscript,SConstruct,Snakefile,wscript setf python
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1236,6 +1236,13 @@ filetypes:
|
|||||||
- name: blade
|
- name: blade
|
||||||
linguist: Blade
|
linguist: Blade
|
||||||
---
|
---
|
||||||
|
name: pest
|
||||||
|
remote: pest-parser/pest.vim
|
||||||
|
filetypes:
|
||||||
|
- name: pest
|
||||||
|
extensions:
|
||||||
|
- pest
|
||||||
|
---
|
||||||
name: plantuml
|
name: plantuml
|
||||||
remote: aklt/plantuml-syntax
|
remote: aklt/plantuml-syntax
|
||||||
filetypes:
|
filetypes:
|
||||||
|
|||||||
131
syntax/pest.vim
Normal file
131
syntax/pest.vim
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
" Comments
|
||||||
|
syntax keyword pestTodo contained TODO FIXME XXX NOTE
|
||||||
|
syntax match pestComment "\/\/.*$" contains=celTodo
|
||||||
|
|
||||||
|
" Rule names
|
||||||
|
syntax match pestName "^[a-z_][a-z0-9_]*"
|
||||||
|
|
||||||
|
" String types
|
||||||
|
syntax region pestString start=/"/ skip=/\\\\\|\\"/ end=/"/ oneline contained
|
||||||
|
syntax region pestStringIcase start=/\^"/ skip=/\\\\\|\\"/ end=/"/ oneline contained
|
||||||
|
syntax region pestChar start=/'/ end=/'/ oneline contained
|
||||||
|
|
||||||
|
" Operators, modifiers, keywords
|
||||||
|
syntax match pestModifier "\v[_@$!]"
|
||||||
|
syntax match pestOperator "\v[~|*+?&!]" contained
|
||||||
|
syntax keyword pestKeyword PUSH POP POP_ALL PEEK PEEK_ALL DROP contained
|
||||||
|
syntax keyword pestSpecial WHITESPACE COMMENT ANY SOI EOI ASCII_DIGIT ASCII_NONZERO_DIGIT ASCII_BIN_DIGIT ASCII_OCT_DIGIT ASCII_HEX_DIGIT
|
||||||
|
\ ASCII_ALPHA_LOWER ASCII_ALPHA_UPPER ASCII_ALPHA ASCII_ALPHANUMERIC ASCII NEWLINE
|
||||||
|
syntax keyword pestGeneral contained
|
||||||
|
\ LETTER
|
||||||
|
\ CASED_LETTER
|
||||||
|
\ UPPERCASE_LETTER
|
||||||
|
\ LOWERCASE_LETTER
|
||||||
|
\ TITLECASE_LETTER
|
||||||
|
\ MODIFIER_LETTER
|
||||||
|
\ OTHER_LETTER
|
||||||
|
\ MARK
|
||||||
|
\ NONSPACING_MARK
|
||||||
|
\ SPACING_MARK
|
||||||
|
\ ENCLOSING_MARK
|
||||||
|
\ NUMBER
|
||||||
|
\ DECIMAL_NUMBER
|
||||||
|
\ LETTER_NUMBER
|
||||||
|
\ OTHER_NUMBER
|
||||||
|
\ PUNCTUATION
|
||||||
|
\ CONNECTOR_PUNCTUATION
|
||||||
|
\ DASH_PUNCTUATION
|
||||||
|
\ OPEN_PUNCTUATION
|
||||||
|
\ CLOSE_PUNCTUATION
|
||||||
|
\ INITIAL_PUNCTUATION
|
||||||
|
\ FINAL_PUNCTUATION
|
||||||
|
\ OTHER_PUNCTUATION
|
||||||
|
\ SYMBOL
|
||||||
|
\ MATH_SYMBOL
|
||||||
|
\ CURRENCY_SYMBOL
|
||||||
|
\ MODIFIER_SYMBOL
|
||||||
|
\ OTHER_SYMBOL
|
||||||
|
\ SEPARATOR
|
||||||
|
\ SPACE_SEPARATOR
|
||||||
|
\ LINE_SEPARATOR
|
||||||
|
\ PARAGRAPH_SEPARATOR
|
||||||
|
\ OTHER
|
||||||
|
\ CONTROL
|
||||||
|
\ FORMAT
|
||||||
|
\ SURROGATE
|
||||||
|
\ PRIVATE_USE
|
||||||
|
\ UNASSIGNED
|
||||||
|
syntax keyword pestBinary contained
|
||||||
|
\ ALPHABETIC
|
||||||
|
\ BIDI_CONTROL
|
||||||
|
\ CASE_IGNORABLE
|
||||||
|
\ CASED
|
||||||
|
\ CHANGES_WHEN_CASEFOLDED
|
||||||
|
\ CHANGES_WHEN_CASEMAPPED
|
||||||
|
\ CHANGES_WHEN_LOWERCASED
|
||||||
|
\ CHANGES_WHEN_TITLECASED
|
||||||
|
\ CHANGES_WHEN_UPPERCASED
|
||||||
|
\ DASH
|
||||||
|
\ DEFAULT_IGNORABLE_CODE_POINT
|
||||||
|
\ DEPRECATED
|
||||||
|
\ DIACRITIC
|
||||||
|
\ EXTENDER
|
||||||
|
\ GRAPHEME_BASE
|
||||||
|
\ GRAPHEME_EXTEND
|
||||||
|
\ GRAPHEME_LINK
|
||||||
|
\ HEX_DIGIT
|
||||||
|
\ HYPHEN
|
||||||
|
\ IDS_BINARY_OPERATOR
|
||||||
|
\ IDS_TRINARY_OPERATOR
|
||||||
|
\ ID_CONTINUE
|
||||||
|
\ ID_START
|
||||||
|
\ IDEOGRAPHIC
|
||||||
|
\ JOIN_CONTROL
|
||||||
|
\ LOGICAL_ORDER_EXCEPTION
|
||||||
|
\ LOWERCASE
|
||||||
|
\ MATH
|
||||||
|
\ NONCHARACTER_CODE_POINT
|
||||||
|
\ OTHER_ALPHABETIC
|
||||||
|
\ OTHER_DEFAULT_IGNORABLE_CODE_POINT
|
||||||
|
\ OTHER_GRAPHEME_EXTEND
|
||||||
|
\ OTHER_ID_CONTINUE
|
||||||
|
\ OTHER_ID_START
|
||||||
|
\ OTHER_LOWERCASE
|
||||||
|
\ OTHER_MATH
|
||||||
|
\ OTHER_UPPERCASE
|
||||||
|
\ PATTERN_SYNTAX
|
||||||
|
\ PATTERN_WHITE_SPACE
|
||||||
|
\ PREPENDED_CONCATENATION_MARK
|
||||||
|
\ QUOTATION_MARK
|
||||||
|
\ RADICAL
|
||||||
|
\ REGIONAL_INDICATOR
|
||||||
|
\ SENTENCE_TERMINAL
|
||||||
|
\ SOFT_DOTTED
|
||||||
|
\ TERMINAL_PUNCTUATION
|
||||||
|
\ UNIFIED_IDEOGRAPH
|
||||||
|
\ UPPERCASE
|
||||||
|
\ VARIATION_SELECTOR
|
||||||
|
\ WHITE_SPACE
|
||||||
|
\ XID_CONTINUE
|
||||||
|
\ XID_START
|
||||||
|
syntax keyword pestForbidden abstract alignof as become box break const continue crate do else enum extern false
|
||||||
|
\ final fn for if impl in let loop macro match mod move mut offsetof override priv proc pure pub ref return
|
||||||
|
\ Self self sizeof static struct super trait true type typeof unsafe unsized use virtual where while yield
|
||||||
|
|
||||||
|
" Rule blocks
|
||||||
|
syntax region pestBlock start=/{/ end=/}/ fold transparent contains=pestString,pestStringIcase,pestChar,pestOperator,pestKeyword,pestSpecial,pestGeneral,pestBinary,pestForbidden,pestComment,pestBlock
|
||||||
|
syntax region pestRule start=/^/ end=/ / fold transparent contains=pestName,pestForbidden,pestComment
|
||||||
|
|
||||||
|
highlight default link pestTodo Todo
|
||||||
|
highlight default link pestComment Comment
|
||||||
|
highlight default link pestString String
|
||||||
|
highlight default link pestStringIcase String
|
||||||
|
highlight default link pestChar Character
|
||||||
|
highlight default link pestName Identifier
|
||||||
|
highlight default link pestModifier Operator
|
||||||
|
highlight default link pestOperator Operator
|
||||||
|
highlight default link pestKeyword Keyword
|
||||||
|
highlight default link pestSpecial Type
|
||||||
|
highlight default link pestGeneral Type
|
||||||
|
highlight default link pestBinary Type
|
||||||
|
highlight default link pestForbidden Error
|
||||||
Reference in New Issue
Block a user