1
0
Fork 0
mirror of synced 2024-12-25 00:03:20 -05:00

Adding as not submodule.

This commit is contained in:
Maksim Pecherskiy 2014-04-30 12:53:36 -07:00
parent e16cdac24b
commit 40480dde68
4 changed files with 46 additions and 0 deletions

View file

@ -0,0 +1 @@
doc/tags

View file

@ -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.
The repo is at http://github.com/bronson/vim-trailing-whitespace
Originally based on http://vim.wikia.com/wiki/Highlight_unwanted_spaces

View file

@ -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.
The repo is at http://github.com/bronson/vim-trailing-whitespace
Originally based on http://vim.wikia.com/wiki/Highlight_unwanted_spaces

View file

@ -0,0 +1,20 @@
if exists('loaded_trailing_whitespace_plugin') | finish | endif
let loaded_trailing_whitespace_plugin = 1
" 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\+\%#\@<!$/
function! s:FixWhitespace(line1,line2)
let l:save_cursor = getpos(".")
silent! execute ':' . a:line1 . ',' . a:line2 . 's/\s\+$//'
call setpos('.', l:save_cursor)
endfunction
" Run :FixWhitespace to remove end of line white space
command! -range=% FixWhitespace call <SID>FixWhitespace(<line1>,<line2>)