]> git.phdru.name Git - dotfiles.git/commitdiff
.vim: `SqueezeEmptyLines()`
authorOleg Broytman <phd@phdru.name>
Sat, 12 Nov 2022 15:08:25 +0000 (18:08 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 16 Nov 2022 16:19:36 +0000 (19:19 +0300)
Replace multiple consecutive empty lines with just one.

.vim/autoload/text.vim [new file with mode: 0644]

diff --git a/.vim/autoload/text.vim b/.vim/autoload/text.vim
new file mode 100644 (file)
index 0000000..8fe0e71
--- /dev/null
@@ -0,0 +1,4 @@
+function! text#SqueezeEmptyLines()
+    " Replace multiple consecutive empty lines with just one
+    %s/\n\{3,\}/\r\r/
+endfunction