diff --git a/README.md b/README.md index 8a653cd..e4230c9 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,7 @@ If you need full functionality of any plugin, please use it directly with your p - [vala](https://github.com/tkztmk/vim-vala) (syntax, indent, ftdetect) - [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax) - [vcl](https://github.com/smerrill/vcl-vim-plugin) (syntax, ftdetect) +- [vue](https://github.com/posva/vim-vue) (syntax, indent, ftplugin, ftdetect) - [vm](https://github.com/lepture/vim-velocity) (syntax, indent, ftdetect) - [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax) - [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin) diff --git a/after/ftplugin/vue.vim b/after/ftplugin/vue.vim new file mode 100644 index 0000000..fd78692 --- /dev/null +++ b/after/ftplugin/vue.vim @@ -0,0 +1,5 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vue') == -1 + +setlocal suffixesadd+=.vue + +endif diff --git a/build b/build index 430b737..be83c16 100755 --- a/build +++ b/build @@ -190,6 +190,7 @@ PACKS=" vala:tkztmk/vim-vala vbnet:vim-scripts/vbnet.vim vcl:smerrill/vcl-vim-plugin + vue:posva/vim-vue vm:lepture/vim-velocity xls:vim-scripts/XSLT-syntax yaml:stephpy/vim-yaml diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 54229aa..f431def 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -1000,4 +1000,11 @@ au BufRead,BufNewFile *.vm set ft=velocity syntax=velocity endif +" ftdetect/vue.vim +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vue') == -1 + +au BufNewFile,BufRead *.vue setf vue.html.javascript.css + +endif + augroup END diff --git a/ftplugin/vue.vim b/ftplugin/vue.vim new file mode 100644 index 0000000..9b4ec9b --- /dev/null +++ b/ftplugin/vue.vim @@ -0,0 +1,14 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vue') == -1 + +" Vim filetype plugin +" Language: Vue.js +" Maintainer: Eduardo San Martin Morote +" Author: Adriaan Zonnenberg + +if exists("b:did_ftplugin") + finish +endif + +runtime! ftplugin/html.vim + +endif diff --git a/indent/vue.vim b/indent/vue.vim new file mode 100644 index 0000000..e754ff6 --- /dev/null +++ b/indent/vue.vim @@ -0,0 +1,45 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vue') == -1 + +" Vim indent file +" Language: Vue.js +" Maintainer: Eduardo San Martin Morote +" Author: Adriaan Zonnenberg + +if exists("b:did_indent") + finish +endif + +" Load indent files for required languages +for language in ['stylus', 'pug', 'css', 'javascript', 'html', 'coffee'] + unlet! b:did_indent + exe "runtime! indent/".language.".vim" + exe "let s:".language."indent = &indentexpr" +endfor + +let b:did_indent = 1 + +setlocal indentexpr=GetVueIndent() + +if exists("*GetVueIndent") + finish +endif + +function! GetVueIndent() + if searchpair('