Skip to content

Commit 0db02a2

Browse files
KoushienConduitry
authored andcommitted
add vim section for use with ALE
1 parent 7d52015 commit 0db02a2

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,32 @@ Then, you'll need to tell SublimeLinter-eslint to lint entire files with the `te
135135

136136
Reload Sublime and give it a go!
137137

138+
### Vim
139+
140+
You'll need the [ALE (Asynchronous Lint Engine)](https://github.com/w0rp/ale) plugin installed.
141+
142+
Unless you're using `.html` for your Svelte components, you'll need to configure Vim to associate the appropriate file extension with the `html` syntax. For example, to associate `.svelte`, put this in your `.vimrc`:
143+
144+
```vim
145+
au BufNewFile,BufRead,BufReadPost *.svelte set syntax=html
146+
```
147+
148+
Then you'll need to tell ALE to lint and fix `.svelte` files using ESLint, so put this in your `.vimrc`:
149+
150+
```vim
151+
let g:ale_linter_aliases = {
152+
\ 'svelte': ['javascript']
153+
\}
154+
let g:ale_linters = {
155+
\ 'svelte': ['eslint']
156+
\}
157+
let g:ale_fixers = {
158+
\ 'svelte': ['eslint']
159+
\}
160+
```
161+
162+
Reload Vim and give it a go!
163+
138164
### Other integrations
139165

140166
If you've gotten this plugin to work with other editors, please let us know!

0 commit comments

Comments
 (0)