From fa27182840ca9e2032c6de1dd5731f1b065c34a1 Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Mon, 22 May 2023 11:57:05 +0200 Subject: [PATCH] finally remove ido for recentf as well - replace it with consult-recent-file - tune M-x completion again a little --- init.el | 3 +-- lisp/init-recentfiles.el | 4 +++- lisp/init-smarter-than-emacs.el | 20 +++++++++++++++++--- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/init.el b/init.el index 43a01ab..69cf71b 100644 --- a/init.el +++ b/init.el @@ -153,10 +153,9 @@ (require 'init-workspaces) (require 'init-indentation) (require 'init-recentfiles) +;; (require 'init-completion) ;; replaced with vertico (require 'init-ibuffer) (require 'init-printing) - -(require 'init-completion) (require 'init-smarter-than-emacs) (require 'init-marginalia) (require 'init-ui) diff --git a/lisp/init-recentfiles.el b/lisp/init-recentfiles.el index f44fb01..6f7683b 100644 --- a/lisp/init-recentfiles.el +++ b/lisp/init-recentfiles.el @@ -33,7 +33,9 @@ (when file (find-file file)))) - (global-set-key (kbd "C-x C-r") 'recentf-ido-find-file) ;; open recent files, same as M-x rf + ;; replaced by consult-recent-files + ;; (global-set-key (kbd "C-x C-r") 'recentf-find-file) + ;; open recent files, same as M-x rf ;; now if I incidentally closed a buffer, I can re-open it, thanks to ;; recent-files diff --git a/lisp/init-smarter-than-emacs.el b/lisp/init-smarter-than-emacs.el index 91a4e51..019ff27 100644 --- a/lisp/init-smarter-than-emacs.el +++ b/lisp/init-smarter-than-emacs.el @@ -47,8 +47,7 @@ via [[http://whattheemacsd.com/setup-ido.el-02.html][whattheemacs.d]]" ;; FIXME: set this to complete* ;; ("TAB" . #'vertico-next) ;; next try: use vanilla complete on tab, maybe better? - ("TAB" . #'minibuffer-complete) - )) + ("TAB" . #'minibuffer-complete))) @@ -102,7 +101,8 @@ via [[http://whattheemacsd.com/setup-ido.el-02.html][whattheemacs.d]]" (use-package consult ;; Replace bindings. Lazily loaded due by `use-package'. :bind (;; C-c bindings in `mode-specific-map' - ("C-x b" . consult-buffer)) + ("C-x b" . consult-buffer) + ("C-x C-r" . consult-recent-file)) ;; replaces recentf ;; Enable automatic preview at point in the *Completions* buffer. This is ;; relevant when you use the default completion UI. @@ -130,6 +130,20 @@ via [[http://whattheemacsd.com/setup-ido.el-02.html][whattheemacs.d]]" (push consult--source-perspective consult-buffer-sources))) +;; change directory while opening a file etc +(use-package consult-dir + :ensure t + :bind (("C-x C-d" . consult-dir) + :map vertico-map + ("C-x C-d" . consult-dir) + ("C-x C-j" . consult-dir-jump-file) + + :map minibuffer-local-completion-map + ("C-x C-d" . consult-dir) + )) + + + (use-package embark-consult :after (embark consult))