From c898d5d13097ac64f305ceb720c8bdefa7bb9fec Mon Sep 17 00:00:00 2001 From: Nick Rhodes Date: Sun, 12 Aug 2018 07:56:14 +0100 Subject: Update README with the `*` ft option for the fixers object It wasn't immediately obvious that the `g:ale_fixers` cannot be a list, and would allow the use of `*` to match all filetypes. I was hoping to add a bit more detail to the README to make this clearer. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index cd11d323..09712719 100644 --- a/README.md +++ b/README.md @@ -241,6 +241,15 @@ let g:ale_fixers = { \} ``` +A `*` in place of the filetype will apply the corresponding list of fixers to +all filetypes. Note that using a plain list for `g:ale_fixers` is not supported. + +```vim +let g:ale_fixers = { +\ '*': ['remove_trailing_lines', 'trim_whitespace'], +\} +``` + If you want to automatically fix files when you save them, you need to turn a setting on in vimrc. -- cgit v1.2.3 From cc114e2d0a22950285636e75a3562c88e13db7de Mon Sep 17 00:00:00 2001 From: Nick Rhodes Date: Sun, 12 Aug 2018 10:06:48 +0100 Subject: Include info about `*` being a fallback The `*` filetype is just fallback, and will be overridden by specific filetype matches. --- README.md | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 09712719..d4d8f575 100644 --- a/README.md +++ b/README.md @@ -231,22 +231,17 @@ let b:ale_fixers = ['prettier', 'eslint'] let b:ale_fixers = {'javascript': ['prettier', 'eslint']} ``` -You can also configure your fixers from vimrc using `g:ale_fixers`, before -or after ALE has been loaded. +You can also configure your fixers from vimrc using `g:ale_fixers`, before or +after ALE has been loaded. A `*` in place of the filetype will apply the +corresponding list of fixers to all filetypes. If a subsequent specific filetype +match is found it will be used instead of `*`. Note that using a plain list for +`g:ale_fixers` is not supported. ```vim " In ~/.vim/vimrc, or somewhere similar. let g:ale_fixers = { -\ 'javascript': ['eslint'], -\} -``` - -A `*` in place of the filetype will apply the corresponding list of fixers to -all filetypes. Note that using a plain list for `g:ale_fixers` is not supported. - -```vim -let g:ale_fixers = { \ '*': ['remove_trailing_lines', 'trim_whitespace'], +\ 'javascript': ['eslint'], \} ``` -- cgit v1.2.3