From 0b0331a297cfdc35bad86b58897fcc2d32d522b7 Mon Sep 17 00:00:00 2001 From: Axel Forsman Date: Sun, 22 Mar 2020 15:50:17 +0100 Subject: [PATCH] Add documentation --- README.md | 2 +- doc/strip_trailing_whitespace.vim | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 doc/strip_trailing_whitespace.vim diff --git a/README.md b/README.md index 6215d10..b126662 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,4 @@ Vim plugin that removes trailing whitespace Achieved by maintaining a set of all edited lines with trailing whitespace, backed by a Splay tree where children store line number offsets. -*Vim support: requires Vim 8.2+* +*Vim support: requires Vim 8.2+ or Neovim 0.5+* diff --git a/doc/strip_trailing_whitespace.vim b/doc/strip_trailing_whitespace.vim new file mode 100644 index 0000000..301289a --- /dev/null +++ b/doc/strip_trailing_whitespace.vim @@ -0,0 +1,30 @@ +*strip_trailing_whitespace.txt* For Vim version 8.2 + +Removes trailing whitespace from modified lines on save. + +Some filetypes have significant trailing whitespace. An autocommand is +defined in the "strip_trailing_whitespace_filetype" group that sets +|b:strip_trailing_whitespace_enabled| to "0" for Markdown and diff files, and +"1" for other filetypes. To disable: > + autocmd! strip_trailing_whitespace_filetype + +============================================================================== + + *:StripTrailingWhitespace* +:[range]StripTrailingWhitespace + Remove trailing whitespace from [range] lines (default all + lines). + + *b:strip_trailing_whitespace_enabled* +b:strip_trailing_whitespace_enabled + Per-buffer boolean toggle. + + *g:strip_trailing_whitespace_max_lines* +g:strip_trailing_whitespace_max_lines + Maximum number of modified lines with trailing whitespace to + keep track of before falling back to stripping the entire + file. + The default ensures the recursion depth limit won't be hit. + + + vim:tw=78:ts=8:noet:ft=help:norl: