mirror of
https://github.com/amix/vimrc
synced 2025-02-28 14:12:51 +08:00
.. | ||
syntax_checkers/vue | ||
README.md |
vim-vue-syntastic
1. What?
Support for vue components linting with syntastic and eslint
2. Dependencies
2.1. Installing vim-vue-syntastic with Pathogen
If you already have [Pathogen][1] working then skip Step 1 and go to Step 2.
2.1.1. Step 1: Install pathogen.vim
First I'll show you how to install Tim Pope's [Pathogen][1] so that it's easy to
install syntastic. Do this in your terminal so that you get the pathogen.vim
file and the directories it needs:
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
Next you need to add this to your ~/.vimrc
:
execute pathogen#infect()
2.1.3. Step 2: Install vim-vue-syntastic as a Pathogen bundle and friends
You now have pathogen installed and can put syntastic into ~/.vim/bundle
like
this:
cd ~/.vim/bundle && \
git clone https://github.com/sekel/vim-vue-syntastic.git
... and the same song and dance for the dependencies
2.1.3. Step 3: Optional configuration to make it work with local project eslint
Stick this in your ~/.vimrc
:
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_vue_checkers = ['eslint']
let local_eslint = finddir('node_modules', '.;') . '/.bin/eslint'
if matchstr(local_eslint, "^\/\\w") == ''
let local_eslint = getcwd() . "/" . local_eslint
endif
if executable(local_eslint)
let g:syntastic_javascript_eslint_exec = local_eslint
let g:syntastic_vue_eslint_exec = local_eslint
endif