Skip to content

Commit

Permalink
Fiddle with key bindings for copilot completion
Browse files Browse the repository at this point in the history
Using tab for completion feels very natural, but it's too natural: I
frequently use tab without thinking whilst coding.

This commit removes <tab> as a binding for potential copilot
completion and instead uses M-<return>.
  • Loading branch information
JeffAbrahamson committed May 25, 2023
1 parent 3303d2c commit 46b8221
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions emacs/elisp/copilot-bindings.el
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
(if (copilot--overlay-visible)
(progn
(copilot-accept-completion)
(open-line 1)
(next-line))
;;(open-line 1)
;;(next-line)
)
(copilot-complete)))

(defun jma/copilot-tab ()
Expand Down Expand Up @@ -70,8 +71,8 @@ If not in copilot overlay, move forward ARG lines, or one line if no ARG."
;; (define-key copilot-mode-map (kbd "M-<left>") #'copilot-previous-completion)
(define-key copilot-mode-map (kbd "M-f") #'jma/copilot-accept-completion-by-word)
(define-key copilot-mode-map (kbd "C-n") #'jma/copilot-accept-completion-by-line)
;; (define-key global-map (kbd "M-C-<return>") #'jma/copilot-complete-or-accept)
(define-key copilot-completion-map (kbd "<tab>") #'jma/copilot-complete-or-accept)
(define-key global-map (kbd "M-<return>") #'jma/copilot-complete-or-accept)
;(define-key copilot-completion-map (kbd "<tab>") #'jma/copilot-complete-or-accept)
;; (define-key global-map (kbd "<tab>") #'jma/copilot-tab)

(defun jma/copilot-quit ()
Expand Down

0 comments on commit 46b8221

Please sign in to comment.