Merge pull request #55 from esdras/master

Add typescript support
This commit is contained in:
Eduardo San Martin Morote
2017-03-14 16:13:33 +01:00
committed by GitHub
2 changed files with 21 additions and 1 deletions

View File

@@ -38,6 +38,20 @@ Currently only `eslint` is available. Please make sure `eslint` and
npm i -g eslint eslint-plugin-vue
```
## Typescript support
You can use typescript by adding one of the following attributes/values to
your component's script tag:
```html
<script ts></script>
<script lang="ts"></script>
<script lang="typescript"></script>
```
Choose one that works with your module bundler
## Contributing
If your language is not getting highlighted open an issue or a PR with the fix.

View File

@@ -31,7 +31,7 @@ endif
syntax include @HTML syntax/html.vim
unlet! b:current_syntax
syntax region html keepend start=/^<template>/ end=/^<\/template>/ contains=@HTML fold
syntax region html keepend start=/^<template\( lang=\("\|'\)[^\1]*html[^\1]*\1\)\?>/ end=/^<\/template>/ contains=@HTML fold
if s:syntaxes.pug
syntax include @PUG syntax/pug.vim
@@ -50,6 +50,12 @@ syntax include @JS syntax/javascript.vim
unlet! b:current_syntax
syntax region javascript keepend matchgroup=Delimiter start=/<script\( lang="babel"\)\?\( type="text\/babel"\)\?>/ end="</script>" contains=@JS fold
syntax include @TS syntax/typescript.vim
if exists("b:current_syntax")
unlet b:current_syntax
endif
syntax region typescript keepend matchgroup=Delimiter start=/<script \_[^>]*\(lang=\("\|'\)[^\2]*\(ts\|typescript\)[^\2]*\2\|ts\)\_[^>]*>/ end="</script>" contains=@TS fold
if s:syntaxes.coffee
syntax include @COFFEE syntax/coffee.vim
unlet! b:current_syntax