From 20e7db23243e64da0b806d94bbd62dd537ca163d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20R=C3=B6ger?= Date: Thu, 10 Apr 2025 12:58:53 +0200 Subject: [PATCH] Home Gen498 @ 2025-04-10-12:58 --- modules/home/doom/doom.nix | 4 ++++ modules/home/doom/static/config.d/copilot.el | 8 ++++++++ modules/home/doom/static/config.el | 15 ++++++--------- 3 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 modules/home/doom/static/config.d/copilot.el 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))))