Skip to content

Commit 29f860e

Browse files
committed
Vim: document how to configure plugin
1 parent bf90a3b commit 29f860e

File tree

5 files changed

+152
-0
lines changed

5 files changed

+152
-0
lines changed

docs/RELEASE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Follow the following steps to release a new version of quick-lint-js:
1717
* dist/npm/package.json
1818
* docs/cli.adoc
1919
* docs/config.adoc
20+
* plugin/vim/quick-lint-js.vim/doc/quick-lint-js.txt
2021
* plugin/vscode-lsp/README.md
2122
* plugin/vscode-lsp/package.json
2223
* plugin/vscode/BUILDING.md
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
*quick-lint-js.txt* For Vim and Neovim
2+
3+
4+
QUICK-LINT-JS PLUGIN REFERENCE MANUAL
5+
6+
7+
This file contains instructions for installing and using the quick-lint-js
8+
plugin.
9+
10+
This plugin version is designed for quick-lint-js version 0.2.0. Older or
11+
newer version might or might not work.
12+
13+
1. Installing quick-lint-js |quick-lint-js-app-install|
14+
2. Installing the plugin |quick-lint-js-vim-install|
15+
3. Configuring |quick-lint-js-configure|
16+
3.1. ALE |quick-lint-js-configure-ale|
17+
18+
==============================================================================
19+
1. Installing quick-lint-js *quick-lint-js-app-install*
20+
21+
In order to use the quick-lint-js Vim plugin, you must first install the
22+
quick-lint-js CLI. See this page for instructions on installing the
23+
quick-lint-js CLI for your system:
24+
25+
https://quick-lint-js.com/install/
26+
27+
==============================================================================
28+
2. Installing the plugin *quick-lint-js-vim-install*
29+
30+
If you're reading this document, you've probably already installed the
31+
quick-lint-js Vim plugin. If you're not sure, open Vim and run this command: >
32+
33+
:help quick-lint-js
34+
35+
If you see this documentation, you have already installed the Vim plugin. Go
36+
to the next section, |quick-lint-js-configure|.
37+
38+
If you see error code E149 ("Sorry, no help for quick-lint-js"), then you
39+
need to install the Vim plugin: https://quick-lint-js.com/install/#manual-vim
40+
41+
==============================================================================
42+
3. Configuring *quick-lint-js-configure*
43+
44+
After installing the quick-lint-js CLI and the quick-lint-js Vim plugin, you
45+
may need to configure the plugin.
46+
47+
One of the following Vim plugins must be installed and configured in order for
48+
this plugin to work:
49+
50+
* ALE - Asynchronous Lint Engine: |quick-lint-js-configure-ale|
51+
https://github.com/dense-analysis/ale
52+
53+
==============================================================================
54+
4. Configuring for ALE *quick-lint-js-configure-ale*
55+
56+
The quick-lint-js Vim plugin comes with a plugin for ALE (Asynchronous Lint
57+
Engine). https://github.com/dense-analysis/ale
58+
59+
Supported ALE versions: v2.1.1 or newer, and v3.0.0 or newer
60+
61+
quick-lint-js is fast. To feel the speed, you should configure
62+
|g:ale_lint_delay|. Add the following code to your |vimrc| to make JavaScript
63+
linting as fast as possible: >
64+
65+
let g:ale_lint_delay = 0
66+
67+
The quick-lint-js Vim plugin registers an ALE linter called `quick-lint-js`.
68+
If you enable |g:ale_linters_explicit|, add the following code to
69+
`~/.vim/ftplugin/javascript.vim` (UNIX) or
70+
`~/vimfiles/ftplugin/javascript.vim` (Windows) to enable quick-lint-js: >
71+
72+
let b:ale_linters = ['quick-lint-js']
73+
74+
g:ale_javascript_quick_lint_js_executable
75+
*g:ale_javascript_quick_lint_js_executable*
76+
*b:ale_javascript_quick_lint_js_executable*
77+
Type: |String|
78+
Default: `'quick-lint-js'`
79+
80+
Set this variable to the path of the quick-lint-js CLI.
81+
82+
If you want to use quick-lint-js installed in a project through NPM, try
83+
adding this to your vimrc file: >
84+
85+
" Security risk! Someone might drop a malicious binary into a project.
86+
" Beware!
87+
let g:ale_javascript_quick_lint_js_executable
88+
\ = 'node_modules/.bin/quick-lint-js'
89+
90+
vim:tw=78:ts=8:noet:ft=help:norl:

