Add mint-language, closes #653

Co-authored-by: NICHTJ3 <nicholsontrent@gmail.com>
This commit is contained in:
Adam Stankiewicz
2020-12-29 20:17:10 +01:00
parent cec808bc19
commit 45f2f94975
6 changed files with 125 additions and 1 deletions

View File

@@ -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-->599<!--/Package Count--> packages it consists of. - It **installs and updates 120+ times faster** than the <!--Package Count-->600<!--/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)
@@ -128,6 +128,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
- [mathematica](https://github.com/voldikss/vim-mma) (Mathematica syntax highlighting for mathematica, cdf, m, ma, mt and 6 more files) - [mathematica](https://github.com/voldikss/vim-mma) (Mathematica syntax highlighting for mathematica, cdf, m, ma, mt and 6 more files)
- [mdx](https://github.com/jxnblk/vim-mdx-js) (Syntax highlighting for mdx files) - [mdx](https://github.com/jxnblk/vim-mdx-js) (Syntax highlighting for mdx files)
- [meson](https://github.com/mesonbuild/meson/tree/master/data/syntax-highlighting/vim) (Meson syntax highlighting for wrap files) - [meson](https://github.com/mesonbuild/meson/tree/master/data/syntax-highlighting/vim) (Meson syntax highlighting for wrap files)
- [mint](https://github.com/IrenejMarc/vim-mint) (Syntax highlighting for mint files)
- [moonscript](https://github.com/leafo/moonscript-vim) (MoonScript syntax highlighting for moon files) - [moonscript](https://github.com/leafo/moonscript-vim) (MoonScript syntax highlighting for moon files)
- [nginx](https://github.com/chr4/nginx.vim) (Nginx syntax highlighting for nginx, nginxconf and vhost files) - [nginx](https://github.com/chr4/nginx.vim) (Nginx syntax highlighting for nginx, nginxconf and vhost files)
- [nim](https://github.com/zah/nim.vim) (Nim syntax highlighting for nim, nim.cfg, nimble, nimrod and nims files) - [nim](https://github.com/zah/nim.vim) (Nim syntax highlighting for nim, nim.cfg, nimble, nimrod and nims files)

View File

@@ -329,6 +329,7 @@ let s:globs = {
\ 'mgl': '*.mgl', \ 'mgl': '*.mgl',
\ 'mgp': '*.mgp', \ 'mgp': '*.mgp',
\ 'mib': '*.mib,*.my', \ 'mib': '*.mib,*.my',
\ 'mint': '*.mint',
\ 'mix': '*.mix,*.mixal', \ 'mix': '*.mix,*.mixal',
\ 'mma': '*.mathematica,*.cdf,*.m,*.ma,*.mt,*.nb,*.nbp,*.wl,*.wlt,*.wls,*.mma', \ 'mma': '*.mathematica,*.cdf,*.m,*.ma,*.mt,*.nb,*.nbp,*.wl,*.wlt,*.wls,*.mma',
\ 'mmp': '*.mmp', \ 'mmp': '*.mmp',

View File

@@ -142,6 +142,10 @@ set cpo&vim
" DO NOT EDIT CODE BELOW, IT IS GENERATED WITH MAKEFILE " DO NOT EDIT CODE BELOW, IT IS GENERATED WITH MAKEFILE
if !has_key(g:polyglot_is_disabled, 'mint')
au BufNewFile,BufRead *.mint setf mint
endif
if !has_key(g:polyglot_is_disabled, 'context') if !has_key(g:polyglot_is_disabled, 'context')
au BufNewFile,BufRead *.mkii,*.mkiv,*.mkvi setf context au BufNewFile,BufRead *.mkii,*.mkiv,*.mkvi setf context
endif endif

View File

@@ -5546,3 +5546,11 @@ filetypes:
patterns: patterns:
- pattern: '*.mkii,*.mkiv,*.mkvi' - pattern: '*.mkii,*.mkiv,*.mkvi'
description: ConTeXt description: ConTeXt
---
name: mint
remote: IrenejMarc/vim-mint
filetypes:
- name: mint
patterns:
- pattern: '*.mint'
description: Mint (https://www.mint-lang.com/)

109
syntax/mint.vim Normal file
View File

@@ -0,0 +1,109 @@
if has_key(g:polyglot_is_disabled, 'mint')
finish
endif
if exists('b:current_syntax')
let s:current_syntax = b:current_syntax
silent! unlet b:current_syntax
endif
syntax include @JSSyntax syntax/javascript.vim
silent! unlet b:current_syntax
syntax include @XMLSyntax syntax/xml.vim
silent! unlet b:current_syntax
syntax include @CSSSyntax syntax/css.vim
silent! unlet b:current_syntax
syntax case match
if exists('s:current_syntax')
let b:current_syntax = s:current_syntax
endif
syntax keyword mintBlock
\ do sequence parallel if else case try catch
syntax keyword mintCompoundType
\ Result Maybe Promise Array
syntax keyword mintLiteralType
\ Number Bool String Object Time Html Void Never Tuple
syntax keyword mintDeclarator
\ component module routes
syntax keyword mintStructureDeclarator
\ enum record store provider const
syntax keyword mintInitializer
\ fun let where next state property
syntax keyword mintKeyword
\ decode encode return connect use
syntax keyword mintOperator
\ "<{" "}>" "::" "=>" "|>" "<|"
syntax keyword mintSpecifier
\ as break return using get exposing ok error just nothing void
" String
syntax region mintString matchgroup=mintStringDelimiter start=/"/ skip=/\\"/ end=/"/ oneline
" String interpolation
syntax region mintStringInterpolation matchgroup=mintInterpolationDelimiter start="#{" end="}" contained containedin=mintString contains=@mintAll
" Numbers
syntax match mintNumber "\v<\d+(\.\d+)?>"
" Pascal-cased types
syntax match mintDefinedType "\v<[A-Z][A-Za-z0-9]*(\.[A-Z][A-Za-z0-9]*)*>"
syntax cluster mintAll contains=mintBlock,mintCompoundType,mintDeclarator,mintInitializer,mintKeyword,mintOperator,mintSpecifier,mintString
syntax region mintEmbeddedHtmlRegion
\ start=+<\z([^ /!?<>"'=:]\+\)+
\ start=+<\z(\s\{0}\)>+
\ skip=+<!--\_.\{-}-->+
\ end=+</\z1\_s\{-}>+
\ end=+/>+
\ fold
\ contains=@Spell,@XMLSyntax,@mintAll
\ keepend
syntax region mintEmbeddedJsRegion
\ matchgroup=mintJsInterpolationQuotes
\ start="`"
\ end="`"
\ skip="\\`"
\ keepend
\ contains=mintInterpolation,@jsExpression
hi link mintJsInterpolationQuotes Delimiter
syntax match mintBraces /[{}]/
syntax keyword mintStyleKeyword style skipwhite nextgroup=mintStyleIdentifier
syntax match mintStyleIdentifier /\<\k\k*/ contained skipwhite skipempty nextgroup=mintStyleBlock
syntax region mintStyleBlock contained matchgroup=mintBraces start="{" end="}" contains=@mintAll,cssDefinition,cssTagName,cssAttributeSelector,cssClassName,cssIdentifier,cssAtRule,cssAttrRegion,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssCustomProp,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks,cssNoise
" Colour links
hi link mintKeyword Keyword
hi link mintOperator Operator
hi link mintBlock Statement
hi link mintDeclarator PreProc
hi link mintStructureDeclarator Structure
hi link mintInitializer PreProc
hi link mintSpecifier Statement
hi link mintString String
hi link mintNumber Number
hi link mintCompoundType Type
hi link mintLiteralType Type
hi link mintDefinedType Type
hi link mintStringDelimiter Delimiter
hi link mintInterpolationDelimiter Special
hi link mintStyleKeyword Type
hi link mintStyleIdentifier Statement

View File

@@ -644,6 +644,7 @@ call TestFiletype('xf86conf')
call TestFiletype('xpm') call TestFiletype('xpm')
call TestFiletype('xpm2') call TestFiletype('xpm2')
call TestFiletype('context') call TestFiletype('context')
call TestFiletype('mint')
" DO NOT EDIT CODE ABOVE, IT IS GENERATED WITH MAKEFILE " DO NOT EDIT CODE ABOVE, IT IS GENERATED WITH MAKEFILE