mirror of
https://github.com/posva/vim-vue.git
synced 2026-01-21 23:02:04 +08:00
14
readme.md
14
readme.md
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user