Skip to content

Commit fa90910

Browse files
committed
Added coffee, stylus and jade. Updated all files
1 parent fe47f2b commit fa90910

File tree

3 files changed

+29
-25
lines changed

3 files changed

+29
-25
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 Evan Sheehan
3+
Copyright (c) 2015 Evan Sheehan, Eduardo San Martin Morote
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+10-19
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,18 @@
33
Vim syntax highlighting for [Vue
44
components](http://vuejs.org/guide/application.html#Single_File_Components).
55

6-
## Installation
7-
8-
### Install with [Vundle][]
9-
10-
Add this line to your vimrc:
6+
This was initially forked from
7+
[darthmall/vim-vue](https://github.com/darthmall/vim-vue). I already have an
8+
implementation for this but found his code much cleaner. That's why I created a
9+
new version instead of a PR.
1110

12-
`Plugin 'darthmall/vim-vue'`
13-
14-
Then reload your vim configuration and run `PluginInstall`:
11+
## Installation
1512

16-
```vim
17-
:source ~/.vimrc
18-
:PluginInstall
19-
```
13+
### Install with [Vundle](https://github.com/VundleVim/Vundle.vim)
2014

21-
### Manual Installation
15+
`Plugin 'posva/vim-vue'`
2216

23-
```bash
24-
$ git clone https://github.com/darthmall/vim-vue.git
25-
$ cp vim-vue/ftdetect/vue.vim ~/.vim/ftdetect/
26-
$ cp vim-vue/syntax/vue.vim ~/.vim/syntax
27-
```
17+
## Contributing
2818

29-
[Vundle]: https://github.com/gmarik/Vundle.vim
19+
If your language is not getting highlighted open an issue or a PR with the fix.
20+
You only need to add some lines to the `syntax/vue.vim` file.

syntax/vue.vim

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,34 @@
11
" Vim syntax file
2-
" Language: Vue.js
3-
" Maintainer: W. Evan Sheehan
2+
" Language: Vue.js
3+
" Maintainer: Eduardo San Martin Morote
44

55
if exists("b:current_syntax")
66
finish
77
endif
88

99
syntax include @HTML syntax/html.vim
1010
unlet b:current_syntax
11-
syntax region template keepend start=/<template\( lang="[a-zA-Z]\+"\)\?>/ end="</template>" contains=@HTML fold
11+
syntax region template keepend start=/<template>/ end="</template>" contains=@HTML fold
12+
13+
syntax include @JADE syntax/jade.vim
14+
unlet b:current_syntax
15+
syntax region jade keepend start=/<template lang="[^"]*jade[^"]*">/ end="</template>" contains=@JADE fold
1216

1317
syntax include @JS syntax/javascript.vim
1418
unlet b:current_syntax
15-
syntax region script keepend start=/<script\( lang="[a-zA-Z]\+"\)\?>/ end="</script>" contains=@JS fold
19+
syntax region script keepend start=/<script>/ end="</script>" contains=@JS fold
20+
21+
syntax include @COFFEE syntax/coffee.vim
22+
unlet b:current_syntax
23+
" Matchgroup seems to be necessary for coffee
24+
syntax region coffee keepend matchgroup=Delimiter start="<script lang=\"coffee\">" end="</script>" contains=@COFFEE fold
1625

1726
syntax include @CSS syntax/css.vim
1827
unlet b:current_syntax
19-
syntax region style keepend start=/<style\( lang="[a-zA-Z]\+"\)\?>/ end="</style>" contains=@CSS fold
28+
syntax region style keepend start=/<style\( \+scoped\)\?>/ end="</style>" contains=@CSS fold
29+
30+
syntax include @stylus syntax/stylus.vim
31+
unlet b:current_syntax
32+
syntax region stylus keepend start=/<style lang="[^"]*stylus[^"]*"\( \+scoped\)\?>/ end="</style>" contains=@stylus fold
2033

2134
let b:current_syntax = "vue"

0 commit comments

Comments
 (0)