Skip to content

IrishPrime/WhiteWash.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

A Vim plugin to add and remove whitespace from files for opinionated tidiness and (hopefully) enhanced readability.

Mirror

Features

  • 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) to foo(bar, baz, boo).
    • Ignores large numbers (e.g. 1,234,456,789), but not foo(0,1).
  • Operates on the entire buffer by default, or a range if provided.
  • Aggressive mode for when you know better than the safeguards.

Options

  • 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

Commands

  • :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.

About

Remove excessive white space from files.

Resources

Stars

Watchers

Forks

Packages

No packages published