commit e10ca02d0d60f4c00a68e1eda53a517714896db3 Author: Scott Bronson Date: Wed Aug 11 12:28:48 2010 -0700 initial checkin diff --git a/README b/README new file mode 100644 index 0000000..e13a41d --- /dev/null +++ b/README @@ -0,0 +1,9 @@ +This plugin causes all trailing whitespace to be highlighted in red. + +To fix the whitespace errors, just call :FixWhitespace. By default it +operates on the entire file. Pass a range (or use V to select some lines) +to restrict the portion of the file that gets fixed. + +Based on http://vim.wikia.com/wiki/Highlight_unwanted_spaces , and +Thanks to http://github.com/graywh/dotfiles/blob/master/.vimrc#L452 +for improving the fix command. diff --git a/doc/trailing-whitespace.txt b/doc/trailing-whitespace.txt new file mode 100644 index 0000000..deb3cb9 --- /dev/null +++ b/doc/trailing-whitespace.txt @@ -0,0 +1,16 @@ +*trailing-whitespace.txt* trailing-whitespace + + +This plugin causes all trailing whitespace to be highlighted in red. + + + *FixWhitespace* + +To fix the whitespace errors, just call :FixWhitespace. By default it +operates on the entire file. Pass a range (or use V to select some lines) +to restrict the portion of the file that gets fixed. + +Based on http://vim.wikia.com/wiki/Highlight_unwanted_spaces , and +Thanks to http://github.com/graywh/dotfiles/blob/master/.vimrc#L452 +for improving the fix command. + diff --git a/plugin/trailing-whitespace.vim b/plugin/trailing-whitespace.vim new file mode 100644 index 0000000..9aa14ee --- /dev/null +++ b/plugin/trailing-whitespace.vim @@ -0,0 +1,11 @@ +" Highlight EOL whitespace, http://vim.wikia.com/wiki/Highlight_unwanted_spaces +highlight ExtraWhitespace ctermbg=darkred guibg=#382424 +autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red +autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ +" the above flashes annoyingly while typing, be calmer in insert mode +autocmd InsertLeave * match ExtraWhitespace /\s\+$/ +autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@,substitute/\s\+$// +