summaryrefslogblamecommitdiffstats
path: root/syntax/typescript.vim
blob: e6a3e4142488024b3333e60080c3e23dab6f49c0 (plain) (tree)
1
2
3
4
5
6
7
8




                                                                                                                                      
                                                                                   
 
                 









                                                                                                

                         
                               

          
                                

     





                                                                       
 
                         
 

                                   

                   
 
     
let files = filter(globpath(&rtp, 'syntax/typescript.vim', 1, 1), { _, v -> v !~ "vim-polyglot" && v !~ $VIMRUNTIME && v !~ "after" })
if len(files) > 0
  exec 'source ' . files[0]
  finish
endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1

" Vim syntax file
" Language:     TypeScript
" Maintainer:   Herrington Darkholme
" Last Change:  2016-04-05
" Version:      1.0
" Changes:      Go to https:github.com/HerringtonDarkholme/yats.vim for recent changes.
" Origin:       https://github.com/othree/yajs
" Credits:      Kao Wei-Ko(othree), Jose Elera Campana, Zhao Yi, Claudio Fleiner, Scott Shattuck
"               (This file is based on their hard work), gumnos (From the #vim
"               IRC Channel in Freenode)


if !exists("main_syntax")
  if exists("b:current_syntax")
    finish
  endif
  let main_syntax = 'typescript'
endif

" nextgroup doesn't contain objectLiteral, let outer region contains it
syntax region typescriptTypeCast matchgroup=typescriptTypeBrackets
  \ start=/< \@!/ end=/>/
  \ contains=@typescriptType
  \ nextgroup=@typescriptExpression
  \ contained skipwhite oneline

runtime syntax/common.vim

let b:current_syntax = "typescript"
if main_syntax == 'typescript'
  unlet main_syntax
endif

endif