mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-14 06:23:50 -05:00
Update
This commit is contained in:
37
syntax/ecrystal.vim
Normal file
37
syntax/ecrystal.vim
Normal file
@@ -0,0 +1,37 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||
|
||||
if &syntax !~# '\<ecrystal\>' || get(b:, 'current_syntax') =~# '\<ecrystal\>'
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists('main_syntax')
|
||||
let main_syntax = 'ecrystal'
|
||||
endif
|
||||
|
||||
call ecrystal#SetSubtype()
|
||||
|
||||
if b:ecrystal_subtype !=# ''
|
||||
exec 'runtime! syntax/'.b:ecrystal_subtype.'.vim'
|
||||
unlet! b:current_syntax
|
||||
endif
|
||||
|
||||
syn include @crystalTop syntax/crystal.vim
|
||||
|
||||
syn cluster ecrystalRegions contains=ecrystalControl,ecrystalRender,ecrystalComment
|
||||
|
||||
syn region ecrystalControl matchgroup=ecrystalDelimiter start="<%%\@!-\=" end="-\=%>" display contains=@crystalTop containedin=ALLBUT,@ecrystalRegions
|
||||
syn region ecrystalRender matchgroup=ecrystalDelimiter start="<%%\@!-\==" end="-\=%>" display contains=@crystalTop containedin=ALLBUT,@ecrystalRegions
|
||||
syn region ecrystalComment matchgroup=ecrystalDelimiter start="<%%\@!-\=#" end="-\=%>" display contains=crystalTodo,@Spell containedin=ALLBUT,@ecrystalRegions
|
||||
|
||||
" Define the default highlighting.
|
||||
|
||||
hi def link ecrystalDelimiter PreProc
|
||||
hi def link ecrystalComment crystalComment
|
||||
|
||||
let b:current_syntax = 'ecrystal'
|
||||
|
||||
if exists('main_syntax') && main_syntax ==# 'ecrystal'
|
||||
unlet main_syntax
|
||||
endif
|
||||
|
||||
endif
|
||||
Reference in New Issue
Block a user