aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-08-30 11:14:22 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-08-30 11:14:22 +1200
commit0d654e3d9d97f346cfe09fa0f7b3a69fe1c14d48 (patch)
tree2e271f03cdd3225a46d3d63d785130dc864e207d /plugin
downloadvim-squeeze-repeat-blanks-0d654e3d9d97f346cfe09fa0f7b3a69fe1c14d48.tar.gz
vim-squeeze-repeat-blanks-0d654e3d9d97f346cfe09fa0f7b3a69fe1c14d48.zip
First versionv0.1.0
Diffstat (limited to 'plugin')
-rw-r--r--plugin/squeeze_repeat_blanks.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/plugin/squeeze_repeat_blanks.vim b/plugin/squeeze_repeat_blanks.vim
new file mode 100644
index 0000000..dcf8b0a
--- /dev/null
+++ b/plugin/squeeze_repeat_blanks.vim
@@ -0,0 +1,19 @@
+"
+" squeeze_repeat_blanks.vim: User command to reduce all groups of blank lines
+" to the last line in that group, deleting the others. Good for filtering
+" plaintext mail that's been extracted from HTML.
+"
+" Author: Tom Ryder <tom@sanctum.geek.nz>
+" License: Same as Vim itself
+"
+if exists('g:loaded_squeeze_repeat_blanks') || &compatible
+ finish
+endif
+if !has('user_commands') || v:version < 700
+ finish
+endif
+let g:loaded_squeeze_repeat_blanks = 1
+
+" User command for the above
+command! -range=% SqueezeRepeatBlanks
+ \ call squeeze_repeat_blanks#Squeeze(<line1>, <line2>)