summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-editing.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/init-editing.el b/lisp/init-editing.el
index 1842ebb..2f4840d 100644
--- a/lisp/init-editing.el
+++ b/lisp/init-editing.el
@@ -63,6 +63,15 @@ special case.
(setq end (point))))
(fill-region (or beg (point-min)) (or end (point-max))))))
+(defun km/reduce-to-single-spaces ()
+ "Reduce consecutive blank lines to a single line."
+ (interactive)
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward "\\([ \t]*\n\\)\\{3,\\}" nil t)
+ (forward-line -1)
+ (delete-blank-lines))))
+
(define-key search-map "s" 'query-replace)
(define-key search-map "S" 'replace-string)
(define-key search-map "r" 'query-replace-regexp)