about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2022-10-17 16:38:36 +0100
committerDavid Morgan <djm_uk@protonmail.com>2022-10-17 20:50:00 +0100
commite1f7d9ddcd335b99f4a672579189ba8c1f43c915 (patch)
treeba3e6fb11cc1d5fa7193878bba59d746750489d9
parent3ed968667143520e64ab52604955ee5e49fd1455 (diff)
downloaddotfiles-e1f7d9ddcd335b99f4a672579189ba8c1f43c915.tar.gz
Add symbol-overlay-put-or-clear
-rw-r--r--.emacs.d/lisp/init-navigation.el13
1 files changed, 10 insertions, 3 deletions
diff --git a/.emacs.d/lisp/init-navigation.el b/.emacs.d/lisp/init-navigation.el
index 714a95e..5a8ec98 100644
--- a/.emacs.d/lisp/init-navigation.el
+++ b/.emacs.d/lisp/init-navigation.el
@@ -41,11 +41,18 @@
               ("C-M-'" . smartscan-symbol-replace)))
 
 (use-package symbol-overlay
+  :config
+  (defun symbol-overlay-put-or-clear (arg)
+    "Toggle all overlays of symbol at point.
+Or remove all highlighted symbols in the current buffer (with`ARG')."
+    (interactive "P")
+    (if arg
+        (symbol-overlay-remove-all)
+      (symbol-overlay-put)))
   :bind
-  ("C-c o" . symbol-overlay-put)
+  ("C-c o" . symbol-overlay-put-or-clear)
   ("M-N" . symbol-overlay-switch-forward)
-  ("M-P" . symbol-overlay-switch-backward)
-  ("<f8>" . symbol-overlay-remove-all))
+  ("M-P" . symbol-overlay-switch-backward))
 
 (use-package gumshoe
   :defer 5