summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKabbaj Amine <amine.kabb@gmail.com>2016-10-07 19:48:47 +0300
committerKabbaj Amine <amine.kabb@gmail.com>2016-10-07 19:48:47 +0300
commitc3ae8305b788fe3efba85d4e152727b10abecd41 (patch)
tree8cd729ef2c60612570fbf3324f248271c406fc3c
parentf128f7810dee652dec02349fcacb78b26a515559 (diff)
downloadale-c3ae8305b788fe3efba85d4e152727b10abecd41.zip
Update the documentation files
... and move all pictures to img/ directory
-rw-r--r--README.md28
-rw-r--r--doc/ale.txt18
-rw-r--r--img/example.gif (renamed from example.gif)bin3461005 -> 3461005 bytes
-rw-r--r--img/issues.pngbin0 -> 1008 bytes
-rw-r--r--img/no_issues.pngbin0 -> 956 bytes
5 files changed, 44 insertions, 2 deletions
diff --git a/README.md b/README.md
index 03bca3cf..827479c5 100644
--- a/README.md
+++ b/README.md
@@ -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
@@ -83,6 +83,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
@@ -123,6 +124,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.
diff --git a/doc/ale.txt b/doc/ale.txt
index b428d6d8..1f6ef977 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -1,4 +1,4 @@
-*ale.txt* For Vim version 8.0. Last change: 2016 October 5
+*ale.txt* For Vim version 8.0. Last change: 2016 October 7
*ale*
ALE - Asychronous Lint Engine
@@ -219,6 +219,16 @@ you can disable these warnings for some linters by setting this option to `0`.
Not all linters may respect this option. If a linter does not, please
file a bug report, and it may be possible to add such support.
+g:ale_statusline_format *g:ale_statusline_format*
+
+Type: |List|
+Default: `['%d error(s)', '%d warning(s)', 'OK']`
+
+This variable defines the format of |`ALEGetStatusLine()`| output.
+- The 1st element is for errors
+- The 2nd element is for warnings
+- The 3rd element is for when no erros are detected
+
===============================================================================
4. Linter Specific Options *ale-linter-options*
@@ -319,6 +329,12 @@ ALEGetLinters(filetype) *ALEGetLinters()*
Return all of linters configured for a given filetype as a |List| of
|Dictionary| values in the format specified by |ALEAddLinter()|.
+ALEGetStatusLine() *ALEGetStatusLine()*
+ Return a formatted string that can be added to the statusline.
+ The output's format is defined in |`g:ale_statusline_format`|.
+ To enable it, the following should be present in your |statusline| settings: >
+ %{ALEGetStatusLine()}
+
g:ale#util#stdin_wrapper *g:ale#util#stdin_wrapper*
This variable names a wrapper script for sending stdin input to programs
which cannot accept input via stdin. See |ALEAddLinter| for more.
diff --git a/example.gif b/img/example.gif
index 1ad8f75b..1ad8f75b 100644
--- a/example.gif
+++ b/img/example.gif
Binary files differ
diff --git a/img/issues.png b/img/issues.png
new file mode 100644
index 00000000..7415d039
--- /dev/null
+++ b/img/issues.png
Binary files differ
diff --git a/img/no_issues.png b/img/no_issues.png
new file mode 100644
index 00000000..397804ea
--- /dev/null
+++ b/img/no_issues.png
Binary files differ