Closed jacky-xbb closed 9 months ago
I have similar experience. Unfortunately, I don't know the reason, but I suspect that it conflicts with a language server's completion somehow sometimes.
I think so. And I found a way to bypass this problem. You can use other key binds instead of TAB.
I have the same issue, pretty annoying tbh...
I also suspect that it is bound to some other completion framework.
With the configuration above applied, what is the output of 'C-x k
it's evil getting in the way, I fixed it like this
;; accept completion from copilot and fallback to company
(use-package! copilot
:hook (prog-mode . copilot-mode)
:bind (:map copilot-completion-map
("<tab>" . 'copilot-accept-completion)
("TAB" . 'copilot-accept-completion)
("C-TAB" . 'copilot-accept-completion-by-word)
("C-<tab>" . 'copilot-accept-completion-by-word)))
(after! (evil copilot)
;; Define the custom function that either accepts the completion or does the default behavior
(defun my/copilot-tab-or-default ()
(interactive)
(if (and (bound-and-true-p copilot-mode)
;; Add any other conditions to check for active copilot suggestions if necessary
)
(copilot-accept-completion)
(evil-insert 1))) ; Default action to insert a tab. Adjust as needed.
;; Bind the custom function to <tab> in Evil's insert state
(evil-define-key 'insert 'global (kbd "<tab>") 'my/copilot-tab-or-default))
lmk if that works :)
cc @jacky-xbb @katafrakt @emil-vdw
@jacky-xbb I'm going to assume that @i-oliva's fix has worked? It might be worth while to update the Doom section in the readme.
I follow the instructions to config my doom
I use
TAB
to complete the code, and I found it sometimes works, and sometimes it doesn't work. Does anybody know the reason?