aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d/lisp/init-minibuffer.el
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/lisp/init-minibuffer.el')
-rw-r--r--.emacs.d/lisp/init-minibuffer.el29
1 files changed, 29 insertions, 0 deletions
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 "<leader>fb") 'consult-buffer
+ (kbd "<leader>fm") 'consult-recent-file
+ (kbd "<leader>fc") 'execute-extended-command
+ (kbd "<leader>fl") 'consult-line)))
+
+(when (gx/maybe-require-package 'savehist)
+ (add-hook 'after-init-hook #'savehist-mode))
+
+(provide 'init-minibuffer)