diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2019-12-07 12:21:37 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2019-12-07 12:21:37 +0100 |
commit | 7a0f2d974f9ac5bc85607e8c769d3370dd18ac74 (patch) | |
tree | 5c2b955af8e0f2ed54442d9e938fad403148ffce /after | |
parent | 15aeea662e0b08088ac7b6e3ee661c834e69106a (diff) | |
download | vim-polyglot-4.1.2.tar.gz vim-polyglot-4.1.2.zip |
Updatev4.1.2
Diffstat (limited to 'after')
-rw-r--r-- | after/ftplugin/javascriptreact.vim | 5 | ||||
-rw-r--r-- | after/ftplugin/typescriptreact.vim | 5 | ||||
-rw-r--r-- | after/indent/javascript.vim | 2 | ||||
-rw-r--r-- | after/indent/javascriptreact.vim | 5 | ||||
-rw-r--r-- | after/indent/typescript.vim | 2 | ||||
-rw-r--r-- | after/indent/typescriptreact.vim | 5 | ||||
-rw-r--r-- | after/syntax/javascriptreact.vim | 5 | ||||
-rw-r--r-- | after/syntax/tsx.vim | 28 | ||||
-rw-r--r-- | after/syntax/typescript.vim | 6 | ||||
-rw-r--r-- | after/syntax/typescriptreact.vim | 5 |
10 files changed, 66 insertions, 2 deletions
diff --git a/after/ftplugin/javascriptreact.vim b/after/ftplugin/javascriptreact.vim new file mode 100644 index 00000000..e423f0ed --- /dev/null +++ b/after/ftplugin/javascriptreact.vim @@ -0,0 +1,5 @@ +if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) + +source <sfile>:h/javascript.vim + +endif diff --git a/after/ftplugin/typescriptreact.vim b/after/ftplugin/typescriptreact.vim new file mode 100644 index 00000000..931839b1 --- /dev/null +++ b/after/ftplugin/typescriptreact.vim @@ -0,0 +1,5 @@ +if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) + +source <sfile>:h/typescript.vim + +endif diff --git a/after/indent/javascript.vim b/after/indent/javascript.vim index f183061c..24b7f937 100644 --- a/after/indent/javascript.vim +++ b/after/indent/javascript.vim @@ -21,7 +21,7 @@ if exists('s:did_indent') endif setlocal indentexpr=GetJsxIndent() -setlocal indentkeys=0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/ +setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/ function! GetJsxIndent() return jsx_pretty#indent#get(function('GetJavascriptIndent')) diff --git a/after/indent/javascriptreact.vim b/after/indent/javascriptreact.vim new file mode 100644 index 00000000..e423f0ed --- /dev/null +++ b/after/indent/javascriptreact.vim @@ -0,0 +1,5 @@ +if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) + +source <sfile>:h/javascript.vim + +endif diff --git a/after/indent/typescript.vim b/after/indent/typescript.vim index b7f0d185..dd8ee271 100644 --- a/after/indent/typescript.vim +++ b/after/indent/typescript.vim @@ -26,7 +26,7 @@ if exists('s:did_indent') endif setlocal indentexpr=GetJsxIndent() -setlocal indentkeys=0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/ +setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/ function! GetJsxIndent() return jsx_pretty#indent#get(function('GetTypescriptIndent')) diff --git a/after/indent/typescriptreact.vim b/after/indent/typescriptreact.vim new file mode 100644 index 00000000..931839b1 --- /dev/null +++ b/after/indent/typescriptreact.vim @@ -0,0 +1,5 @@ +if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) + +source <sfile>:h/typescript.vim + +endif diff --git a/after/syntax/javascriptreact.vim b/after/syntax/javascriptreact.vim new file mode 100644 index 00000000..e423f0ed --- /dev/null +++ b/after/syntax/javascriptreact.vim @@ -0,0 +1,5 @@ +if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) + +source <sfile>:h/javascript.vim + +endif diff --git a/after/syntax/tsx.vim b/after/syntax/tsx.vim new file mode 100644 index 00000000..863da121 --- /dev/null +++ b/after/syntax/tsx.vim @@ -0,0 +1,28 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1 + +" GraphQL Support +if exists('b:current_syntax') + let s:current_syntax = b:current_syntax + unlet b:current_syntax +endif +syn include @GraphQLSyntax syntax/graphql.vim +if exists('s:current_syntax') + let b:current_syntax = s:current_syntax +endif + +let s:tags = '\%(' . join(graphql#javascript_tags(), '\|') . '\)' + +exec 'syntax region graphqlTemplateString start=+' . s:tags . '\@20<=`+ skip=+\\`+ end=+`+ contains=@GraphQLSyntax,typescriptTemplateSubstitution extend' +exec 'syntax match graphqlTaggedTemplate +' . s:tags . '\ze`+ nextgroup=graphqlTemplateString' + +" Support expression interpolation ((${...})) inside template strings. +syntax region graphqlTemplateExpression start=+${+ end=+}+ contained contains=typescriptTemplateSubstitution containedin=graphqlFold keepend + +hi def link graphqlTemplateString typescriptTemplate +hi def link graphqlTemplateExpression typescriptTemplateSubstitution + +syn cluster typescriptExpression add=graphqlTaggedTemplate +syn cluster graphqlTaggedTemplate add=graphqlTemplateString + + +endif diff --git a/after/syntax/typescript.vim b/after/syntax/typescript.vim index 9f52ed21..8b00fb45 100644 --- a/after/syntax/typescript.vim +++ b/after/syntax/typescript.vim @@ -30,6 +30,12 @@ endif " refine the typescript line comment syntax region typescriptLineComment start=+//+ end=/$/ contains=@Spell,typescriptCommentTodo,typescriptRef extend keepend +for syntax_name in ['tsxRegion', 'tsxFragment'] + if hlexists(syntax_name) + exe 'syntax clear ' . syntax_name + endif +endfor + if !hlexists('typescriptTypeCast') " add a typescriptBlock group for typescript syntax region typescriptBlock diff --git a/after/syntax/typescriptreact.vim b/after/syntax/typescriptreact.vim new file mode 100644 index 00000000..931839b1 --- /dev/null +++ b/after/syntax/typescriptreact.vim @@ -0,0 +1,5 @@ +if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1) + +source <sfile>:h/typescript.vim + +endif |