bronson/vim-trailing-whitespace — pull request #3 by duncannz (2013-10-18 08:59:31+00:00)
Title: Stop the script from double execution with a "loaded" variable

By adding these two lines to the top of the file:

if exists('loaded_trailing_whitespace_plugin') | finish | endif
let loaded_trailing_whitespace_plugin = 1

this will stop the script from executing twice if it is, for some reason, loaded twice.

If you look around Github, you will find that it is convention for scripts to do this.

The variable also lets users disable the plugin under certain circumstances, for example I don't want the plugin to run in emails, so after this is merged I will be able to put in my .vimrc:

autocmd filetype mail let loaded_trailing_whitespace_plugin = 1

and the plugin won't run in email files.