From 1dac032fe9767668d4c3a3ba2e70cfe25b92f0d0 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 10 Apr 2022 11:58:04 +0200 Subject: [PATCH] Enable alejandra for Nix formatting --- config.org | 12 ++++++++++++ init.el | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/config.org b/config.org index dddf733..99dd362 100644 --- a/config.org +++ b/config.org @@ -19,6 +19,8 @@ - [[#enable-proc-macro-support][Enable proc macro support]] - [[#cc][C/C++]] - [[#default-style][Default style]] + - [[#nix][Nix]] + - [[#formatting][Formatting]] - [[#org-mode][Org mode]] - [[#directory][Directory]] - [[#appearance][Appearance]] @@ -247,6 +249,16 @@ Setup the default format for C/C++ editing. (setq c-basic-offset 2)) #+END_SRC +** Nix + +*** Formatting + +Use [[https://github.com/kamadorueda/alejandra][alejandra]] to format Nix code. + +#+begin_src emacs-lisp +(set-formatter! 'alejandra "alejandra --quiet" :modes '(nix-mode)) +#+end_src + * Org mode ** Directory diff --git a/init.el b/init.el index e14c646..c0a94d5 100644 --- a/init.el +++ b/init.el @@ -55,7 +55,7 @@ (evil +everywhere); come to the dark side, we have cookies ;;file-templates ; auto-snippets for empty files fold ; (nigh) universal code folding - ;;(format +onsave) ; automated prettiness + (format) ; automated prettiness ;;god ; run Emacs commands without modifier keys ;;lispy ; vim for lisp, for people who don't like vim ;;multiple-cursors ; editing in many places at once