From 654fa8ce893ea49780d979c124d3b94180cbc5d0 Mon Sep 17 00:00:00 2001 From: caem Date: Fri, 14 Feb 2025 14:51:10 +0100 Subject: [PATCH] emacs: Add yaml mode and move eln-cache dir --- modules/home/caem/development/emacs/emacs.d/formatting.el | 3 ++- modules/home/caem/development/emacs/emacs.d/init.el | 6 ++++-- .../home/caem/development/emacs/emacs.d/languages/yaml.el | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 modules/home/caem/development/emacs/emacs.d/languages/yaml.el diff --git a/modules/home/caem/development/emacs/emacs.d/formatting.el b/modules/home/caem/development/emacs/emacs.d/formatting.el index 02f9ccd..cb7022f 100644 --- a/modules/home/caem/development/emacs/emacs.d/formatting.el +++ b/modules/home/caem/development/emacs/emacs.d/formatting.el @@ -5,7 +5,8 @@ (use-package indent-bars :ensure t - :hook (prog-mode . indent-bars-mode) + :hook ((prog-mode . indent-bars-mode) + (text-mode . indent-bars-mode)) :custom (indent-bars-display-on-blank-lines t) (indent-bars-pattern " . . . ") diff --git a/modules/home/caem/development/emacs/emacs.d/init.el b/modules/home/caem/development/emacs/emacs.d/init.el index 17b1fc7..9d5f820 100644 --- a/modules/home/caem/development/emacs/emacs.d/init.el +++ b/modules/home/caem/development/emacs/emacs.d/init.el @@ -1,3 +1,5 @@ +(setq conf-home (concat (or (getenv "XDG_CONFIG_HOME") "~/.config") "/emacs")) + ;; Set up paths so that emacs never touches ~/.config/emacs (let ((data-home (concat (or (getenv "XDG_DATA_HOME") "~/.local/share") "/emacs"))) (setq user-emacs-directory data-home @@ -11,8 +13,8 @@ abbrev-file-name (expand-file-name "abbrev.el" data-home) savehist-file (expand-file-name "savehist" data-home) server-auth-dir (expand-file-name "server" data-home) - package-quickstart-file (expand-file-name "package-quickstart.elc" data-home))) -(setq conf-home (concat (or (getenv "XDG_CONFIG_HOME") "~/.config") "/emacs")) + package-quickstart-file (expand-file-name "package-quickstart.elc" data-home)) + (startup-redirect-eln-cache (expand-file-name "eln-cache" data-home))) (package-initialize) diff --git a/modules/home/caem/development/emacs/emacs.d/languages/yaml.el b/modules/home/caem/development/emacs/emacs.d/languages/yaml.el new file mode 100644 index 0000000..3646177 --- /dev/null +++ b/modules/home/caem/development/emacs/emacs.d/languages/yaml.el @@ -0,0 +1,4 @@ +(use-package yaml-mode + :ensure t + :mode ("\\.yaml\\'" . yaml-mode) + :mode ("\\.yml\\'" . yaml-mode))