diff options
author | David Morgan <djm_uk@protonmail.com> | 2024-10-23 13:32:15 +0100 |
---|---|---|
committer | David Morgan <djm_uk@protonmail.com> | 2024-10-23 13:32:15 +0100 |
commit | 20049693de39f980856e5e703d14968833be7784 (patch) | |
tree | 7e0bddf99e06ae16b68f7592fed3bc39c6e9d059 /.emacs.d | |
parent | 3633b326676886b157857889595537a0eaaec854 (diff) | |
download | dotfiles-20049693de39f980856e5e703d14968833be7784.tar.gz |
Use modfied casual-isearch instead of custom menu
Diffstat (limited to '.emacs.d')
-rw-r--r-- | .emacs.d/lisp/init-search.el | 107 |
1 files changed, 17 insertions, 90 deletions
diff --git a/.emacs.d/lisp/init-search.el b/.emacs.d/lisp/init-search.el index 9582a17..62de062 100644 --- a/.emacs.d/lisp/init-search.el +++ b/.emacs.d/lisp/init-search.el @@ -15,95 +15,6 @@ (goto-char (point-min))) (advice-add 'isearch-occur :after 'isearch-occur-advice) - ;; Modified from http://yummymelon.com/devnull/improving-emacs-isearch-usability-with-transient.html - (transient-define-prefix isearch-menu () - "isearch Menu" - [["Edit Search String" - ("e" - "Edit the search string (recursive)" - isearch-edit-string - :transient nil) - ("w" - "Pull next word or character word from buffer" - isearch-yank-word-or-char - :transient nil) - ("s" - "Pull next symbol or character from buffer" - isearch-yank-symbol-or-char - :transient nil) - ("l" - "Pull rest of line from buffer" - isearch-yank-line - :transient nil) - ("y" - "Pull string from kill ring" - isearch-yank-kill - :transient nil) - ("t" - "Pull thing from buffer" - isearch-forward-thing-at-point - :transient nil)] - - ["Replace" - ("q" - "Start ‘query-replace’" - anzu-isearch-query-replace - :if-nil buffer-read-only - :transient nil) - ("x" - "Start ‘query-replace-regexp’" - anzu-isearch-query-replace-regexp - :if-nil buffer-read-only - :transient nil)]] - - [["Toggle" - ("X" - "Toggle regexp searching" - isearch-toggle-regexp - :transient nil) - ("S" - "Toggle symbol searching" - isearch-toggle-symbol - :transient nil) - ("W" - "Toggle word searching" - isearch-toggle-word - :transient nil) - ("F" - "Toggle case fold" - isearch-toggle-case-fold - :transient nil) - ("L" - "Toggle lax whitespace" - isearch-toggle-lax-whitespace - :transient nil)] - - ["Misc" - ("o" - "occur" - isearch-occur - :transient nil) - ("h" - "highlight" - isearch-highlight-regexp - :transient nil) - ("H" - "highlight lines" - isearch-highlight-lines-matching-regexp - :transient nil) - ("l" - "consult-line" - consult-line - :transient nil) - ("<" - "isearch-beginning-of-buffer" - isearch-beginning-of-buffer - :transient nil) - (">" - "isearch-end-of-buffer" - isearch-end-of-buffer - :transient nil)]]) - :custom (search-whitespace-regexp ".*\\b") (isearch-lax-whitespace t) @@ -117,11 +28,27 @@ :bind-keymap ("C-c s" . search-map) ;; M-s clashes with paredit/smartparens bindings :bind ("C-*" . isearch-forward-symbol-at-point) - (:map isearch-mode-map ("<f2>" . isearch-menu)) (:map search-map ("<" . isearch-beginning-of-buffer) (">" . isearch-end-of-buffer))) +(use-feature casual-isearch + :after isearch + :bind (:map isearch-mode-map ("C-o" . casual-isearch-tmenu)) + :config + ;; Replace isearch-query-replace functions with their aznu equivalents + (transient-replace-suffix 'casual-isearch-tmenu "r" '("r" "Start ‘anzu-query-replace’" anzu-isearch-query-replace + :if-nil buffer-read-only)) + (transient-replace-suffix 'casual-isearch-tmenu "x" '("x" "Start ‘anzu-query-replace-regexp’" anzu-isearch-query-replace-regexp + :if-nil buffer-read-only)) + ;; Add isearch-beginning-of-buffer and isearch-end-of-buffer to Navigation section + (transient-append-suffix 'casual-isearch-tmenu "n" '("<" "First" isearch-beginning-of-buffer + :transient t)) + (transient-append-suffix 'casual-isearch-tmenu "<" '(">" "Last" isearch-end-of-buffer + :transient t)) + ;; Add consult-line to Misc section + (transient-append-suffix 'casual-isearch-tmenu "u" '("l" "consult-line" consult-line))) + (use-package isearch-dabbrev :after isearch :bind (:map isearch-mode-map ("M-/" . isearch-dabbrev-expand))) |