From 6eaf17979c76b8b6d37b0aa7115e623486bfc61c Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 9 Aug 2021 23:14:01 -0500 Subject: Configure completion framework --- init.el | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 4c2e610..c850b77 100644 --- a/init.el +++ b/init.el @@ -149,7 +149,7 @@ (setup completion (:option completion-ignore-case t read-buffer-completion-ignore-case t - completion-styles '(partial-completion substring flex) + completion-styles '(substring partial-completion) completion-category-defaults nil completion-category-overrides '((file (styles . (partial-completion))))) @@ -929,9 +929,24 @@ if ripgrep is installed, otherwise `consult-grep'." ;; Competion-at-point (complete-region) (:global "M-/" completion-at-point) - (:option completion-in-region-function #'consult-completion-in-region + (:option completion-in-region-function + (lambda (&rest args) + (apply (if vertico-mode + #'consult-completion-in-region + #'completion--in-region) + args)) completion-cycle-threshold 3 - tab-always-indent 'complete)) + tab-always-indent 'complete) + + ;; Completing-read-multple + (if (fboundp #'consult-completing-read-multiple) + (:advise completing-read-multple + :override #'consult-completing-read-multiple) + + (defun crm-indicator (args) + (cons (concat "[CRM] " (car args)) (cdr args))) + (:advise completing-read-multiple + :filter-args #'crm-indicator))) (setup (:straight crux) @@ -1139,7 +1154,7 @@ if ripgrep is installed, otherwise `consult-grep'." :host github :repo "oantolin/orderless")) (require 'orderless) - (:option (prepend completion-styles) 'orderless)) + (:option (append completion-styles) 'orderless)) (setup (:straight org) (:straight org-contrib) @@ -1162,7 +1177,9 @@ if ripgrep is installed, otherwise `consult-grep'." org-hide-emphasis-markers t org-html-coding-system 'utf-8-unix org-imenu-depth 3 + org-outline-path-complete-in-steps nil org-pretty-entities t + org-refile-use-outline-path 'file org-special-ctrl-a/e t org-special-ctrl-k t org-src-fontify-natively t -- cgit 1.4.1-21-gabe81 From 57150400881271234bf9f2b54e52d207369a2e00 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 9 Aug 2021 23:14:14 -0500 Subject: Configure minibuffer --- init.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'init.el') diff --git a/init.el b/init.el index c850b77..4b493eb 100644 --- a/init.el +++ b/init.el @@ -564,8 +564,12 @@ like a dumbass." '(read-only t cursor-intangible t face minibuffer-prompt) enable-recursive-minibuffers t file-name-shadow-properties '(invisible t intangible t) - read-answer-short t) + read-answer-short t + read-extended-command-predicate ; used on >28 + #'command-completion-default-include-p) + (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode) + (add-hook 'minibuffer-setup-hook #'acdw/gc-disable) (add-hook 'minibuffer-exit-hook #'acdw/gc-enable) -- cgit 1.4.1-21-gabe81 From 2d3e66de187e1b145f8b980d7ccb4d2b38de2628 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 9 Aug 2021 23:14:25 -0500 Subject: Add vertico extensions --- init.el | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 4b493eb..a564ac7 100644 --- a/init.el +++ b/init.el @@ -1316,13 +1316,31 @@ if ripgrep is installed, otherwise `consult-grep'." (setup (:straight (vertico :host github - :repo "minad/vertico")) + :repo "minad/vertico" + :files ("*" "extensions/*" + (:exclude ".git")))) + (:option resize-mini-windows 'grow-only vertico-count-format nil vertico-cycle t) + (if (boundp 'comp-deferred-compilation-deny-list) (add-to-list 'comp-deferred-compilation-deny-list "vertico")) - (vertico-mode +1)) + + (vertico-mode +1) + + ;; Extensions! + (:also-load vertico-mouse) + (vertico-mouse-mode +1) + + ;; Workarounds! + (when (version< org-version "9.5") + (defun disable-selection () + (when (eq minibuffer-completion-table #'org-tags-completion-function) + (setq-local vertico-map minibuffer-local-completion-map + completion-cycle-threshold nil + completion-styles '(basic)))) + (advice-add #'vertico--setup :before #'disable-selection))) (setup (:straight vuiet) (:needs "youtube-dl" -- cgit 1.4.1-21-gabe81 From e550fd801076a146e85ad6c70876c59084f83914 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 9 Aug 2021 23:14:39 -0500 Subject: Add embark Remove imenu-anywhere -- I didn't know I had it installed! --- init.el | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index a564ac7..63badc0 100644 --- a/init.el +++ b/init.el @@ -1003,6 +1003,21 @@ if ripgrep is installed, otherwise `consult-grep'." :branch "main")) (require 'gemini-write)))) +(setup (:straight embark) + (:global "C-." embark-act + "C-;" embark-dwim) + (:option prefix-help-command #'embark-prefix-help-command + (append display-buffer-alist) + '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" + nil + (window-parameters (mode-line-format . none)))) + + (with-eval-after-load 'embark + (with-eval-after-load 'consult + (setup (:straight embark-consult) + (add-hook 'embark-collect-mode-hook + #'consult-preview-at-point-mode))))) + (setup (:straight epithet) (add-hook 'Info-selection-hook #'epithet-rename-buffer) (add-hook 'eww-after-render-hook #'epithet-rename-buffer) @@ -1079,9 +1094,6 @@ if ripgrep is installed, otherwise `consult-grep'." " o" helpful-symbol "C-c C-d" helpful-at-point)) -(setup (:straight imenu-anywhere) - (:global "C-." imenu-anywhere)) - (setup (:straight iscroll) (:hook-into text-mode)) -- cgit 1.4.1-21-gabe81 From 28e0353b731754a301f00a026ec10c65b4a5676e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 9 Aug 2021 23:36:58 -0500 Subject: Further configure embark --- init.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'init.el') diff --git a/init.el b/init.el index 63badc0..68d5460 100644 --- a/init.el +++ b/init.el @@ -1010,7 +1010,11 @@ if ripgrep is installed, otherwise `consult-grep'." (append display-buffer-alist) '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" nil - (window-parameters (mode-line-format . none)))) + (window-parameters (mode-line-format . none))) + embark-prompter #'embark-keymap-prompter + embark-verbose-indicator-display-action + '(display-buffer-at-bottom + (window-height . fit-window-to-buffer))) (with-eval-after-load 'embark (with-eval-after-load 'consult -- cgit 1.4.1-21-gabe81 From bdf3994e690674b79388c9549b9d8168bb433499 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 9 Aug 2021 23:41:26 -0500 Subject: Ad which-key config to embark --- init.el | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'init.el') diff --git a/init.el b/init.el index 68d5460..70d1677 100644 --- a/init.el +++ b/init.el @@ -1016,6 +1016,12 @@ if ripgrep is installed, otherwise `consult-grep'." '(display-buffer-at-bottom (window-height . fit-window-to-buffer))) + (setq embark-action-indicator + (lambda (map _target) + (which-key--show-keymap "Embark" map nil nil 'no-paging) + #'which-key--hide-popup-ignore-command) + embark-become-indicator embark-action-indicator) + (with-eval-after-load 'embark (with-eval-after-load 'consult (setup (:straight embark-consult) -- cgit 1.4.1-21-gabe81 From 0b1c2337c31cc2a9297856b7e0f4cb992562ce02 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 9 Aug 2021 23:46:48 -0500 Subject: Whitespace --- init.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 70d1677..cbea97e 100644 --- a/init.el +++ b/init.el @@ -1013,8 +1013,7 @@ if ripgrep is installed, otherwise `consult-grep'." (window-parameters (mode-line-format . none))) embark-prompter #'embark-keymap-prompter embark-verbose-indicator-display-action - '(display-buffer-at-bottom - (window-height . fit-window-to-buffer))) + '(display-buffer-at-bottom (window-height . fit-window-to-buffer))) (setq embark-action-indicator (lambda (map _target) -- cgit 1.4.1-21-gabe81