diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-06-27 22:15:39 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-06-27 22:15:39 +1200 |
commit | 300bea303578b9cb9ff96b7ca4126355324e7427 (patch) | |
tree | 4b886da9cf15b65bbcc5c528ad8aed8a67cf3786 | |
parent | Refactor majorly for 0.2.0 (diff) | |
parent | Bump VERSION (diff) | |
download | vim-strip-trailing-whitespace-300bea303578b9cb9ff96b7ca4126355324e7427.tar.gz vim-strip-trailing-whitespace-300bea303578b9cb9ff96b7ca4126355324e7427.zip |
Merge branch 'release/v0.3.0'v0.3.0
* release/v0.3.0:
Bump VERSION
Remove leading colon for mapping example
Adjust documentation on reporting
Remove user command
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | doc/strip_trailing_whitespace.txt | 16 | ||||
-rw-r--r-- | plugin/strip_trailing_whitespace.vim | 11 |
4 files changed, 11 insertions, 23 deletions
@@ -11,13 +11,14 @@ This is a very commonly written and implemented plugin, but I wrote my own because I could not find a plugin that did this in exactly the way I wanted: - Provide a `<Plug>` mapping -- Provide a user command to do the stripping as well if wanted -- Strip trailing lines as well as trailing spaces, reporting both +- Strip trailing lines as well as trailing spaces +- Accurately report what was changed - Work with even very old Vim (>=6.0) - Work with a single `undo` - Don't move the cursor - Don't change the search pattern - Don't define an `autocmd` +- Don't define a user command - Don't force a key mapping - Don't define a global function @@ -1 +1 @@ -0.2.0 +0.3.0 diff --git a/doc/strip_trailing_whitespace.txt b/doc/strip_trailing_whitespace.txt index 96635ab..f19ae32 100644 --- a/doc/strip_trailing_whitespace.txt +++ b/doc/strip_trailing_whitespace.txt @@ -1,4 +1,4 @@ -*strip_trailing_whitespace.txt* For Vim version 6.0 Last change: 2018 June 10 +*strip_trailing_whitespace.txt* For Vim version 6.0 Last change: 2018 June 27 DESCRIPTION *strip_trailing_whitespace* @@ -12,13 +12,14 @@ This is a very commonly written and implemented plugin, but I wrote my own because I could not find a plugin that did this in exactly the way I wanted: - Provide a |<Plug>| mapping -- Provide a user command to do the stripping as well if wanted -- Strip trailing lines as well as trailing spaces, reporting both +- Strip trailing lines as well as trailing spaces +- Accurately report what was changed - Work with even very old Vim (>=6.0) - Work with a single |undo| - Don't move the cursor - Don't change the search pattern - Don't define an |autocmd| +- Don't define a user command - Don't force a key mapping - Don't define a global function @@ -26,13 +27,6 @@ REQUIREMENTS *strip_trailing_whitespace-requirements* This plugin is only available if 'compatible' is not set. -COMMANDS *strip_trailing_whitespace-commands* - - *:StripTrailingWhitespace* -The plugin provides a single `:StripTrailingWhitespace` command if Vim has the -|+user_commands| feature, but this is not required. It operates on the entire -buffer, and accepts neither a range nor arguments. - MAPPINGS *strip_trailing_whitespace-mappings* *<Plug>StripTrailingWhitespace* @@ -40,7 +34,7 @@ The single mapping target provided is |<Plug>StripTrailingWhitespace|, mappable in any mode. There is no default key mapping to the target; you should define this yourself in your |vimrc|. For example: > - :nmap <Leader>x <Plug>StripTrailingWhitespace + nmap <Leader>x <Plug>StripTrailingWhitespace < AUTHOR *strip_trailing_whitespace-author* diff --git a/plugin/strip_trailing_whitespace.vim b/plugin/strip_trailing_whitespace.vim index 7055d26..9edcaf4 100644 --- a/plugin/strip_trailing_whitespace.vim +++ b/plugin/strip_trailing_whitespace.vim @@ -1,6 +1,6 @@ " -" strip_trailing_whitespace.vim: User-defined key mapping and optional command -" to strip trailing whitespace in the whole document. +" strip_trailing_whitespace.vim: User-defined key mapping to strip trailing +" whitespace in the whole document. " " Author: Tom Ryder <tom@sanctum.geek.nz> " License: Same as Vim itself @@ -90,10 +90,3 @@ 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 |