From 3087e4313adcb141de19c164c49f66d82f551efe Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Fri, 18 Mar 2022 23:47:59 +0800 Subject: Replace ivy/counsel with vertico/consult (emacs) --- .emacs.d/lisp/init-minibuffer.el | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .emacs.d/lisp/init-minibuffer.el (limited to '.emacs.d/lisp/init-minibuffer.el') diff --git a/.emacs.d/lisp/init-minibuffer.el b/.emacs.d/lisp/init-minibuffer.el new file mode 100644 index 0000000..5ed684b --- /dev/null +++ b/.emacs.d/lisp/init-minibuffer.el @@ -0,0 +1,29 @@ +(gx/maybe-require-package 'consult) + +(when (gx/maybe-require-package 'vertico) + (add-hook 'after-init-hook #'vertico-mode)) + +(setq vertico-resize t + vertico-count 20 + vertico-cycle t) + +(defun gx/setup-completion-in-minibuffer () + (setq-local completion-styles '(substring orderless) + completion-category-defaults nil + completion-category-overrides '((file (styles partial-completion))))) + +(when (gx/maybe-require-package 'orderless) + (add-hook 'minibuffer-setup-hook #'gx/setup-completion-in-minibuffer)) + +(with-eval-after-load 'evil + (when (gx/maybe-require-package 'consult) + (evil-define-key 'normal 'global + (kbd "fb") 'consult-buffer + (kbd "fm") 'consult-recent-file + (kbd "fc") 'execute-extended-command + (kbd "fl") 'consult-line))) + +(when (gx/maybe-require-package 'savehist) + (add-hook 'after-init-hook #'savehist-mode)) + +(provide 'init-minibuffer) -- cgit v1.2.3