From 93e94da455fe53ad2d2d77fa95e853d866b7fb55 Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Sat, 11 Dec 2021 14:39:23 -0500 Subject: Added a single-lines-only function to emacs --- .emacs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.emacs b/.emacs index 882b3e9..40ed9e7 100644 --- a/.emacs +++ b/.emacs @@ -66,6 +66,14 @@ ;; (add-to-list 'latex-help-cmd-alist (cons key value)))))) ;; latex-help-cmd-alist)) +(defun single-lines-only () + "Replace multiple blank lines with a single one" + (interactive) + (goto-char (point-min)) + (while (re-search-forward "\\(^\\s-*$\\)\n" nil t) + (replace-match "\n") + (forward-char 1))) + (use-package ace-window :ensure t :custom -- cgit v1.2.3