annotate vendor/vim-syntax/typescript.vim @ 720:2cfa6fb4e755

Filetype for samba config
author nanaya <me@nanaya.net>
date Mon, 19 Aug 2024 16:52:59 +0900
parents 17cacf387f7c
children 78469331407e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
620
7ac088ee101a Add typescript vim syntax
nanaya <me@nanaya.pro>
parents:
diff changeset
1 " Vim syntax file
672
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
2 " Language: TypeScript
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
3 " Maintainer: Bram Moolenaar, Herrington Darkholme
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
4 " Last Change: 2019 Nov 30
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
5 " Based On: Herrington Darkholme's yats.vim
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
6 " Changes: Go to https:github.com/HerringtonDarkholme/yats.vim for recent changes.
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
7 " Origin: https://github.com/othree/yajs
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
8 " Credits: Kao Wei-Ko(othree), Jose Elera Campana, Zhao Yi, Claudio Fleiner, Scott Shattuck
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
9 " (This file is based on their hard work), gumnos (From the #vim
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
10 " IRC Channel in Freenode)
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
11
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
12 " This is the same syntax that is in yats.vim, but:
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
13 " - flattened into one file
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
14 " - HiLink commands changed to "hi def link"
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
15 " - Setting 'cpo' to the Vim value
620
7ac088ee101a Add typescript vim syntax
nanaya <me@nanaya.pro>
parents:
diff changeset
16
7ac088ee101a Add typescript vim syntax
nanaya <me@nanaya.pro>
parents:
diff changeset
17 if !exists("main_syntax")
672
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
18 if exists("b:current_syntax")
620
7ac088ee101a Add typescript vim syntax
nanaya <me@nanaya.pro>
parents:
diff changeset
19 finish
7ac088ee101a Add typescript vim syntax
nanaya <me@nanaya.pro>
parents:
diff changeset
20 endif
672
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
21 let main_syntax = 'typescript'
620
7ac088ee101a Add typescript vim syntax
nanaya <me@nanaya.pro>
parents:
diff changeset
22 endif
7ac088ee101a Add typescript vim syntax
nanaya <me@nanaya.pro>
parents:
diff changeset
23
672
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
24 let s:cpo_save = &cpo
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
25 set cpo&vim
620
7ac088ee101a Add typescript vim syntax
nanaya <me@nanaya.pro>
parents:
diff changeset
26
672
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
27 " this region is NOT used in TypeScriptReact
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
28 " nextgroup doesn't contain objectLiteral, let outer region contains it
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
29 syntax region typescriptTypeCast matchgroup=typescriptTypeBrackets
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
30 \ start=/< \@!/ end=/>/
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
31 \ contains=@typescriptType
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
32 \ nextgroup=@typescriptExpression
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
33 \ contained skipwhite oneline
620
7ac088ee101a Add typescript vim syntax
nanaya <me@nanaya.pro>
parents:
diff changeset
34
7ac088ee101a Add typescript vim syntax
nanaya <me@nanaya.pro>
parents:
diff changeset
35
672
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
36 """""""""""""""""""""""""""""""""""""""""""""""""""
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
37 " Source the part common with typescriptreact.vim
688
17cacf387f7c Update vendor
nanaya <me@nanaya.pro>
parents: 672
diff changeset
38 source <sfile>:h/shared/typescriptcommon.vim
620
7ac088ee101a Add typescript vim syntax
nanaya <me@nanaya.pro>
parents:
diff changeset
39
7ac088ee101a Add typescript vim syntax
nanaya <me@nanaya.pro>
parents:
diff changeset
40
7ac088ee101a Add typescript vim syntax
nanaya <me@nanaya.pro>
parents:
diff changeset
41 let b:current_syntax = "typescript"
7ac088ee101a Add typescript vim syntax
nanaya <me@nanaya.pro>
parents:
diff changeset
42 if main_syntax == 'typescript'
7ac088ee101a Add typescript vim syntax
nanaya <me@nanaya.pro>
parents:
diff changeset
43 unlet main_syntax
7ac088ee101a Add typescript vim syntax
nanaya <me@nanaya.pro>
parents:
diff changeset
44 endif
7ac088ee101a Add typescript vim syntax
nanaya <me@nanaya.pro>
parents:
diff changeset
45
672
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
46 let &cpo = s:cpo_save
2febdacae5b4 Use base vim typescript syntax
nanaya <me@nanaya.pro>
parents: 647
diff changeset
47 unlet s:cpo_save