diff options
author | David Morgan <djm_uk@protonmail.com> | 2024-11-07 15:54:44 +0000 |
---|---|---|
committer | David Morgan <djm_uk@protonmail.com> | 2024-11-07 15:54:44 +0000 |
commit | 21dc0959d9d96001361e7dd4b5df138ddc864394 (patch) | |
tree | 41a8db84077f61be2967314c0d124348ec1c523f /.emacs.d/lisp/init-search.el | |
parent | 4932badf73b382182e36cbfa59d3a0e5349ee773 (diff) | |
download | dotfiles-21dc0959d9d96001361e7dd4b5df138ddc864394.tar.gz |
Improve affe symbol-at-point commands
Diffstat (limited to '.emacs.d/lisp/init-search.el')
-rw-r--r-- | .emacs.d/lisp/init-search.el | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/.emacs.d/lisp/init-search.el b/.emacs.d/lisp/init-search.el index d84eade..3125e74 100644 --- a/.emacs.d/lisp/init-search.el +++ b/.emacs.d/lisp/init-search.el @@ -114,27 +114,22 @@ (setq input (cdr (orderless-compile input))) (cons input (apply-partially #'orderless--highlight input t))) (setq affe-regexp-compiler #'affe-orderless-regexp-compiler) - (defun my/affe-grep-symbol-at-point (&optional dir initial) - (interactive - (list prefix-arg (when-let ((s (symbol-at-point))) - (symbol-name s)))) - (affe-grep dir initial)) - (defun my/affe-find-symbol-at-point (&optional dir initial) - (interactive - (list prefix-arg (when-let ((s (symbol-at-point))) - (symbol-name s)))) - (affe-find dir initial)) - (consult-customize affe-grep my/affe-grep-symbol-at-point :preview-key "M-.") + (defalias 'affe-grep-symbol-at-point 'affe-grep) + (defalias 'affe-find-symbol-at-point 'affe-find) + (consult-customize + affe-grep :preview-key "M-." + affe-grep-symbol-at-point :initial (thing-at-point 'symbol) :preview-key "M-." + affe-find-symbol-at-point :initial (thing-at-point 'symbol) :preview-key "M-.") :bind ("C-c C-#" . affe-grep) ("C-c z" . affe-find) - ("C-c Z" . my/affe-find-symbol-at-point) - ("C-~" . my/affe-grep-symbol-at-point) + ("C-c Z" . affe-find-symbol-at-point) + ("C-c C-~" . affe-grep-symbol-at-point) (:map search-map ("#" . affe-grep) - ("~" . my/affe-grep-symbol-at-point) + ("~" . affe-grep-symbol-at-point) ("a" . affe-find) - ("A" . my/affe-find-symbol-at-point))) + ("A" . affe-find-symbol-at-point))) (provide 'init-search) ;;; init-search.el ends here |