aboutsummaryrefslogtreecommitdiff
path: root/.emacs
diff options
context:
space:
mode:
authorRyan Kavanagh <rak@rak.ac>2021-12-11 14:39:23 -0500
committerRyan Kavanagh <rak@rak.ac>2021-12-11 14:39:23 -0500
commit93e94da455fe53ad2d2d77fa95e853d866b7fb55 (patch)
tree8ef3cd26dc8d23e1c116149b473929e3cd4c7fd9 /.emacs
parentpackages (diff)
Added a single-lines-only function to emacs
Diffstat (limited to '.emacs')
-rw-r--r--.emacs8
1 files changed, 8 insertions, 0 deletions
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