This commit is contained in:
2025-11-22 13:52:03 +08:00
parent c23a1ba64a
commit fafe8f4ab5
6 changed files with 49 additions and 42 deletions
+9 -7
View File
@@ -34,7 +34,9 @@
;; Show more detailed annotations
(setq corfu-show-annotations t
corfu-annotate-max-width 50))
corfu-annotate-max-width 50)
)
;; If using LSP, configure to show more details
(after! lsp-mode
@@ -43,9 +45,7 @@
lsp-completion-show-label-description t ; Show more details in label
))
(after! lsp-haskell
(setq lsp-haskell-plugin-fourmolu-config-path "fourmolu -o -XImportQualifiedPost -o -XOverloadedStrings -o -XTypeApplications -o -XScopedTypeVariables -o -XGADTs -o -XDataKinds -o -XTypeFamilies -o -XFlexibleContexts -o -XFlexibleInstances -o -XMultiParamTypeClasses -o -XRankNTypes -o -XExistentialQuantification")
)
;; Haskell LSP uses HLS by default in Doom; removed outdated fourmolu config
(use-package! bnf-mode
:mode "\\.bnf\\'"
@@ -122,9 +122,11 @@
(advice-add 'lsp-format-buffer :around
(lambda (orig-fun &rest args)
(if (eq major-mode 'nix-mode)
(if (in-nixpkgs-repo-p)
(format-all-buffer 'nixfmt)
(format-all-buffer 'alejandra))
(let ((fmt (if (in-nixpkgs-repo-p)
(executable-find "nixfmt")
(executable-find "alejandra"))))
(when fmt
(format-all-buffer (intern (file-name-nondirectory fmt)))))
(apply orig-fun args))))))
;; Enable format-on-save globally if desired