/vim-compiler-checkbashisms

checkbashisms integration for Vim: check shell (sh) scripts for common BASH-specific incompatibilities.

Primary LanguageVim Script

checkbashisms.vim is a Vim compiler script that checks a shell (sh) script for common BASH-specific incompatibilities.

Before using this script, you must have the checkbashisms binary installed. checkbashisms is part of the devscripts package, originally written for Debian but is available for many other distros.

To install, place the checkbashisms.vim file in the ~/.vim/compiler directory.

To automatically set the compiler for sh scripts, put the command in your ~/.vimrc:

if executable("checkbashisms")
    autocmd FileType sh compiler checkbashisms
endif

You can use the :Checkbashisms command to inspect your shell script. By default, a quickfix cwindow will be opened. To disable, put in your ~/.vimrc:

let g:checkbashisms_cwindow = 0

To automatically check on write, you can specify

let g:checkbashisms_onwrite = 1

Check-on-write is disabled by default.

This software is inspired by the Pylint plugin for Vim, and incorporates ideas from the syntastic plugin.