Skip to content

Commit 45f2f94

Browse files
sheerunNICHTJ3
andcommitted
Add mint-language, closes #653
Co-authored-by: NICHTJ3 <[email protected]>
1 parent cec808b commit 45f2f94

File tree

6 files changed

+125
-1
lines changed

6 files changed

+125
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A collection of language packs for Vim.
77
> One to rule them all, one to find them, one to bring them all and in the darkness bind them.
88
99
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
10-
- It **installs and updates 120+ times faster** than the <!--Package Count-->599<!--/Package Count--> packages it consists of.
10+
- It **installs and updates 120+ times faster** than the <!--Package Count-->600<!--/Package Count--> packages it consists of.
1111
- It is also more secure (scripts loaded for every filetype are generated by vim-polyglot)
1212
- Best syntax and indentation support (no other features). Hand-selected language packs.
1313
- 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
128128
- [mathematica](https://github.com/voldikss/vim-mma) (Mathematica syntax highlighting for mathematica, cdf, m, ma, mt and 6 more files)
129129
- [mdx](https://github.com/jxnblk/vim-mdx-js) (Syntax highlighting for mdx files)
130130
- [meson](https://github.com/mesonbuild/meson/tree/master/data/syntax-highlighting/vim) (Meson syntax highlighting for wrap files)
131+
- [mint](https://github.com/IrenejMarc/vim-mint) (Syntax highlighting for mint files)
131132
- [moonscript](https://github.com/leafo/moonscript-vim) (MoonScript syntax highlighting for moon files)
132133
- [nginx](https://github.com/chr4/nginx.vim) (Nginx syntax highlighting for nginx, nginxconf and vhost files)
133134
- [nim](https://github.com/zah/nim.vim) (Nim syntax highlighting for nim, nim.cfg, nimble, nimrod and nims files)

autoload/polyglot/sleuth.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ let s:globs = {
329329
\ 'mgl': '*.mgl',
330330
\ 'mgp': '*.mgp',
331331
\ 'mib': '*.mib,*.my',
332+
\ 'mint': '*.mint',
332333
\ 'mix': '*.mix,*.mixal',
333334
\ 'mma': '*.mathematica,*.cdf,*.m,*.ma,*.mt,*.nb,*.nbp,*.wl,*.wlt,*.wls,*.mma',
334335
\ 'mmp': '*.mmp',

ftdetect/polyglot.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ set cpo&vim
142142

143143
" DO NOT EDIT CODE BELOW, IT IS GENERATED WITH MAKEFILE
144144

145+
if !has_key(g:polyglot_is_disabled, 'mint')
146+
au BufNewFile,BufRead *.mint setf mint
147+
endif
148+
145149
if !has_key(g:polyglot_is_disabled, 'context')
146150
au BufNewFile,BufRead *.mkii,*.mkiv,*.mkvi setf context
147151
endif

packages.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5546,3 +5546,11 @@ filetypes:
55465546
patterns:
55475547
- pattern: '*.mkii,*.mkiv,*.mkvi'
55485548
description: ConTeXt
5549+
---
5550+
name: mint
5551+
remote: IrenejMarc/vim-mint
5552+
filetypes:
5553+
- name: mint
5554+
patterns:
5555+
- pattern: '*.mint'
5556+
description: Mint (https://www.mint-lang.com/)

syntax/mint.vim

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
if has_key(g:polyglot_is_disabled, 'mint')
2+
finish
3+
endif
4+
5+
if exists('b:current_syntax')
6+
let s:current_syntax = b:current_syntax
7+
silent! unlet b:current_syntax
8+
endif
9+
10+
syntax include @JSSyntax syntax/javascript.vim
11+
silent! unlet b:current_syntax
12+
syntax include @XMLSyntax syntax/xml.vim
13+
silent! unlet b:current_syntax
14+
syntax include @CSSSyntax syntax/css.vim
15+
silent! unlet b:current_syntax
16+
17+
syntax case match
18+
if exists('s:current_syntax')
19+
let b:current_syntax = s:current_syntax
20+
endif
21+
22+
syntax keyword mintBlock
23+
\ do sequence parallel if else case try catch
24+
25+
syntax keyword mintCompoundType
26+
\ Result Maybe Promise Array
27+
28+
syntax keyword mintLiteralType
29+
\ Number Bool String Object Time Html Void Never Tuple
30+
31+
syntax keyword mintDeclarator
32+
\ component module routes
33+
34+
syntax keyword mintStructureDeclarator
35+
\ enum record store provider const
36+
37+
syntax keyword mintInitializer
38+
\ fun let where next state property
39+
40+
syntax keyword mintKeyword
41+
\ decode encode return connect use
42+
43+
syntax keyword mintOperator
44+
\ "<{" "}>" "::" "=>" "|>" "<|"
45+
46+
syntax keyword mintSpecifier
47+
\ as break return using get exposing ok error just nothing void
48+
49+
" String
50+
syntax region mintString matchgroup=mintStringDelimiter start=/"/ skip=/\\"/ end=/"/ oneline
51+
" String interpolation
52+
syntax region mintStringInterpolation matchgroup=mintInterpolationDelimiter start="#{" end="}" contained containedin=mintString contains=@mintAll
53+
54+
" Numbers
55+
syntax match mintNumber "\v<\d+(\.\d+)?>"
56+
57+
" Pascal-cased types
58+
syntax match mintDefinedType "\v<[A-Z][A-Za-z0-9]*(\.[A-Z][A-Za-z0-9]*)*>"
59+
60+
61+
syntax cluster mintAll contains=mintBlock,mintCompoundType,mintDeclarator,mintInitializer,mintKeyword,mintOperator,mintSpecifier,mintString
62+
63+
syntax region mintEmbeddedHtmlRegion
64+
\ start=+<\z([^ /!?<>"'=:]\+\)+
65+
\ start=+<\z(\s\{0}\)>+
66+
\ skip=+<!--\_.\{-}-->+
67+
\ end=+</\z1\_s\{-}>+
68+
\ end=+/>+
69+
\ fold
70+
\ contains=@Spell,@XMLSyntax,@mintAll
71+
\ keepend
72+
73+
syntax region mintEmbeddedJsRegion
74+
\ matchgroup=mintJsInterpolationQuotes
75+
\ start="`"
76+
\ end="`"
77+
\ skip="\\`"
78+
\ keepend
79+
\ contains=mintInterpolation,@jsExpression
80+
81+
hi link mintJsInterpolationQuotes Delimiter
82+
83+
syntax match mintBraces /[{}]/
84+
syntax keyword mintStyleKeyword style skipwhite nextgroup=mintStyleIdentifier
85+
syntax match mintStyleIdentifier /\<\k\k*/ contained skipwhite skipempty nextgroup=mintStyleBlock
86+
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
87+
88+
" Colour links
89+
hi link mintKeyword Keyword
90+
hi link mintOperator Operator
91+
92+
hi link mintBlock Statement
93+
hi link mintDeclarator PreProc
94+
hi link mintStructureDeclarator Structure
95+
hi link mintInitializer PreProc
96+
hi link mintSpecifier Statement
97+
98+
hi link mintString String
99+
hi link mintNumber Number
100+
101+
hi link mintCompoundType Type
102+
hi link mintLiteralType Type
103+
hi link mintDefinedType Type
104+
105+
hi link mintStringDelimiter Delimiter
106+
hi link mintInterpolationDelimiter Special
107+
108+
hi link mintStyleKeyword Type
109+
hi link mintStyleIdentifier Statement

tests/filetypes.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,7 @@ call TestFiletype('xf86conf')
644644
call TestFiletype('xpm')
645645
call TestFiletype('xpm2')
646646
call TestFiletype('context')
647+
call TestFiletype('mint')
647648

648649
" DO NOT EDIT CODE ABOVE, IT IS GENERATED WITH MAKEFILE
649650

0 commit comments

Comments
 (0)