From 619f0127d60664c8db2d4d89fe14a2c093875464 Mon Sep 17 00:00:00 2001 From: David Morgan Date: Wed, 27 Jul 2022 14:08:14 +0100 Subject: consult-project-extra-find default narrowing --- .emacs.d/lisp/init-minibuffer.el | 3 ++- .emacs.d/lisp/init-project.el | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to '.emacs.d/lisp') diff --git a/.emacs.d/lisp/init-minibuffer.el b/.emacs.d/lisp/init-minibuffer.el index 5245ba9..cde4304 100644 --- a/.emacs.d/lisp/init-minibuffer.el +++ b/.emacs.d/lisp/init-minibuffer.el @@ -323,7 +323,8 @@ DEFS is a plist associating completion categories to commands." (defvar consult-initial-narrow-config '((consult-buffer . ?x) (consult-buffer-no-preview . ?x) - (consult-buffer-other-window . ?x))) + (consult-buffer-other-window . ?x) + (consult-project-extra-find . ?f))) ;; Add initial narrowing hook (defun consult-initial-narrow () (when-let (key (alist-get this-command consult-initial-narrow-config)) diff --git a/.emacs.d/lisp/init-project.el b/.emacs.d/lisp/init-project.el index 123b98c..8fe7c3f 100644 --- a/.emacs.d/lisp/init-project.el +++ b/.emacs.d/lisp/init-project.el @@ -43,10 +43,15 @@ (interactive) (let ((default-directory "~/src/")) (call-interactively #'project-switch-project))) + (defun project-switch-consult-project-extra-find () + (interactive) + (progn + (setq unread-command-events (listify-key-sequence "f ")) + (consult-project-extra-find))) (add-to-list 'project-switch-commands '(?h "Recentf" project-recentf) t) (add-to-list 'project-switch-commands '(?r "consult-ripgrep" consult-ripgrep) t) - (add-to-list 'project-switch-commands '(?p "consult-project-extra-find" consult-project-extra-find) t) + (add-to-list 'project-switch-commands '(?p "consult-project-extra-find" project-switch-consult-project-extra-find) t) (add-to-list 'project-switch-commands '(?m "Magit" magit-status) t) (add-to-list 'project-switch-commands '(?q "Replace Regexp" project-query-replace-regexp) t) -- cgit 1.4.1-2-gfad0