summaryrefslogtreecommitdiff
path: root/.emacs
diff options
context:
space:
mode:
authorKรฉvin Le Gouguec <kevin.legouguec@gmail.com>2023-06-05 00:24:05 +0200
committerKรฉvin Le Gouguec <kevin.legouguec@gmail.com>2023-06-21 20:31:15 +0200
commite0bb836f3f825ec0bcc22fe94239a0e1d6b7f398 (patch)
tree3c2c406d173a8ca71ef55bb832ac571954cdad48 /.emacs
parentd0f1731bab471ad2a7de685a85b7c3e571e292da (diff)
downloaddotfiles-e0bb836f3f825ec0bcc22fe94239a0e1d6b7f398.tar.xz
Switch to default completion UI
Mostly to avoid icomplete jank (bug#40152). Inspired by: <https://www.scss.tcd.ie/~sulimanm/posts/default-emacs-completion.html> Rationale for the customizations: C-M- chord for navigation Because I found myself missing C-n/C-p in a couple of situations. auto-help 'visible The feedback is not as immediate as icomplete, but it's good enough. Tried 'always, but there's a sit-for somewhere that causes a weird pause if you happen to RET before bringing up completions. auto-select 'second-tab M-v? M-g M-c?? show-help nil "Click on a selection to select it" ๐Ÿ˜ format 'one-column Where have you been all my life. max-height 10 More often than not I'm typing something inspired by the content from another buffer, so limit how much context *Completions* can hide. auto-choose icomplete never clobbered the minibuffer until I asked it to (with e.g. C-M-i). Since C-u M-RET is a thing, keep candidates off the minibuffer unless I pull them in, in case I change my mind and start typing something entirely different from the currently highlighted candidate.
Diffstat (limited to '.emacs')
-rw-r--r--.emacs36
1 files changed, 29 insertions, 7 deletions
diff --git a/.emacs b/.emacs
index af613f3..4d3ab5c 100644
--- a/.emacs
+++ b/.emacs
@@ -742,13 +742,6 @@
(my/list-update erc-track-exclude-types
'("JOIN" "PART" "QUIT"))))
-(use-package icomplete
- :config
- (setq icomplete-scroll t)
- :custom
- (icomplete-mode t)
- (icomplete-vertical-mode t))
-
(use-package isearch
:delight "๐Ÿ”"
:custom
@@ -778,12 +771,41 @@
(markdown-header-scaling t)
(markdown-indent-on-enter 'indent-and-new-item))
+;; Gripes:
+;; - underused keys: C-M-i, C-j
+;; - (minibuffer-)choose-completion ignore completion-no-auto-exit
+;; when the candidate is a directory: the candidate is inserted in
+;; the minibuffer and the user does *not* exit the minibuffer.
+;;
+;; In minibuffer:
+;; - TAB complete, or show/update completions
+;; - TABยฒ jump to completions
+;; - C-M-n, C-M-p highlight candidate (without changing minibuffer)
+;; - RET, C-j accept minibuffer input
+;; - M-RET accept highlighted candidate
+;; - C-u M-RET insert highlighted candidate (without accepting)
+;;
+;; In completions:
+;; - n, TAB, p highlight candidate (without changing minibuffer)
+;; - RET accept highlighted candidate
+;; - C-u RET insert highlighted candidate in minibuffer (without accepting)
+;; - C-g, q back to minibuffer
(use-package minibuffer
:config
(setq completion-ignore-case t)
+ (define-key completion-in-region-mode-map (kbd "C-M-n") 'minibuffer-next-completion)
+ (define-key completion-in-region-mode-map (kbd "C-M-p") 'minibuffer-previous-completion)
+ (define-key minibuffer-mode-map (kbd "C-M-n") 'minibuffer-next-completion)
+ (define-key minibuffer-mode-map (kbd "C-M-p") 'minibuffer-previous-completion)
:custom
+ (completion-auto-help 'visible)
+ (completion-auto-select 'second-tab)
+ (completion-show-help nil)
(completions-detailed t)
+ (completions-format 'one-column)
(completions-group t)
+ (completions-max-height 10)
+ (minibuffer-completion-auto-choose nil)
(read-buffer-completion-ignore-case t)
(read-file-name-completion-ignore-case t))