|
|
@ -21,8 +21,6 @@ |
|
|
|
;; See 'C-h v doom-font' for documentation and more examples of what they |
|
|
|
;; See 'C-h v doom-font' for documentation and more examples of what they |
|
|
|
;; accept. For example: |
|
|
|
;; accept. For example: |
|
|
|
;; |
|
|
|
;; |
|
|
|
|
|
|
|
|
|
|
|
(setq doom-font (font-spec :family "Fira Code" :size 12)) |
|
|
|
|
|
|
|
;; |
|
|
|
;; |
|
|
|
;; If you or Emacs can't find your font, use 'M-x describe-font' to look them |
|
|
|
;; If you or Emacs can't find your font, use 'M-x describe-font' to look them |
|
|
|
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to |
|
|
|
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to |
|
|
@ -106,23 +104,29 @@ |
|
|
|
(global-set-key (kbd "M-g") 'format-all-buffer) |
|
|
|
(global-set-key (kbd "M-g") 'format-all-buffer) |
|
|
|
|
|
|
|
|
|
|
|
;; accept completion from copilot and fallback to company |
|
|
|
;; accept completion from copilot and fallback to company |
|
|
|
(use-package! copilot |
|
|
|
;; (use-package! copilot |
|
|
|
:hook (prog-mode . copilot-mode) |
|
|
|
;; :hook (prog-mode . copilot-mode) |
|
|
|
:bind (:map copilot-completion-map |
|
|
|
;; :bind (:map copilot-completion-map |
|
|
|
("<tab>" . 'copilot-accept-completion) |
|
|
|
;; ("<tab>" . 'copilot-accept-completion) |
|
|
|
("TAB" . 'copilot-accept-completion) |
|
|
|
;; ("TAB" . 'copilot-accept-completion) |
|
|
|
("C-TAB" . 'copilot-accept-completion-by-word) |
|
|
|
;; ("C-TAB" . 'copilot-accept-completion-by-word) |
|
|
|
("C-<tab>" . 'copilot-accept-completion-by-word))) |
|
|
|
;; ("C-<tab>" . 'copilot-accept-completion-by-word))) |
|
|
|
|
|
|
|
|
|
|
|
(after! (evil copilot) |
|
|
|
(use-package! drag-stuff |
|
|
|
;; Define the custom function that either accepts the completion or does the default behavior |
|
|
|
:config |
|
|
|
(defun my/copilot-tab-or-default () |
|
|
|
(drag-stuff-global-mode 1) |
|
|
|
(interactive) |
|
|
|
(map! :v "J" #'drag-stuff-down |
|
|
|
(if (and (bound-and-true-p copilot-mode) |
|
|
|
:v "K" #'drag-stuff-up)) |
|
|
|
;; Add any other conditions to check for active copilot suggestions if necessary |
|
|
|
|
|
|
|
) |
|
|
|
;; (after! (evil copilot) |
|
|
|
(copilot-accept-completion) |
|
|
|
;; ;; Define the custom function that either accepts the completion or does the default behavior |
|
|
|
(evil-insert 1))) ; Default action to insert a tab. Adjust as needed. |
|
|
|
;; (defun my/copilot-tab-or-default () |
|
|
|
|
|
|
|
;; (interactive) |
|
|
|
;; Bind the custom function to <tab> in Evil's insert state |
|
|
|
;; (if (and (bound-and-true-p copilot-mode) |
|
|
|
(evil-define-key 'insert 'global (kbd "<tab>") 'my/copilot-tab-or-default)) |
|
|
|
;; ;; 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)) |
|
|
|