diff options
Diffstat (limited to 'vim/plugin/strip_trailing_whitespace.vim')
-rw-r--r-- | vim/plugin/strip_trailing_whitespace.vim | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/vim/plugin/strip_trailing_whitespace.vim b/vim/plugin/strip_trailing_whitespace.vim index 9fb2e65b..1264a11f 100644 --- a/vim/plugin/strip_trailing_whitespace.vim +++ b/vim/plugin/strip_trailing_whitespace.vim @@ -1,6 +1,6 @@ " -" strip_trailing_whitespace.vim: User-defined key mapping to strip trailing -" whitespace in the whole document. +" strip_trailing_whitespace.vim: User-defined key mapping and optional command +" to strip trailing whitespace in the whole document. " " Author: Tom Ryder <tom@sanctum.geek.nz> " License: Same as Vim itself @@ -67,3 +67,10 @@ endfunction noremap <silent> <unique> \ <Plug>StripTrailingWhitespace \ :<C-U>call <SID>StripTrailingWhitespace()<CR> + +" Define a user command too, if we can +if has('user_commands') + command -nargs=0 + \ StripTrailingWhiteSpace + \ call <SID>StripTrailingWhitespace() +endif |