A Vim plugin to add and remove whitespace from files for opinionated tidiness and (hopefully) enhanced readability.
- Removes whitespace at the end of lines.
- Removes sequential whitespace between words.
- Ignores whitespace at the beginning of a line (to preserve indents).
- Adds spaces after commas in non-numeric strings.
- Changes
foo(bar,baz,boo)
tofoo(bar, baz, boo)
. - Ignores large numbers (e.g.
1,234,456,789
), but notfoo(0,1)
.
- Changes
- Operates on the entire buffer by default, or a range if provided.
- Aggressive mode for when you know better than the safeguards.
g:WhiteWash.auto
- Enabled rules are run whenever:WhiteWash
is called.
" Set to 0 to disable a rule
let g:WhiteWash.auto.commas = 0
let g:WhiteWash.auto.sequential = 0
let g:WhiteWash.auto.trailing = 0
g:WhiteWash.aggressive
- Define which rules should run with aggressive mode by default.
let g:WhiteWash.aggressive.commas = 1
let g:WhiteWash.aggressive.sequential = 1
:WhiteWash
- Run all enabled WhiteWash rules.:WhiteWashAggressive
- Run all enabled WhiteWash rules in aggressive mode.:WhiteWashCommas
- Run only the commas rule (respects aggressive setting).:WhiteWashSequential
- Run only the sequential rule (respects aggressive setting).:WhiteWashTrailing
- Remove trailing whitespace.