Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itspriddle/vim-shellcheck
Vim wrapper for ShellCheck, a static analysis tool for shell scripts.
https://github.com/itspriddle/vim-shellcheck
bash shellcheck vim vim-plugin
Last synced: 11 days ago
JSON representation
Vim wrapper for ShellCheck, a static analysis tool for shell scripts.
- Host: GitHub
- URL: https://github.com/itspriddle/vim-shellcheck
- Owner: itspriddle
- License: mit
- Created: 2018-09-28T03:22:10.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-12T22:22:56.000Z (3 months ago)
- Last Synced: 2024-09-13T11:39:05.654Z (3 months ago)
- Topics: bash, shellcheck, vim, vim-plugin
- Language: Vim Script
- Homepage: https://www.vim.org/scripts/script.php?script_id=5788
- Size: 31.3 KB
- Stars: 80
- Watchers: 6
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vim-shellcheck
Vim wrapper for [ShellCheck][], a static analysis tool for shell scripts.
[ShellCheck]: https://github.com/koalaman/shellcheck
## Commands
These commands are available in buffers with `'filetype'` of `sh`.
```
:[range]ShellCheck[!] [args]
```Run `shellcheck` for the current buffer using optional `[args]` and send any
errors to the quickfix-window. Specify a `[range]` or use a visual selection
to check only those lines, otherwise the entire buffer is checked. Call with a
bang to automatically open the quickfix-window when errors are found.```
:[range]LShellCheck[!] [args]
```Run `shellcheck` for the current buffer using optional `[args]` and send any
errors to a location-list-window. Specify a `[range]` or use a visual
selection to check only those lines, otherwise the entire buffer is checked.
Call with a bang to automatically open the location-list-window when errors
are found.## QF Mappings
**Open ShellCheck error definition on GitHub - gb**
The `gb` command can be used quickfix or location list windows to open the
ShellCheck error definition on GitHub. This command requires the Netrw plugin
to be installed. If Netrw is not installed, the `gb` map prints the URL to the
ShellCheck error definition on GitHub instead. This functionality is enabled
when the window's `w:quickfix_title` attribute starts with one of the
following:- `:shellcheck` -- created by `compiler shellcheck | :make %` or some other
program
- `:ShellCheck` -- created by the `:ShellCheck` command
- `:LShellCheck` -- created by the `:LShellCheck` commandTo disable this mapping:
```viml
let g:shellcheck_disable_mappings = 1
```To setup a different map:
```viml
let g:shellcheck_disable_mappings = 1
autocmd FileType qf nmap gB (shellcheck-gb)
```Note: The `gb` map will not be defined if one already exists.
## Compiler
A ShellCheck `:compiler` is provided by Vim 8.2.1769 and newer for use as a
`'makeprg'`. To use it, run:```
:compiler shellcheck
:make! %
:copen
```## Configuration
**`g:shellcheck_qf_open`**
Specifies how the quickfix-window is opened when `:ShellCheck!` is used. The
default value is `"botright copen 10"`.**`g:shellcheck_ll_open`**
Specifies how the location-list-window is opened when `:LShellCheck!` is used.
The default value is `"lopen 10"`.## Installation
Use your favorite plugin manager, or use Vim's built-in package support:
```
mkdir -p ~/.vim/pack/shellcheck/start
cd ~/.vim/pack/shellcheck/start
git clone https://github.com/itspriddle/vim-shellcheck.git
vim -u NONE -c "helptags vim-shellcheck/doc" -c q
```## License
MIT License - see [`LICENSE`](./LICENSE) in this repo.