diff --git a/README.md b/README.md index 0bb21ce9f..e67d91198 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,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. - It **won't affect your startup time**, as scripts are loaded only on demand\*. -- It **installs and updates 120+ times faster** than the 599 packages it consists of. +- It **installs and updates 120+ times faster** than the 600 packages it consists of. - 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. - Automatically detects indentation (includes performance-optimized version of [vim-sleuth](https://github.com/tpope/vim-sleuth), can be disabled) @@ -181,6 +181,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr - [sh](https://github.com/arzg/vim-sh) (Shell syntax highlighting for sh, bash, bats, cgi, command and 8 more files) - [slim](https://github.com/slim-template/vim-slim) (Slim syntax highlighting for slim files) - [slime](https://github.com/slime-lang/vim-slime-syntax) (Syntax highlighting for slime files) +- [smithy](https://github.com/jasdel/vim-smithy) (Syntax highlighting for smithy files) - [smt2](https://github.com/bohlender/vim-smt2) (SMT syntax highlighting for smt2 and smt files) - [solidity](https://github.com/TovarishFin/vim-solidity) (Solidity syntax highlighting for sol files) - [stylus](https://github.com/wavded/vim-stylus) (Stylus syntax highlighting for styl and stylus files) diff --git a/autoload/polyglot/init.vim b/autoload/polyglot/init.vim index 45e9aab2a..7e77fcc30 100644 --- a/autoload/polyglot/init.vim +++ b/autoload/polyglot/init.vim @@ -587,6 +587,10 @@ if !has_key(g:polyglot_is_disabled, 'snobol4') au BufNewFile,BufRead *.sno,*.spt setf snobol4 endif +if !has_key(g:polyglot_is_disabled, 'smithy') + au BufNewFile,BufRead *.smithy setf smithy +endif + if !has_key(g:polyglot_is_disabled, 'smith') au BufNewFile,BufRead *.smith,*.smt setf smith endif diff --git a/autoload/polyglot/sleuth.vim b/autoload/polyglot/sleuth.vim index ba166bf78..790c52668 100644 --- a/autoload/polyglot/sleuth.vim +++ b/autoload/polyglot/sleuth.vim @@ -503,6 +503,7 @@ let s:globs = { \ 'smarty': '*.tpl', \ 'smcl': '*.hlp,*.ihlp,*.smcl', \ 'smith': '*.smt,*.smith', + \ 'smithy': '*.smithy', \ 'sml': '*.sml', \ 'smt2': '*.smt2,*.smt', \ 'snobol4': '*.sno,*.spt', diff --git a/ftplugin/smithy.vim b/ftplugin/smithy.vim new file mode 100644 index 000000000..2345d96e3 --- /dev/null +++ b/ftplugin/smithy.vim @@ -0,0 +1,8 @@ +if polyglot#init#is_disabled(expand(':p'), 'smithy', 'ftplugin/smithy.vim') + finish +endif + +" Smithy vim configuration +"------------------------- + +set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab diff --git a/packages.yaml b/packages.yaml index 7753cb245..911cd7465 100644 --- a/packages.yaml +++ b/packages.yaml @@ -4618,6 +4618,14 @@ filetypes: - pattern: "*.smt,*.smith" description: SMITH --- +name: smithy +remote: jasdel/vim-smithy +filetypes: +- name: smithy + patterns: + - pattern: "*.smithy" + description: Smithy IDL +--- name: snobol4 native: true glob: "**/snobol4.vim" diff --git a/syntax/smithy.vim b/syntax/smithy.vim new file mode 100644 index 000000000..9cc2e4d14 --- /dev/null +++ b/syntax/smithy.vim @@ -0,0 +1,47 @@ +if polyglot#init#is_disabled(expand(':p'), 'smithy', 'syntax/smithy.vim') + finish +endif + +syn case match + +syn keyword smithyNamespace namespace +syn keyword smithyMetadata metadata suppresssions +syn keyword smithyKeywords use apply +syn keyword smithyMember member +syn region smithyTrait start="@" end="\w*" + +hi def link smithyNamespace Statement +hi def link smithyMetadata Statement +hi def link smithyKeywords Keyword +hi def link smithyMember Label +hi def link smithyTrait Identifier + + +" Predefined types +syn keyword smithyContainer list set map union document structure service operation +syn keyword smithySimpleType boolean blob string byte short integer long float double timestamp + +hi def link smithyContainer Type +hi def link smithySimpleType Type + +" Comments +syn region smithyCommentBlock start="///" end="$" contains=@Spell +syn region smithyComment start="//" end="$" contains=@Spell + +hi def link smithyCommentBlock Comment +hi def link smithyComment Comment + +" Literal strings +syn region smithyString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell +syn region smithyMultiLineString start=+"""+ end=+"""+ contains=@Spell + +hi def link smithyString String +hi def link smithyMultiLineString String + +" Regions +syn region smithyParen start='(' end=')' transparent +syn region smithyBlock start="{" end="}" transparent +syn region smithyList start="\[" end="\]" transparent + + +" vim: sw=2 ts=2 et diff --git a/tests/filetypes.vim b/tests/filetypes.vim index 1e54cfbe7..ce174dbae 100644 --- a/tests/filetypes.vim +++ b/tests/filetypes.vim @@ -548,6 +548,7 @@ call TestFiletype('slrnrc') call TestFiletype('slrnsc') call TestFiletype('st') call TestFiletype('smith') +call TestFiletype('smithy') call TestFiletype('snobol4') call TestFiletype('mib') call TestFiletype('hog')