Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Identify and Irradicate unwanted whitespace at the end of the line

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 plugin

Trailer Trash for Vim

Eradicate unwanted whitespace at the end of the line in Vim.

This plugin will highlight trailing whitespace at the end of the line. This is done in a polite way:

  • You are not currently editing that line (prevents highlighting it as you type)
  • You are not in insert mode

    It also introduces a :Trim command that will strip all the trailing white space from a file (or range). This is done in a polite way:

  • Places the cursor back where is started

  • Resets the search highlight back to what it was

TrailerTrash defines a :Trailer command to stop showing unwanted whitespace, for those projects where you don't want to start fighting it.

As always, Trailer Trash is polite.

Ignoring Specific file types

You can ignore specific file types by adding an exclude list to your .vimrc file. If you have any specific types that should always be ignored please send a pull request or open an issue.

let g:trailertrash_blacklist = ['__Calendar', '^http:']

Styling TrailerTrash

You can modify the appearance of TrailerTrash with the hi UnwantedTrailerTrash setting.

For example, you can set the background of all trailing trash to red with the following:

hi UnwantedTrailerTrash guibg=red ctermbg=red

This is not an original idea, I just gathered tips and ideas from around the web and bundled them together in a way I liked.

Something went wrong with that request. Please try again.