mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 05:04:28 +08:00
Move :ALEInfo higher up in the FAQ
This commit is contained in:
84
README.md
84
README.md
@@ -61,23 +61,23 @@ other content at [w0rp.com](https://w0rp.com).
|
|||||||
4. [Contributing](#contributing)
|
4. [Contributing](#contributing)
|
||||||
5. [FAQ](#faq)
|
5. [FAQ](#faq)
|
||||||
1. [How do I disable particular linters?](#faq-disable-linters)
|
1. [How do I disable particular linters?](#faq-disable-linters)
|
||||||
2. [How can I keep the sign gutter open?](#faq-keep-signs)
|
2. [How can I see what ALE has configured for the current file?](#faq-get-info)
|
||||||
3. [How can I change the signs ALE uses?](#faq-change-signs)
|
3. [How can I keep the sign gutter open?](#faq-keep-signs)
|
||||||
4. [How can I change or disable the highlights ALE uses?](#faq-change-highlights)
|
4. [How can I change the signs ALE uses?](#faq-change-signs)
|
||||||
5. [How can I show errors or warnings in my statusline?](#faq-statusline)
|
5. [How can I change or disable the highlights ALE uses?](#faq-change-highlights)
|
||||||
6. [How can I show errors or warnings in my lightline?](#faq-lightline)
|
6. [How can I show errors or warnings in my statusline?](#faq-statusline)
|
||||||
7. [How can I change the format for echo messages?](#faq-echo-format)
|
7. [How can I show errors or warnings in my lightline?](#faq-lightline)
|
||||||
8. [How can I execute some code when ALE starts or stops linting?](#faq-autocmd)
|
8. [How can I change the format for echo messages?](#faq-echo-format)
|
||||||
9. [How can I navigate between errors quickly?](#faq-navigation)
|
9. [How can I execute some code when ALE starts or stops linting?](#faq-autocmd)
|
||||||
10. [How can I run linters only when I save files?](#faq-lint-on-save)
|
10. [How can I navigate between errors quickly?](#faq-navigation)
|
||||||
11. [How can I use the quickfix list instead of the loclist?](#faq-quickfix)
|
11. [How can I run linters only when I save files?](#faq-lint-on-save)
|
||||||
12. [How can I check JSX files with both stylelint and eslint?](#faq-jsx-stylelint-eslint)
|
12. [How can I use the quickfix list instead of the loclist?](#faq-quickfix)
|
||||||
13. [How can I check Vue files with ESLint?](#faq-vue-eslint)
|
13. [How can I check JSX files with both stylelint and eslint?](#faq-jsx-stylelint-eslint)
|
||||||
14. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
|
14. [How can I check Vue files with ESLint?](#faq-vue-eslint)
|
||||||
15. [How can I configure my C or C++ project?](#faq-c-configuration)
|
15. [Will this plugin eat all of my laptop battery power?](#faq-my-battery-is-sad)
|
||||||
16. [How can I configure ALE differently for different buffers?](#faq-buffer-configuration)
|
16. [How can I configure my C or C++ project?](#faq-c-configuration)
|
||||||
17. [How can I configure the height of the list in which ALE displays errors?](#faq-list-window-height)
|
17. [How can I configure ALE differently for different buffers?](#faq-buffer-configuration)
|
||||||
18. [How can I see what ALE has configured for the current file?](#faq-get-info)
|
18. [How can I configure the height of the list in which ALE displays errors?](#faq-list-window-height)
|
||||||
|
|
||||||
<a name="supported-languages"></a>
|
<a name="supported-languages"></a>
|
||||||
|
|
||||||
@@ -415,9 +415,19 @@ This plugin will look for linters in the [`ale_linters`](ale_linters) directory.
|
|||||||
Each directory within corresponds to a particular filetype in Vim, and each file
|
Each directory within corresponds to a particular filetype in Vim, and each file
|
||||||
in each directory corresponds to the name of a particular linter.
|
in each directory corresponds to the name of a particular linter.
|
||||||
|
|
||||||
|
<a name="faq-get-info"></a>
|
||||||
|
|
||||||
|
### 5.ii. How can I see what ALE has configured for the current file?
|
||||||
|
|
||||||
|
Run the following to see what is currently configured:
|
||||||
|
|
||||||
|
```vim
|
||||||
|
:ALEInfo
|
||||||
|
```
|
||||||
|
|
||||||
<a name="faq-keep-signs"></a>
|
<a name="faq-keep-signs"></a>
|
||||||
|
|
||||||
### 5.ii. How can I keep the sign gutter open?
|
### 5.iii. How can I keep the sign gutter open?
|
||||||
|
|
||||||
You can keep the sign gutter open at all times by setting the
|
You can keep the sign gutter open at all times by setting the
|
||||||
`g:ale_sign_column_always` to 1
|
`g:ale_sign_column_always` to 1
|
||||||
@@ -428,7 +438,7 @@ let g:ale_sign_column_always = 1
|
|||||||
|
|
||||||
<a name="faq-change-signs"></a>
|
<a name="faq-change-signs"></a>
|
||||||
|
|
||||||
### 5.iii. How can I change the signs ALE uses?
|
### 5.iv. How can I change the signs ALE uses?
|
||||||
|
|
||||||
Use these options to specify what text should be used for signs:
|
Use these options to specify what text should be used for signs:
|
||||||
|
|
||||||
@@ -448,7 +458,7 @@ highlight clear ALEWarningSign
|
|||||||
|
|
||||||
<a name="faq-change-highlights"></a>
|
<a name="faq-change-highlights"></a>
|
||||||
|
|
||||||
### 5.iv. How can I change or disable the highlights ALE uses?
|
### 5.v. How can I change or disable the highlights ALE uses?
|
||||||
|
|
||||||
ALE's highlights problems with highlight groups which link to `SpellBad`,
|
ALE's highlights problems with highlight groups which link to `SpellBad`,
|
||||||
`SpellCap`, `error`, and `todo` groups by default. The characters that are
|
`SpellCap`, `error`, and `todo` groups by default. The characters that are
|
||||||
@@ -474,7 +484,7 @@ See `:help ale-highlights` for more information.
|
|||||||
|
|
||||||
<a name="faq-statusline"></a>
|
<a name="faq-statusline"></a>
|
||||||
|
|
||||||
### 5.v. How can I show errors or warnings in my statusline?
|
### 5.vi. How can I show errors or warnings in my statusline?
|
||||||
|
|
||||||
[vim-airline](https://github.com/vim-airline/vim-airline) integrates with ALE
|
[vim-airline](https://github.com/vim-airline/vim-airline) integrates with ALE
|
||||||
for displaying error information in the status bar. If you want to see the
|
for displaying error information in the status bar. If you want to see the
|
||||||
@@ -523,7 +533,7 @@ for more information.
|
|||||||
|
|
||||||
<a name="faq-lightline"></a>
|
<a name="faq-lightline"></a>
|
||||||
|
|
||||||
### 5.vi. How can I show errors or warnings in my lightline?
|
### 5.vii. How can I show errors or warnings in my lightline?
|
||||||
|
|
||||||
[lightline](https://github.com/itchyny/lightline.vim) does not have built-in
|
[lightline](https://github.com/itchyny/lightline.vim) does not have built-in
|
||||||
support for ALE, nevertheless there is a plugin that adds this functionality: [maximbaz/lightline-ale](https://github.com/maximbaz/lightline-ale).
|
support for ALE, nevertheless there is a plugin that adds this functionality: [maximbaz/lightline-ale](https://github.com/maximbaz/lightline-ale).
|
||||||
@@ -561,7 +571,7 @@ See `:help g:ale_echo_msg_format` for more information.
|
|||||||
|
|
||||||
<a name="faq-autocmd"></a>
|
<a name="faq-autocmd"></a>
|
||||||
|
|
||||||
### 5.viii. How can I execute some code when ALE starts or stops linting?
|
### 5.ix. How can I execute some code when ALE starts or stops linting?
|
||||||
|
|
||||||
ALE runs its own [autocmd](http://vimdoc.sourceforge.net/htmldoc/autocmd.html)
|
ALE runs its own [autocmd](http://vimdoc.sourceforge.net/htmldoc/autocmd.html)
|
||||||
events when a lint or fix cycle are started and stopped. There is also an event
|
events when a lint or fix cycle are started and stopped. There is also an event
|
||||||
@@ -584,7 +594,7 @@ augroup END
|
|||||||
|
|
||||||
<a name="faq-navigation"></a>
|
<a name="faq-navigation"></a>
|
||||||
|
|
||||||
### 5.ix. How can I navigate between errors quickly?
|
### 5.x. How can I navigate between errors quickly?
|
||||||
|
|
||||||
ALE offers some commands with `<Plug>` keybinds for moving between warnings and
|
ALE offers some commands with `<Plug>` keybinds for moving between warnings and
|
||||||
errors quickly. You can map the keys Ctrl+j and Ctrl+k to moving between errors
|
errors quickly. You can map the keys Ctrl+j and Ctrl+k to moving between errors
|
||||||
@@ -600,7 +610,7 @@ For more information, consult the online documentation with
|
|||||||
|
|
||||||
<a name="faq-lint-on-save"></a>
|
<a name="faq-lint-on-save"></a>
|
||||||
|
|
||||||
### 5.x. How can I run linters only when I save files?
|
### 5.xi. How can I run linters only when I save files?
|
||||||
|
|
||||||
ALE offers an option `g:ale_lint_on_save` for enabling running the linters
|
ALE offers an option `g:ale_lint_on_save` for enabling running the linters
|
||||||
when files are saved. This option is enabled by default. If you only
|
when files are saved. This option is enabled by default. If you only
|
||||||
@@ -621,7 +631,7 @@ files, you can set `g:ale_lint_on_save` to `0`.
|
|||||||
|
|
||||||
<a name="faq-quickfix"></a>
|
<a name="faq-quickfix"></a>
|
||||||
|
|
||||||
### 5.xi. How can I use the quickfix list instead of the loclist?
|
### 5.xii. How can I use the quickfix list instead of the loclist?
|
||||||
|
|
||||||
The quickfix list can be enabled by turning the `g:ale_set_quickfix`
|
The quickfix list can be enabled by turning the `g:ale_set_quickfix`
|
||||||
option on. If you wish to also disable the loclist, you can disable
|
option on. If you wish to also disable the loclist, you can disable
|
||||||
@@ -651,7 +661,7 @@ instead of the default horizontally.
|
|||||||
|
|
||||||
<a name="faq-jsx-stylelint-eslint"></a>
|
<a name="faq-jsx-stylelint-eslint"></a>
|
||||||
|
|
||||||
### 5.xii. How can I check JSX files with both stylelint and eslint?
|
### 5.xiii. How can I check JSX files with both stylelint and eslint?
|
||||||
|
|
||||||
If you configure ALE options correctly in your vimrc file, and install
|
If you configure ALE options correctly in your vimrc file, and install
|
||||||
the right tools, you can check JSX files with stylelint and eslint.
|
the right tools, you can check JSX files with stylelint and eslint.
|
||||||
@@ -693,7 +703,7 @@ no linter will be run twice for the same file.
|
|||||||
|
|
||||||
<a name="faq-vue-eslint"></a>
|
<a name="faq-vue-eslint"></a>
|
||||||
|
|
||||||
### 5.xiii. How can I check Vue files with ESLint?
|
### 5.xiv. How can I check Vue files with ESLint?
|
||||||
|
|
||||||
To check Vue files with ESLint, your ESLint project configuration file must be
|
To check Vue files with ESLint, your ESLint project configuration file must be
|
||||||
configured to use the [Vue plugin](https://github.com/vuejs/eslint-plugin-vue).
|
configured to use the [Vue plugin](https://github.com/vuejs/eslint-plugin-vue).
|
||||||
@@ -724,7 +734,7 @@ let g:ale_linters = {'vue': ['eslint', 'vls']}
|
|||||||
|
|
||||||
<a name="faq-my-battery-is-sad"></a>
|
<a name="faq-my-battery-is-sad"></a>
|
||||||
|
|
||||||
### 5.xiv. Will this plugin eat all of my laptop battery power?
|
### 5.xv. Will this plugin eat all of my laptop battery power?
|
||||||
|
|
||||||
ALE takes advantage of the power of various tools to check your code. This of
|
ALE takes advantage of the power of various tools to check your code. This of
|
||||||
course means that CPU time will be used to continuously check your code. If you
|
course means that CPU time will be used to continuously check your code. If you
|
||||||
@@ -748,7 +758,7 @@ including the option `g:ale_lint_on_enter`, and you can run ALE manually with
|
|||||||
|
|
||||||
<a name="faq-c-configuration"></a>
|
<a name="faq-c-configuration"></a>
|
||||||
|
|
||||||
### 5.xv. How can I configure my C or C++ project?
|
### 5.xvi. How can I configure my C or C++ project?
|
||||||
|
|
||||||
The structure of C and C++ projects varies wildly from project to project, with
|
The structure of C and C++ projects varies wildly from project to project, with
|
||||||
many different build tools being used for building them, and many different
|
many different build tools being used for building them, and many different
|
||||||
@@ -774,7 +784,7 @@ used for executing local vimrc files which can be shared in your project.
|
|||||||
|
|
||||||
<a name="faq-buffer-configuration"></a>
|
<a name="faq-buffer-configuration"></a>
|
||||||
|
|
||||||
### 5.xvi. How can I configure ALE differently for different buffers?
|
### 5.xvii. How can I configure ALE differently for different buffers?
|
||||||
|
|
||||||
ALE offers various ways to configure which linters or fixers are run, and
|
ALE offers various ways to configure which linters or fixers are run, and
|
||||||
other settings. For the majority of ALE's settings, they can either be
|
other settings. For the majority of ALE's settings, they can either be
|
||||||
@@ -810,7 +820,7 @@ Buffer-local variables for settings always override the global settings.
|
|||||||
|
|
||||||
<a name="faq-list-window-height"></a>
|
<a name="faq-list-window-height"></a>
|
||||||
|
|
||||||
### 5.xvii. How can I configure the height of the list in which ALE displays errors?
|
### 5.xviii. How can I configure the height of the list in which ALE displays errors?
|
||||||
|
|
||||||
To set a default height for the error list, use the `g:ale_list_window_size` variable.
|
To set a default height for the error list, use the `g:ale_list_window_size` variable.
|
||||||
|
|
||||||
@@ -818,13 +828,3 @@ To set a default height for the error list, use the `g:ale_list_window_size` var
|
|||||||
" Show 5 lines of errors (default: 10)
|
" Show 5 lines of errors (default: 10)
|
||||||
let g:ale_list_window_size = 5
|
let g:ale_list_window_size = 5
|
||||||
```
|
```
|
||||||
|
|
||||||
<a name="faq-get-info"></a>
|
|
||||||
|
|
||||||
### 5.xviii. How can I see what ALE has configured for the current file?
|
|
||||||
|
|
||||||
Run the following to see what is currently configured:
|
|
||||||
|
|
||||||
```vim
|
|
||||||
:ALEInfo
|
|
||||||
```
|
|
||||||
|
|||||||
Reference in New Issue
Block a user