mirror of
https://github.com/posva/vim-vue.git
synced 2025-12-07 18:14:26 +08:00
Add basic syntax files
- Set the filetype to "vue" for files with a .vue extension - Define regions for <template>, <style>, and <script> tags - Include HTML, CSS, and JavaScript syntax highlighting for the <template>, <style>, and <script> regions
This commit is contained in:
2
README.md
Normal file
2
README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
Vim syntax highlighting for [Vue
|
||||
components](http://vuejs.org/guide/application.html#Single_File_Components).
|
||||
1
ftdetect/vue.vim
Normal file
1
ftdetect/vue.vim
Normal file
@@ -0,0 +1 @@
|
||||
au BufNewFile,BufRead *.vue setf vue
|
||||
21
syntax/vue.vim
Normal file
21
syntax/vue.vim
Normal file
@@ -0,0 +1,21 @@
|
||||
" Vim syntax file
|
||||
" Language: Vue.js
|
||||
" Maintainer: W. Evan Sheehan
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
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 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 include @CSS syntax/css.vim
|
||||
unlet b:current_syntax
|
||||
syntax region style keepend start=/<style\( lang="[a-zA-Z]\+"\)\?>/ end="</style>" contains=@CSS fold
|
||||
|
||||
let b:current_syntax = "vue"
|
||||
Reference in New Issue
Block a user