diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 00000000..248a6ef4 --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,3 @@ +((nil + (format-all-formatters + ("Nix" alejandra)))) diff --git a/.dir-locals.el~ b/.dir-locals.el~ new file mode 100644 index 00000000..e69de29b diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 37f9c87f..ca72463e 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -536,9 +536,12 @@ make sure to setup authinfo #+end_src *** Formatting #+begin_src emacs-lisp - (use-package format-all - :config - (setq format-all-formatters '(("Nix" . "alejandra")))) +(use-package format-all + :custom + ((setq format-all-formatters (("Nix" alejandra)))) + :hook + ((format-all-mode . format-all-ensure-formatter) + (prog-mode . format-all-mode))) #+end_src ** Dired (quick file management in emacs) Dired is a built-in file manager for Emacs that does some pretty amazing things! Here are some key bindings you should try out: diff --git a/config/emacs/init.el b/config/emacs/init.el index e1080a84..264f9cd4 100644 --- a/config/emacs/init.el +++ b/config/emacs/init.el @@ -1,4 +1,3 @@ - ;; UI/UX (setq inhibit-startup-message t) ;; make it look like neovim a little @@ -456,8 +455,11 @@ :hook (company-mode . company-box-mode)) (use-package format-all - :config - (setq format-all-formatters '(("Nix" . "alejandra")))) + :custom + ((setq format-all-formatters (("Nix" alejandra)))) + :hook + ((format-all-mode . format-all-ensure-formatter) + (prog-mode . format-all-mode))) (use-package dired :ensure nil