Adriaan Zonnenberg 3c9105849b Merge pull request #62 from posva/register-function
Add a register function that makes it easier to add new languages
2017-03-26 22:45:19 +02:00
2017-03-22 23:34:53 +01:00
2017-03-26 21:27:34 +02:00
2017-03-26 22:35:15 +02:00

vim-vue CircleCI

Vim syntax highlighting for Vue components.

This was initially forked from 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

Plugin 'posva/vim-vue'

Install with Pathogen

cd ~/.vim/bundle && \
git clone https://github.com/posva/vim-vue.git

Install without a plugin manager (Vim 8)

git clone https://github.com/posva/vim-vue.git ~/.vim/pack/plugins/start

Integration with Syntastic

Currently only eslint is available. Please make sure eslint and eslint-plugin-vue are installed:

npm i -g eslint eslint-plugin-vue

Contributing

If your language is not getting highlighted open an issue or a PR with the fix. You only need to add a line to the syntax/vue.vim file.

FAQ

Where is Jade?

Jade has been renamed to pug. Therefore you have to replace all your jade occurrences with pug. The new plugin for pug can be found on the same repository (the name has already been updated).

Typescript support

You can use typescript by adding one of the following attributes/values to your component's script tag:

<script ts></script>
<script lang="ts"></script>
<script lang="typescript"></script>

Choose one that works with your module bundler

My syntax highlighting stops working randomly

This is because Vim tries to highlight text in an efficient way. Especially in files that include multiple languages, it can get confused. To work around this, you can run :syntax sync fromstart when it happens.

You can also setup an autocmd for this:

autocmd FileType vue syntax sync fromstart

See :h :syn-sync-first and this article for more details.

Description
Syntax Highlight for Vue.js components
Readme MIT 225 KiB
Languages
Vim Script 88.5%
Makefile 10.7%
Dockerfile 0.8%