RaisinSecure 路 2022-09-28 18:15
How do i disable tab completion in corfu? i added `(define-key corfu-map (kbd "TAB") nil)` to my init.el after seeing describe-function for define-key:
> DEF is anything that can be a key鈥檚 definition:
> nil (means key is undefined in this keymap),
but `corfu-map` still has `<tab> corfu-complete`
JDRiverRun 路 2022-09-28 21:07
`corfu-map` is only active when corfu is popped-up. The reason you are seeing corfu appear on Tab is likely that the variable `tab-always-indent` is `'complete`, which means to (eventually) call `completion-at-point` unless at the beginning of a line.
Unlike company, corfu is *just a UI* for Emacs native `completion-at-point` (one of its advantages). So if you removed corfu entirely, Tab would give you a standard Emacs completion buffer.
To get what you want, you can try setting `tab-always-indent` to `t`. Note that many modes bind M-Tab to `completion-at-point`, so that's a good substitute.
If you really want to disable the Tab behavior while in a corfu popup itself, then:
(define-key corfu-map [tab] nil)
(define-key corfu-map "\t" nil)
RaisinSecure 路 2022-09-28 21:37
My `tab-always-indent` was `t` (the default I think, I never changed this in my config)
I also had `(define-key corfu-map "\t" nil)` in my config.
`(define-key corfu-map [tab] nil)` worked though, tysm 馃檹
What's the difference between `"\t" and `[tab]`?
7890yuiop 路 2022-09-28 21:41
> I added `(define-key corfu-map (kbd "TAB") nil)` but `corfu-map` still has `<tab> corfu-complete`
`TAB` and `<tab>` are two different things, so unbinding one does not unbind the other.
It's unusual for *anything* to bind `<tab>` because (a) terminals don't send it, and (b) by default it gets translated to `TAB` (which terminals send); so binding to `TAB` is all that's needed so long as nothing is messing with `<tab>` (so the fact that it's bound by corfu might be worth a bug report).
JDRiverRun 路 2022-09-28 22:07
Two different ways of saying the same thing. Corfu defines both.
JDRiverRun 路 2022-09-28 23:00
It's explained in the source:
;; XXX [tab] is bound because of org-mode
;; The binding should be removed from org-mode-map.
7890yuiop 路 2022-09-28 23:20
* `"\t"` is the same thing as `(kbd "TAB")`
* `[tab]` is the same thing as `(kbd "<tab>")`
The former is the ASCII tab character (9, aka `C-i`) sent by terminals when you press the TAB key.
The latter is the tab keyboard event sent in GUI environments, and is not the same thing as `C-i`.
RaisinSecure 路 2022-09-29 04:32
ah thanks