Skip to content

Commit

Permalink
Merge pull request #1145 from theo4u/patch-1
Browse files Browse the repository at this point in the history
docs: vim ale standard fixer
  • Loading branch information
feross committed Aug 28, 2018
2 parents 6477dbf + f772106 commit c89d5c7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions README.md
Expand Up @@ -287,17 +287,16 @@ Install **[ale][vim-1]**. And add these lines to your `.vimrc` file.
let g:ale_linters = {
\ 'javascript': ['standard'],
\}
let g:ale_fixers = {'javascript': ['standard']}
```

This sets standard as your only linter for javascript files and so prevents conflicts with eslint.

For automatic formatting on save, add these lines to `.vimrc`:

This sets standard as your only linter and fixer for javascript files and so prevents conflicts with eslint. For linting and automatic fixing on save, add these lines to `.vimrc`:
```vim
autocmd bufwritepost *.js silent !standard --fix %
set autoread
let g:ale_lint_on_save = 1
let g:ale_fix_on_save = 1
```


Alternative plugins to consider include [neomake][vim-2] and [syntastic][vim-3], both of which have built-in support for `standard` (though configuration may be necessary).

[vim-1]: https://github.com/w0rp/ale
Expand Down

0 comments on commit c89d5c7

Please sign in to comment.