diff options
author | w0rp <w0rp@users.noreply.github.com> | 2016-10-07 18:29:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-07 18:29:36 +0100 |
commit | f6e95586dd04fff1480b738ff989fcc114bc38eb (patch) | |
tree | eb2fe5a470568d9454bf12dd117a60ab5dd2bb43 /README.md | |
parent | d97e25a2601d58a1d7e8ae72fb787210f2588a69 (diff) | |
parent | c3ae8305b788fe3efba85d4e152727b10abecd41 (diff) | |
download | ale-f6e95586dd04fff1480b738ff989fcc114bc38eb.zip |
Merge pull request #58 from KabbAmine/statusline
Add an initial getStatuslineStr function with customizable output
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -3,7 +3,7 @@ ALE (Asynchronous Lint Engine) is a plugin for providing linting in NeoVim and Vim 8 while you edit your text files. -![linting example](example.gif?raw=true) +![linting example](img/example.gif?raw=true) ALE makes use of NeoVim and Vim 8 job control functions and timers to run linters on the contents of text buffers and return errors as @@ -84,6 +84,7 @@ vimrc file for all given linters is as follows: | `g:ale_sign_offset` | an offset for sign ids | `1000000` | | `g:ale_echo_cursor` | echo errors when the cursor is over them | `1` | | `g:ale_warn_about_trailing_whitespace` | enable trailing whitespace warnings for some linters | `1` | +| `g:ale_statusline_format` | String format to use in statusline flag | `['%d error(s)', '%d warning(s)', 'OK']` | ### Selecting Particular Linters @@ -124,6 +125,31 @@ let g:ale_sign_error = '>>' let g:ale_sign_warning = '--' ``` +### Statusline + +You can use `ALEGetStatusLine()` to integrate ALE into vim statusline. +To enable it, you should have in your `statusline` settings + +```vim +%{ALEGetStatusLine()} +``` + +When errors are detected a string showing the number of errors will be shown. +You can customize the output format using the global list `g:ale_statusline_format` where: + +- The 1st element is for errors +- The 2nd element is for warnings +- The 3rd element is for when no erros are detected + +e.g + +```vim +let g:ale_statusline_format = ['⨉ %d', '⚠ %d', '⬥ ok'] +``` + +![Statusline with issues](img/issues.png) +![Statusline with no issues](img/no_issues.png) + ## Installation To install this plugin, you should use one of the following methods. |