From 7ed0559c10d4bac62ef315560eaa592d9699ae32 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 4 Nov 2017 02:20:55 +1300 Subject: Use prefix, make space strip configurable This properly abstracts out the StripTrailingWhitespace mapping rather than forcing it to x within the plugin itself. A bit nicer this way. --- vim/plugin/strip_trailing_whitespace.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'vim/plugin') diff --git a/vim/plugin/strip_trailing_whitespace.vim b/vim/plugin/strip_trailing_whitespace.vim index cc2554bd..6a83eb53 100644 --- a/vim/plugin/strip_trailing_whitespace.vim +++ b/vim/plugin/strip_trailing_whitespace.vim @@ -1,4 +1,5 @@ -" Strip trailing whitespace with \x in the whole document +" User-defined key mapping to strip trailing whitespace in the whole document +" Suggested mapping: \x if has('eval') " Define function for stripping whitespace @@ -51,7 +52,8 @@ if has('eval') endif endfunction - " Map \x to the function just defined - nnoremap x :call StripTrailingWhitespace() - + " Create mapping proxy to the function just defined + " Suggested mapping: x + noremap StripTrailingWhitespace + \ :call StripTrailingWhitespace() endif -- cgit v1.2.3