From 71c4634a135f80f8392e1e5f34207288c986923a Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Thu, 23 Jun 2022 19:16:05 +0200 Subject: [PATCH] YOLO --- init.el | 102 ++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 80 insertions(+), 22 deletions(-) diff --git a/init.el b/init.el index c0f2681..2175f70 100644 --- a/init.el +++ b/init.el @@ -144,6 +144,10 @@ ;; follow symlinks to version-controlled files (setq vc-follow-symlinks t) +(setq read-extended-command-predicate + #'command-completion-default-include-p) +(setq enable-recursive-minibuffers t) + ;; backup management (setq backup-directory-alist `(("." . "~/.emacs.d/backups"))) (setq delete-old-versions t @@ -152,13 +156,82 @@ version-control t) ;; completion framework -(straight-use-package 'ivy) -(ivy-mode 1) -(diminish 'ivy-mode) -(straight-use-package 'counsel) -(counsel-mode 1) -(diminish 'counsel-mode) -(global-set-key (kbd "M-s M-s") 'swiper) +(use-package vertico + :straight t + :init + (vertico-mode)) + + +(use-package orderless + :straight t + :init + (setq completion-styles '(orderless basic) + completion-category-defaults nil + completion-category-overrides '((file (styles partial-completion))))) + +(use-package marginalia + :straight t + :bind (:map minibuffer-local-map + ("M-A" . marginalia-cycle)) + :init (marginalia-mode)) + +(use-package consult + :straight t + :bind ;; C-c bindings (mode-specific-map) + (("C-c h" . consult-history) + ("C-c m" . consult-mode-command) + ("C-c k" . consult-kmacro) + ;; C-x bindings (ctl-x-map) + ("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command + ("C-x b" . consult-buffer) ;; orig. switch-to-buffer + ("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window + ("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame + ("C-x r b" . consult-bookmark) ;; orig. bookmark-jump + ("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer + ;; Custom M-# bindings for fast register access + ("M-#" . consult-register-load) + ("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated) + ("C-M-#" . consult-register) + ;; Other custom bindings + ("M-y" . consult-yank-pop) ;; orig. yank-pop + (" a" . consult-apropos) ;; orig. apropos-command + ;; M-g bindings (goto-map) + ("M-g e" . consult-compile-error) + ("M-g f" . consult-flycheck) ;; Alternative: consult-flycheck + ("M-g g" . consult-goto-line) ;; orig. goto-line + ("M-g M-g" . consult-goto-line) ;; orig. goto-line + ("M-g o" . consult-outline) ;; Alternative: consult-org-heading + ("M-g m" . consult-mark) + ("M-g k" . consult-global-mark) + ("M-g i" . consult-imenu) + ("M-g I" . consult-imenu-multi) + ;; M-s bindings (search-map) + ("M-s d" . consult-find) + ("M-s D" . consult-locate) + ("M-s g" . consult-grep) + ("M-s G" . consult-git-grep) + ("M-s r" . consult-ripgrep) + ("M-s l" . consult-line) + ("M-s L" . consult-line-multi) + ("M-s m" . consult-multi-occur) + ("M-s k" . consult-keep-lines) + ("M-s u" . consult-focus-lines) + ;; Isearch integration + ("M-s e" . consult-isearch-history) + :map isearch-mode-map + ("M-e" . consult-isearch-history) ;; orig. isearch-edit-string + ("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string + ("M-s l" . consult-line) ;; needed by consult-line to detect isearch + ("M-s L" . consult-line-multi) ;; needed by consult-line to detect isearch + ;; Minibuffer history + :map minibuffer-local-map + ("M-s" . consult-history) ;; orig. next-matching-history-element + ("M-r" . consult-history)) ;; orig. previous-matching-history-element + + ;; Enable automatic preview at point in the *Completions* buffer. This is + ;; relevant when you use the default completion UI. + :hook (completion-list-mode . consult-preview-at-point-mode)) + ;; autocompletion by default (straight-use-package 'company) @@ -363,17 +436,6 @@ :config (setq inferior-lisp-program "sbcl")) -(use-package paredit - :straight t - :config - (add-hook 'emacs-lisp-mode-hook 'enable-paredit-mode) - (add-hook 'lisp-mode-hook 'enable-paredit-mode) - (add-hook 'lisp-interaction-mode-hook 'enable-paredit-mode) - (add-hook 'scheme-mode-hook 'enable-paredit-mode) - (add-hook 'geiser-mode-hook 'enable-paredit-mode) - (add-hook 'ielm-mode-hook 'enable-paredit-mode) - (add-hook 'eval-expression-minibuffer-setup-hook 'enable-paredit-mode)) - ;; make lambda lambda :D (add-hook 'scheme-mode-hook 'prettify-symbols-mode) (add-hook 'inferior-scheme-mode-hook 'prettify-symbols-mode) @@ -411,10 +473,6 @@ :after lsp-mode :commands lsp-ui-mode) -(use-package lsp-ivy - :straight t - :commands lsp-ivy-workspace-symbol) - ;; snippets (straight-use-package 'yasnippet) (yas-global-mode t)