|
|
@ -528,6 +528,24 @@ be global." |
|
|
|
("C-M->" . mc/unmark-previous-like-this) |
|
|
|
("C-c C-<" . mc/mark-all-like-this))) |
|
|
|
|
|
|
|
(use-package nix-mode |
|
|
|
:config (progn |
|
|
|
(defun nixfmt-fix () |
|
|
|
(interactive) |
|
|
|
(when (executable-find "nixfmt") |
|
|
|
(let ((point (point))) |
|
|
|
(unwind-protect |
|
|
|
(call-process-region (point-min) (point-max) "nixfmt" t t) |
|
|
|
(goto-char point))))) |
|
|
|
|
|
|
|
(define-minor-mode nixfmt-fix-mode |
|
|
|
"Use nixfmt to automatically format nix files." |
|
|
|
:lighter " nixfmt" |
|
|
|
(if nixfmt-fix-mode |
|
|
|
(add-hook 'before-save-hook #'nixfmt-fix nil t) |
|
|
|
(remove-hook 'before-save-hook #'nixfmt-fix t)))) |
|
|
|
:hook (nix-mode . nixfmt-fix-mode)) |
|
|
|
|
|
|
|
(use-package no-littering |
|
|
|
:demand t |
|
|
|
:config (progn |
|
|
|