about summary refs log tree commit diff stats
path: root/.emacs.d/lisp
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2022-10-12 16:41:45 +0100
committerDavid Morgan <djm_uk@protonmail.com>2022-10-12 16:41:45 +0100
commitc60587f1d5f19e1db913e8fe716e5d908f3d5adc (patch)
tree85c24e34870033298b7e3dbb0e1ac3c592247391 /.emacs.d/lisp
parentbbcb583ebb9feeae87519ad61bdb0b2d32e2712b (diff)
downloaddotfiles-c60587f1d5f19e1db913e8fe716e5d908f3d5adc.tar.gz
Improve smartscan config
Diffstat (limited to '.emacs.d/lisp')
-rw-r--r--.emacs.d/lisp/init-navigation.el26
1 files changed, 15 insertions, 11 deletions
diff --git a/.emacs.d/lisp/init-navigation.el b/.emacs.d/lisp/init-navigation.el
index e41eb9e..2ad08f5 100644
--- a/.emacs.d/lisp/init-navigation.el
+++ b/.emacs.d/lisp/init-navigation.el
@@ -20,18 +20,22 @@
 
 (use-package smartscan
   :config
-  (global-smartscan-mode t)
+  (defvar-local smartscan-exclude-modes '(cider-repl-mode
+                                          ielm-mode
+                                          vterm-mode
+                                          term-mode
+                                          ansi-term-mode
+                                          eshell-mode
+                                          shell-mode
+                                          sql-interactive-mode
+                                          compilation-mode
+                                          deadgrep-mode))
+  (defun turn-off-smartscan-mode ()
+    (smartscan-mode -1))
+  (dolist (mode smartscan-exclude-modes)
+    (add-hook (intern (concat (symbol-name mode) "-hook")) #'turn-off-smartscan-mode))
   :hook
-  (cider-repl-mode . (lambda () (smartscan-mode -1)))
-  (ielm-mode . (lambda () (smartscan-mode -1)))
-  (vterm-mode . (lambda () (smartscan-mode -1)))
-  (term-mode . (lambda () (smartscan-mode -1)))
-  (ansi-term-mode . (lambda () (smartscan-mode -1)))
-  (eshell-mode . (lambda () (smartscan-mode -1)))
-  (shell-mode . (lambda () (smartscan-mode -1)))
-  (sql-interactive-mode . (lambda () (smartscan-mode -1)))
-  (compilation-mode . (lambda () (smartscan-mode -1)))
-  (deadgrep-mode . (lambda () (smartscan-mode -1))))
+  (after-init . global-smartscan-mode))
 
 (use-package symbol-overlay
   :bind