plugin/vim/quick-lint-js.vim/doc/tags

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
b:ale_javascript_quick_lint_js_executable quick-lint-js.txt /*b:ale_javascript_quick_lint_js_executable*
2+
g:ale_javascript_quick_lint_js_executable quick-lint-js.txt /*g:ale_javascript_quick_lint_js_executable*
3+
quick-lint-js-app-install quick-lint-js.txt /*quick-lint-js-app-install*
4+
quick-lint-js-configure quick-lint-js.txt /*quick-lint-js-configure*
5+
quick-lint-js-configure-ale quick-lint-js.txt /*quick-lint-js-configure-ale*
6+
quick-lint-js-vim-install quick-lint-js.txt /*quick-lint-js-vim-install*
7+
quick-lint-js.txt quick-lint-js.txt /*quick-lint-js.txt*

tools/generate-vim-tags

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
3+
# Copyright (C) 2020 Matthew Glazar
4+
# See end of file for extended copyright information.
5+
6+
cd "$(dirname "${0}")/.."
7+
8+
printf 'generating plugin/vim/quick-lint-js.vim/doc/tags ...\n' >&2
9+
vim \
10+
-c 'set verbosefile=/dev/stderr' \
11+
-c 'try | helptags plugin/vim/quick-lint-js.vim/doc | catch | echomsg v:exception | cquit | endtry | qall!'
12+
13+
# quick-lint-js finds bugs in JavaScript programs.
14+
# Copyright (C) 2020 Matthew Glazar
15+
#
16+
# This file is part of quick-lint-js.
17+
#
18+
# quick-lint-js is free software: you can redistribute it and/or modify
19+
# it under the terms of the GNU General Public License as published by
20+
# the Free Software Foundation, either version 3 of the License, or
21+
# (at your option) any later version.
22+
#
23+
# quick-lint-js is distributed in the hope that it will be useful,
24+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
25+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26+
# GNU General Public License for more details.
27+
#
28+
# You should have received a copy of the GNU General Public License
29+
# along with quick-lint-js. If not, see <https://www.gnu.org/licenses/>.

website/public/install/index.ejs.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,11 @@ <h2>
10081008
<blockquote>
10091009
<pre><code><kbd>quick-lint-js --help</kbd></code></pre>
10101010
</blockquote>
1011+
1012+
<p>
1013+
Configure the Vim plugin by opening Vim and running
1014+
<kbd>:help quick-lint-js</kbd>.
1015+
</p>
10111016
</article>
10121017

10131018
<article id="debian">
@@ -1044,6 +1049,11 @@ <h2>
10441049
<pre><code><kbd>quick-lint-js --version</kbd>
10451050
quick-lint-js version 0.2.0</code></pre>
10461051
</blockquote>
1052+
1053+
<p>
1054+
Configure the Vim plugin by opening Vim and running
1055+
<kbd>:help quick-lint-js</kbd>.
1056+
</p>
10471057
</article>
10481058

10491059
<article id="nix">
@@ -1132,6 +1142,11 @@ <h2>
11321142
<kbd>cd aur-quick-lint-js</kbd>
11331143
<kbd>makepkg -si</kbd></code></pre>
11341144
</blockquote>
1145+
1146+
<p>
1147+
Configure the Vim plugin by opening Vim and running
1148+
<kbd>:help quick-lint-js</kbd>.
1149+
</p>
11351150
</article>
11361151

11371152
<article id="vscode-marketplace">
@@ -1580,6 +1595,16 @@ <h4 id="manual-vim-vundle">Install with Vundle</h4>
15801595
<li>Restart Vim.</li>
15811596
<li>In Vim, run <code class="vim">:PluginInstall</code>.</li>
15821597
</ol>
1598+
1599+
<h3>Configuring</h3>
1600+
<p>
1601+
Configure the Vim plugin by opening Vim and running
1602+
<kbd>:help quick-lint-js</kbd>, or
1603+
<a
1604+
href="https://github.com/quick-lint/quick-lint-js/blob/master/plugin/vim/quick-lint-js.vim/doc/quick-lint-js.txt"
1605+
>read the Vim plugin docs online</a
1606+
>.
1607+
</p>
15831608
</article>
15841609
</main>
15851610

0 commit comments

Comments
 (0)