aboutsummaryrefslogtreecommitdiff
path: root/doc/strip_trailing_whitespace.txt
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-20 20:31:13 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-20 20:31:13 +1200
commit1b76276ea831ee5cb657e0261ff5fe472626118f (patch)
tree4533c08958ea16b188f0dd7c57512a00951445f6 /doc/strip_trailing_whitespace.txt
parentMerge branch 'release/v1.0.0' into develop (diff)
downloadvim-strip-trailing-whitespace-1b76276ea831ee5cb657e0261ff5fe472626118f.tar.gz
vim-strip-trailing-whitespace-1b76276ea831ee5cb657e0261ff5fe472626118f.zip
Overhaul for new version
Refactor completely, mostly for clarity of code rather than speed. Also accept a range and deal with vertical whitespace trimming intelligently based on its value.
Diffstat (limited to 'doc/strip_trailing_whitespace.txt')
-rw-r--r--doc/strip_trailing_whitespace.txt27
1 files changed, 13 insertions, 14 deletions
diff --git a/doc/strip_trailing_whitespace.txt b/doc/strip_trailing_whitespace.txt
index 8ee64f3..c29b664 100644
--- a/doc/strip_trailing_whitespace.txt
+++ b/doc/strip_trailing_whitespace.txt
@@ -1,8 +1,8 @@
-*strip_trailing_whitespace.txt* For Vim version 6.0 Last change: 2018 June 27
+*strip_trailing_whitespace.txt* For Vim version 6.0 Last change: 2018 Jul 20
DESCRIPTION *strip_trailing_whitespace*
-This plugin provides a mapping target with the author's approach to stripping
+This plugin provides a user command with the author's approach to stripping
trailing whitespace from an entire buffer, including removing empty or
whitespace-only lines at the end of the buffer, without making command noise
and without moving the cursor from its current position.
@@ -10,31 +10,30 @@ and without moving the cursor from its current position.
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
+- Accept an optional range
- Strip trailing lines as well as trailing spaces
-- Accurately report what was changed
+- Report what was changed, accurately
- 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
REQUIREMENTS *strip_trailing_whitespace-requirements*
-This plugin is only available if 'compatible' is not set.
+This plugin is only available if 'compatible' is not set. It also requires the
+|+user_commands| feature.
-MAPPINGS *strip_trailing_whitespace-mappings*
+COMMANDS *strip_trailing_whitespace-commands*
+
+ *:StripTrailingWhitespace*
+Strip trailing space appropriately for the range of lines selected, defaulting
+to the entire buffer. Remove all horizontal whitespace from the end of each
+line. If the last line of the range is also the last line of the buffer, strip
+trailing blank or whitespace-only lines as well.
- *<Plug>(StripTrailingWhitespace)*
-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)
-<
AUTHOR *strip_trailing_whitespace-author*
Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.