Skip to content

Commit d9d16f4

Browse files
committed
Add smithy
1 parent 36a2bf6 commit d9d16f4

File tree

7 files changed

+71
-1
lines changed

7 files changed

+71
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A collection of language packs for Vim.
1111
> One to rule them all, one to find them, one to bring them all and in the darkness bind them.
1212
1313
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
14-
- It **installs and updates 120+ times faster** than the <!--Package Count-->599<!--/Package Count--> packages it consists of.
14+
- It **installs and updates 120+ times faster** than the <!--Package Count-->600<!--/Package Count--> packages it consists of.
1515
- It is also more secure (scripts loaded for every filetype are generated by vim-polyglot)
1616
- Best syntax and indentation support (no other features). Hand-selected language packs.
1717
- 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
181181
- [sh](https://github.com/arzg/vim-sh) (Shell syntax highlighting for sh, bash, bats, cgi, command and 8 more files)
182182
- [slim](https://github.com/slim-template/vim-slim) (Slim syntax highlighting for slim files)
183183
- [slime](https://github.com/slime-lang/vim-slime-syntax) (Syntax highlighting for slime files)
184+
- [smithy](https://github.com/jasdel/vim-smithy) (Syntax highlighting for smithy files)
184185
- [smt2](https://github.com/bohlender/vim-smt2) (SMT syntax highlighting for smt2 and smt files)
185186
- [solidity](https://github.com/TovarishFin/vim-solidity) (Solidity syntax highlighting for sol files)
186187
- [stylus](https://github.com/wavded/vim-stylus) (Stylus syntax highlighting for styl and stylus files)

autoload/polyglot/init.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,10 @@ if !has_key(g:polyglot_is_disabled, 'snobol4')
587587
au BufNewFile,BufRead *.sno,*.spt setf snobol4
588588
endif
589589

590+
if !has_key(g:polyglot_is_disabled, 'smithy')
591+
au BufNewFile,BufRead *.smithy setf smithy
592+
endif
593+
590594
if !has_key(g:polyglot_is_disabled, 'smith')
591595
au BufNewFile,BufRead *.smith,*.smt setf smith
592596
endif

autoload/polyglot/sleuth.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ let s:globs = {
503503
\ 'smarty': '*.tpl',
504504
\ 'smcl': '*.hlp,*.ihlp,*.smcl',
505505
\ 'smith': '*.smt,*.smith',
506+
\ 'smithy': '*.smithy',
506507
\ 'sml': '*.sml',
507508
\ 'smt2': '*.smt2,*.smt',
508509
\ 'snobol4': '*.sno,*.spt',

ftplugin/smithy.vim

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
if polyglot#init#is_disabled(expand('<sfile>:p'), 'smithy', 'ftplugin/smithy.vim')
2+
finish
3+
endif
4+
5+
" Smithy vim configuration
6+
"-------------------------
7+
8+
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab

packages.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4618,6 +4618,14 @@ filetypes:
46184618
- pattern: "*.smt,*.smith"
46194619
description: SMITH
46204620
---
4621+
name: smithy
4622+
remote: jasdel/vim-smithy
4623+
filetypes:
4624+
- name: smithy
4625+
patterns:
4626+
- pattern: "*.smithy"
4627+
description: Smithy IDL
4628+
---
46214629
name: snobol4
46224630
native: true
46234631
glob: "**/snobol4.vim"

syntax/smithy.vim

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
if polyglot#init#is_disabled(expand('<sfile>:p'), 'smithy', 'syntax/smithy.vim')
2+
finish
3+
endif
4+
5+
syn case match
6+
7+
syn keyword smithyNamespace namespace
8+
syn keyword smithyMetadata metadata suppresssions
9+
syn keyword smithyKeywords use apply
10+
syn keyword smithyMember member
11+
syn region smithyTrait start="@" end="\w*"
12+
13+
hi def link smithyNamespace Statement
14+
hi def link smithyMetadata Statement
15+
hi def link smithyKeywords Keyword
16+
hi def link smithyMember Label
17+
hi def link smithyTrait Identifier
18+
19+
20+
" Predefined types
21+
syn keyword smithyContainer list set map union document structure service operation
22+
syn keyword smithySimpleType boolean blob string byte short integer long float double timestamp
23+
24+
hi def link smithyContainer Type
25+
hi def link smithySimpleType Type
26+
27+
" Comments
28+
syn region smithyCommentBlock start="///" end="$" contains=@Spell
29+
syn region smithyComment start="//" end="$" contains=@Spell
30+
31+
hi def link smithyCommentBlock Comment
32+
hi def link smithyComment Comment
33+
34+
" Literal strings
35+
syn region smithyString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
36+
syn region smithyMultiLineString start=+"""+ end=+"""+ contains=@Spell
37+
38+
hi def link smithyString String
39+
hi def link smithyMultiLineString String
40+
41+
" Regions
42+
syn region smithyParen start='(' end=')' transparent
43+
syn region smithyBlock start="{" end="}" transparent
44+
syn region smithyList start="\[" end="\]" transparent
45+
46+
47+
" vim: sw=2 ts=2 et

tests/filetypes.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ call TestFiletype('slrnrc')
548548
call TestFiletype('slrnsc')
549549
call TestFiletype('st')
550550
call TestFiletype('smith')
551+
call TestFiletype('smithy')
551552
call TestFiletype('snobol4')
552553
call TestFiletype('mib')
553554
call TestFiletype('hog')

0 commit comments

Comments
 (0)