From 76883edf0b39db0f121d803a610602f1187c9183 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Thu, 4 Jan 2024 13:45:24 +0800 Subject: [PATCH] feat: emacs - format nix files via alejandra --- home/base/desktop/editors/emacs/default.nix | 3 ++- home/base/desktop/editors/emacs/doom/config.el | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/home/base/desktop/editors/emacs/default.nix b/home/base/desktop/editors/emacs/default.nix index 3759113c..f9805ddc 100644 --- a/home/base/desktop/editors/emacs/default.nix +++ b/home/base/desktop/editors/emacs/default.nix @@ -74,7 +74,7 @@ in { } (mkIf pkgs.stdenv.isLinux ( - # Do not use emacs-nox here, which makes the mouse wheel work abnormally + # Do not use emacs-nox here, which makes the mouse wheel work abnormally in terminal mode. let emacsPkg = pkgs.emacs29; in { home.packages = [emacsPkg]; @@ -86,6 +86,7 @@ in { })) (mkIf pkgs.stdenv.isDarwin ( + # Do not use emacs-nox here, which makes the mouse wheel work abnormally in terminal mode. let emacsPkg = pkgs.emacs29; in { home.packages = [emacsPkg]; diff --git a/home/base/desktop/editors/emacs/doom/config.el b/home/base/desktop/editors/emacs/doom/config.el index 0102044c..c65d1c72 100644 --- a/home/base/desktop/editors/emacs/doom/config.el +++ b/home/base/desktop/editors/emacs/doom/config.el @@ -123,6 +123,14 @@ (after! markdown-mode (global-font-lock-mode 0)) +;; use alejandra to format nix files +(use-package lsp-nix + :ensure lsp-mode + :after (lsp-mode) + :demand t + :custom + (lsp-nix-nil-formatter ["alejandra"])) + ;; fix yaml highlighting for catppuccin theme ;; https://github.com/catppuccin/emacs/issues/55 (add-hook 'yaml-mode-hook