Closed cpbl closed 1 year ago
To determine which key you pressed and the command it is bound to, use M-x describe-key
.
Oh, thank you very much. It says : indent-for-tab-command &optional ARG So maybe it's possible for my settings to have different bindings for gui and non-gui emacs?
This is what's in my init.el, which makes things work in the GUI!
(defun my/copilot-tab ()
(interactive)
(or (copilot-accept-completion)
(indent-for-tab-command)))
(with-eval-after-load 'copilot
(define-key copilot-mode-map (kbd "<tab>") #'my/copilot-tab))
What is the key you pressed? I guess that it is TAB
rather than <tab>
.
Thank you for the hint! It was TAB, and Ctrl-i gives the same response.
So, from reading sources linked below:
TAB
= Ctrl-i
<tab>
is more of a virtual concept in emacs rather than a physical key. They can be mapped separately sometimes.<tab>
is mapped to Ctrl-i
in the GUI but not in terminal; see https://github.com/syl20bnr/spacemacs/issues/4024#issuecomment-161122099<tab>
to TAB
in my init.el solves the problemOther references: https://stackoverflow.com/questions/26195884/tab-v-tab-in-emacs
Thanks for sharing your findings!
I also found it a bit confusing, so in the example configurations, I ended up binding both <tab>
and TAB
.
Apologies if this is off-topic or if the answer ends up being idiosyncratic, but pressing "tab", which works to accept copilot suggestions in my GUI emacs window, does not work when using Emacs with
-nw
option. Instead, it makes the suggestion go away. Would this happen to be something to do with the plugin??