mirror of
https://github.com/posva/vim-vue.git
synced 2025-12-08 10:24:45 +08:00
Added coffee, stylus and jade. Updated all files
This commit is contained in:
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Evan Sheehan
|
||||
Copyright (c) 2015 Evan Sheehan, Eduardo San Martin Morote
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
29
README.md
29
README.md
@@ -3,27 +3,18 @@
|
||||
Vim syntax highlighting for [Vue
|
||||
components](http://vuejs.org/guide/application.html#Single_File_Components).
|
||||
|
||||
This was initially forked from
|
||||
[darthmall/vim-vue](https://github.com/darthmall/vim-vue). I already have an
|
||||
implementation for this but found his code much cleaner. That's why I created a
|
||||
new version instead of a PR.
|
||||
|
||||
## Installation
|
||||
|
||||
### Install with [Vundle][]
|
||||
### Install with [Vundle](https://github.com/VundleVim/Vundle.vim)
|
||||
|
||||
Add this line to your vimrc:
|
||||
`Plugin 'posva/vim-vue'`
|
||||
|
||||
`Plugin 'darthmall/vim-vue'`
|
||||
## Contributing
|
||||
|
||||
Then reload your vim configuration and run `PluginInstall`:
|
||||
|
||||
```vim
|
||||
:source ~/.vimrc
|
||||
:PluginInstall
|
||||
```
|
||||
|
||||
### Manual Installation
|
||||
|
||||
```bash
|
||||
$ git clone https://github.com/darthmall/vim-vue.git
|
||||
$ cp vim-vue/ftdetect/vue.vim ~/.vim/ftdetect/
|
||||
$ cp vim-vue/syntax/vue.vim ~/.vim/syntax
|
||||
```
|
||||
|
||||
[Vundle]: https://github.com/gmarik/Vundle.vim
|
||||
If your language is not getting highlighted open an issue or a PR with the fix.
|
||||
You only need to add some lines to the `syntax/vue.vim` file.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim syntax file
|
||||
" Language: Vue.js
|
||||
" Maintainer: W. Evan Sheehan
|
||||
" Language: Vue.js
|
||||
" Maintainer: Eduardo San Martin Morote
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -8,14 +8,27 @@ endif
|
||||
|
||||
syntax include @HTML syntax/html.vim
|
||||
unlet b:current_syntax
|
||||
syntax region template keepend start=/<template\( lang="[a-zA-Z]\+"\)\?>/ end="</template>" contains=@HTML fold
|
||||
syntax region template keepend start=/<template>/ end="</template>" contains=@HTML fold
|
||||
|
||||
syntax include @JADE syntax/jade.vim
|
||||
unlet b:current_syntax
|
||||
syntax region jade keepend start=/<template lang="[^"]*jade[^"]*">/ end="</template>" contains=@JADE fold
|
||||
|
||||
syntax include @JS syntax/javascript.vim
|
||||
unlet b:current_syntax
|
||||
syntax region script keepend start=/<script\( lang="[a-zA-Z]\+"\)\?>/ end="</script>" contains=@JS fold
|
||||
syntax region script keepend start=/<script>/ end="</script>" contains=@JS fold
|
||||
|
||||
syntax include @COFFEE syntax/coffee.vim
|
||||
unlet b:current_syntax
|
||||
" Matchgroup seems to be necessary for coffee
|
||||
syntax region coffee keepend matchgroup=Delimiter start="<script lang=\"coffee\">" end="</script>" contains=@COFFEE fold
|
||||
|
||||
syntax include @CSS syntax/css.vim
|
||||
unlet b:current_syntax
|
||||
syntax region style keepend start=/<style\( lang="[a-zA-Z]\+"\)\?>/ end="</style>" contains=@CSS fold
|
||||
syntax region style keepend start=/<style\( \+scoped\)\?>/ end="</style>" contains=@CSS fold
|
||||
|
||||
syntax include @stylus syntax/stylus.vim
|
||||
unlet b:current_syntax
|
||||
syntax region stylus keepend start=/<style lang="[^"]*stylus[^"]*"\( \+scoped\)\?>/ end="</style>" contains=@stylus fold
|
||||
|
||||
let b:current_syntax = "vue"
|
||||
|
||||
Reference in New Issue
Block a user