Add ion shell support, closes #404

This commit is contained in:
Adam Stankiewicz 2019-06-08 13:33:25 +02:00
parent 8f2a71643a
commit 9caa678708
5 changed files with 112 additions and 1 deletions

View File

@ -10,7 +10,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-->139<!--/Package Count--> packages it consists of. - It **installs and updates 120+ times faster** than the <!--Package Count-->140<!--/Package Count--> packages it consists of.
- Solid syntax and indentation support (other features skipped). Only the best language packs. - Solid syntax and indentation support (other features skipped). Only the best language packs.
- All unnecessary files are ignored (like enormous documentation from php support). - All unnecessary files are ignored (like enormous documentation from php support).
- No support for esoteric languages, only most popular ones (modern too, like `slim`). - No support for esoteric languages, only most popular ones (modern too, like `slim`).
@ -97,6 +97,7 @@ If you need full functionality of any plugin, please use it directly with your p
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin) - [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
- [i3](https://github.com/mboughaba/i3config.vim) (syntax, ftplugin) - [i3](https://github.com/mboughaba/i3config.vim) (syntax, ftplugin)
- [idris](https://github.com/idris-hackers/idris-vim) (syntax, indent, ftplugin) - [idris](https://github.com/idris-hackers/idris-vim) (syntax, indent, ftplugin)
- [ion](https://github.com/vmchale/ion-vim) (syntax, ftplugin)
- [jasmine](https://github.com/glanotte/vim-jasmine) (syntax) - [jasmine](https://github.com/glanotte/vim-jasmine) (syntax)
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftplugin, extras) - [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftplugin, extras)
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (syntax, indent) - [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (syntax, indent)

1
build
View File

@ -205,6 +205,7 @@ PACKS="
html5:othree/html5.vim html5:othree/html5.vim
i3:mboughaba/i3config.vim i3:mboughaba/i3config.vim
idris:idris-hackers/idris-vim idris:idris-hackers/idris-vim
ion:vmchale/ion-vim
jasmine:glanotte/vim-jasmine jasmine:glanotte/vim-jasmine
javascript:pangloss/vim-javascript:_JAVASCRIPT javascript:pangloss/vim-javascript:_JAVASCRIPT
jenkins:martinda/Jenkinsfile-vim-syntax jenkins:martinda/Jenkinsfile-vim-syntax

View File

@ -586,6 +586,19 @@ au BufNewFile,BufRead *.lidr setf lidris
augroup end augroup end
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ion') == -1
augroup filetypedetect
" ion, from ion.vim in vmchale/ion-vim
autocmd BufNewFile,BufRead ~/.config/ion/initrc set filetype=ion
autocmd BufNewFile,BufRead *.ion set filetype=ion
autocmd BufNewFile,BufRead,StdinReadPost *
\ if getline(1) =~ '^#!.*\Wion\s*$' |
\ set ft=ion |
\ endif
augroup end
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jasmine') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jasmine') == -1
augroup filetypedetect augroup filetypedetect
" jasmine, from jasmine.vim in glanotte/vim-jasmine " jasmine, from jasmine.vim in glanotte/vim-jasmine

9
ftplugin/ion.vim Normal file
View File

@ -0,0 +1,9 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'ion') != -1
finish
endif
if exists("b:did_ftplugin") | finish | endif
let b:did_ftplugin = 1
setlocal commentstring=#%s

87
syntax/ion.vim Normal file
View File

@ -0,0 +1,87 @@
if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'ion') != -1
finish
endif
if v:version < 600
syntax clear
elseif exists('b:current_syntax')
finish
endif
syn region ionDoubleQuote start='"' skip='\'' end='"' contains=ionArrayVar,ionVariable,ionProcess
syn region ionSingleQuote start='\'' skip='"' end='\''
syn region ionArrayVar start="@{" end="}"
syn match ionArrayVar "@[a-zA-Z0-9_]\+"
syn region ionVariable start="${" end="}"
syn match ionVariable "$[a-zA-Z0-9_]\+"
syn region ionProcess start="$(" end=")" transparent
syn region ionProcess start="@(" end=")" transparent
syn match ionNumber '[+-]\?\([0-9]*[.]\)\?[0-9]\+'
syn match ionComment '[#].*$'
syn match ionOperator '&'
syn match ionOperator '&&'
syn match ionOperator '||'
syn match ionOperator '[|<>&]'
syn match ionFlag '[ ]\([-]\)\w\+'
syntax keyword ionKeyword .
syntax keyword ionKeyword ..
syntax keyword ionKeyword alias
syntax keyword ionKeyword and
syntax keyword ionKeyword bg
syntax keyword ionKeyword break
syntax keyword ionKeyword calc
syntax keyword ionKeyword case
syntax keyword ionKeyword cd
syntax keyword ionKeyword complete
syntax keyword ionKeyword continue
syntax keyword ionKeyword count
syntax keyword ionKeyword dirs
syntax keyword ionKeyword disown
syntax keyword ionKeyword drop
syntax keyword ionKeyword echo
syntax keyword ionKeyword else
syntax keyword ionKeyword end
syntax keyword ionKeyword eval
syntax keyword ionKeyword exec
syntax keyword ionKeyword exit
syntax keyword ionKeyword false
syntax keyword ionKeyword fg
syntax keyword ionKeyword fn
syntax keyword ionKeyword for
syntax keyword ionKeyword help
syntax keyword ionKeyword history
syntax keyword ionKeyword if
syntax keyword ionKeyword in
syntax keyword ionKeyword jobs
syntax keyword ionKeyword let
syntax keyword ionKeyword match
syntax keyword ionKeyword matches
syntax keyword ionKeyword mkdir
syntax keyword ionKeyword not
syntax keyword ionKeyword or
syntax keyword ionKeyword popd
syntax keyword ionKeyword pushd
syntax keyword ionKeyword pwd
syntax keyword ionKeyword read
syntax keyword ionKeyword set
syntax keyword ionKeyword source
syntax keyword ionKeyword status
syntax keyword ionKeyword suspend
syntax keyword ionKeyword test
syntax keyword ionKeyword time
syntax keyword ionKeyword true
syntax keyword ionKeyword unalias
syntax keyword ionKeyword wait
syntax keyword ionKeyword while
hi def link ionKeyword Keyword
hi def link ionArrayVar Constant
hi def link ionVariable Identifier
hi def link ionNumber Number
hi def link ionDoubleQuote String
hi def link ionSingleQuote String
hi def link ionProcess PreProc
hi def link ionComment Comment
hi def link ionOperator Operator
hi def link ionFlag Boolean