Vim-scavenger

Multiple blank lines and trailing white spaces cleaner for Vim.

Download as .zip Download as .tar.gz View on GitHub

vim-janitor

Multiple blank lines and trailing white spaces cleaner for Vim.

Vim-janitor supports both Vim and Neovim.

        _                 _             _ __
 _   __(_)___ ___        (_)___ _____  (_) /_____  _____
| | / / / __ `__ \______/ / __ `/ __ \/ / __/ __ \/ ___/
| |/ / / / / / / /_____/ / /_/ / / / / / /_/ /_/ / /
|___/_/_/ /_/ /_/   __/ /\__,_/_/ /_/_/\__/\____/_/
                   /___/

Generated by patorjk.com.

Requirement

Vim

Need Python 2.x support for Vim. Check with the following command: vim --version | grep "+python".

Neovim

Install neovim/python-client. Currently, Just install the client of Python 2.x.

Functions

:CleanUp

Delete all multiple blank lines and trailing spaces.

:CleanUpMultipleBlankLines

Delete all multiple blank lines.

:CleanUpMultipleBlankLinesOnlyAdded

Delete all multiple blank lines on added lines.

:CleanUpTrailingSpaces

Delete all trailing spaces.

:CleanUpTrailingSpacesOnlyAdded

Delete the trailing spaces on added lines.

:JanitorHighlightAll

Highlight all blank lines and trailing spaces with red color.

:JanitorClearHighlight

Clear all highlight on all blank lines and trailing spaces.

:JanitorToggleHighlight

Toggle highlight.

Settings

g:janitor_enable_highlight

Enable to highlight when open files or not .

g:janitor_auto_clean_up_on_write

Enable to clear multiple blank lines and trailing spaces when save files or not.

g:janitor_auto_clean_up_only_added

Enable to clear only on the current changes. Work with g:janitor_auto_clean_up_on_write setting.

g:janitor_exclude_on_trailing_space

An exclusive list of filetypes used to not clean up trailing spaces when call CleanUp.

g:janitor_exclude_on_blank_lines

An exclusive list of filetypes used to not clean up blank lines when call CleanUp. It is useful on Python for PEP8-compliant.

For example:

# do not clean up multiple blank lines for PEP8-compliant
let g:janitor_exclude_on_blank_linse = ['python']

Warning