diff --git a/modules/home/doom/doom.nix b/modules/home/doom/doom.nix index eb5ff6a..3821ba5 100644 --- a/modules/home/doom/doom.nix +++ b/modules/home/doom/doom.nix @@ -176,6 +176,10 @@ in { "doom-config/config.el" = { source = ./static/config.el; }; + "doom-config/config.d/copilot.el" = { + enable = cfg.enableCopilot; + source = ./static/config.d/copilot.el; + }; "doom-config/packages/treesit-docgen.el" = { source = ./static/packages/treesit-docgen.el; }; diff --git a/modules/home/doom/static/config.d/copilot.el b/modules/home/doom/static/config.d/copilot.el new file mode 100644 index 0000000..26d0e53 --- /dev/null +++ b/modules/home/doom/static/config.d/copilot.el @@ -0,0 +1,8 @@ +;; accept completion from copilot and fallback to company +(use-package! copilot + :hook (prog-mode . copilot-mode) + :bind (:map copilot-completion-map + ("" . 'copilot-accept-completion) + ("TAB" . 'copilot-accept-completion) + ("C-TAB" . 'copilot-accept-completion-by-word) + ("C-" . 'copilot-accept-completion-by-word))) diff --git a/modules/home/doom/static/config.el b/modules/home/doom/static/config.el index 3d1e902..9be6eef 100644 --- a/modules/home/doom/static/config.el +++ b/modules/home/doom/static/config.el @@ -96,15 +96,6 @@ :config (direnv-mode)) -;; accept completion from copilot and fallback to company -(use-package! copilot - :hook (prog-mode . copilot-mode) - :bind (:map copilot-completion-map - ("" . 'copilot-accept-completion) - ("TAB" . 'copilot-accept-completion) - ("C-TAB" . 'copilot-accept-completion-by-word) - ("C-" . 'copilot-accept-completion-by-word))) - (after! markdown-mode (setq markdown-split-window-direction 'right) (setq markdown-command "pandoc -t html5 -f markdown_mmd --embed-resources --standalone --mathjax --quiet --highlight-style=zenburn") @@ -247,3 +238,9 @@ (c-or-c++-ts-mode . lsp-deferred) (bash-ts-mode . lsp-deferred) (json-ts-mode . lsp-deferred))) + + +(let ((config-dir (expand-file-name "config.d" doom-user-dir))) + (when (file-directory-p config-dir) + (dolist (file (directory-files config-dir t "\\.el$" t)) + (load file))))