aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2022-03-19 00:23:47 +0800
committerGuangxiong Lin <[email protected]>2022-03-19 00:23:47 +0800
commitb75529727569fb3d7d982664ae69ec243ab06dca (patch)
tree0760efc58bd5f8b2a9079665deff2ea97f1163d8
parente65a5bb29bf73ab659d6d8d23bb7ba105dea3600 (diff)
downloaddotfiles-b75529727569fb3d7d982664ae69ec243ab06dca.tar.gz
dotfiles-b75529727569fb3d7d982664ae69ec243ab06dca.tar.bz2
dotfiles-b75529727569fb3d7d982664ae69ec243ab06dca.zip
Improve consult-mode (emacs)
-rw-r--r--.emacs.d/lisp/init-minibuffer.el20
1 files changed, 12 insertions, 8 deletions
diff --git a/.emacs.d/lisp/init-minibuffer.el b/.emacs.d/lisp/init-minibuffer.el
index 5ed684b..a0a5c98 100644
--- a/.emacs.d/lisp/init-minibuffer.el
+++ b/.emacs.d/lisp/init-minibuffer.el
@@ -7,21 +7,25 @@
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)
+ (defun gx/setup-completion-in-minibuffer ()
+ (setq-local completion-styles '(substring orderless)
+ completion-category-defaults nil
+ completion-category-overrides '((file (styles partial-completion)))))
(add-hook 'minibuffer-setup-hook #'gx/setup-completion-in-minibuffer))
-(with-eval-after-load 'evil
- (when (gx/maybe-require-package 'consult)
+(when (gx/maybe-require-package 'consult)
+ (with-eval-after-load 'evil
(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)))
+ (kbd "<leader>fl") 'consult-line
+ (kbd "<leader>fs") 'consult-imenu)
+ (evil-define-key 'normal 'eglot--managed-mode
+ (kbd "<leader>fS") 'consult-eglot-symbols)))
+
+(setq consult-preview-key (kbd "C-c C-p"))
(when (gx/maybe-require-package 'savehist)
(add-hook 'after-init-hook #'savehist-mode))