Skip to content

Commit

Permalink
feat: Enable copilot in markdown and org mode automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
Maverobot committed Feb 2, 2024
1 parent 6fdb5d3 commit e9026f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spacemacs.org
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,19 @@ Autocompletion config for launch files.
;; disable inline previews
(delq 'company-preview-if-just-one-frontend company-frontends))

;; Keybindings
(with-eval-after-load 'copilot
(define-key copilot-completion-map (kbd "<tab>") 'copilot-accept-completion)
(define-key copilot-completion-map (kbd "TAB") 'copilot-accept-completion)
(define-key copilot-completion-map (kbd "C-TAB") 'copilot-accept-completion-by-word)
(define-key copilot-completion-map (kbd "C-<tab>") 'copilot-accept-completion-by-word))

;; Enable copilot mode in programming modes, markdown-mode and org-mode
(add-hook 'prog-mode-hook 'copilot-mode)
(add-hook 'markdown-mode-hook 'copilot-mode)
(add-hook 'org-mode-hook 'copilot-mode)

;; Disable the warning message
(add-hook 'copilot-mode-hook (lambda ()
(setq-local copilot--indent-warning-printed-p t)))
#+END_SRC
Expand Down

0 comments on commit e9026f4

Please sign in to comment.