summary refs log tree commit diff
path: root/emacs
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-03-04 07:00:11 -0800
committerFranck Cuny <franck@fcuny.net>2022-03-04 07:00:11 -0800
commit0b54c6103aa98037a091c801065eb80bae4b241c (patch)
tree493ca36b5901cc8348380a9e2507c6ef3074f2c5 /emacs
parentMakefile: remove unused targets (diff)
downloademacs.d-0b54c6103aa98037a091c801065eb80bae4b241c.tar.gz
prog: add support for nix
Enable the LSP for nix, and also ensure we're formatting the buffer when
saving a buffer.
Diffstat (limited to 'emacs')
-rw-r--r--emacs/custom/fcuny-prog.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/emacs/custom/fcuny-prog.el b/emacs/custom/fcuny-prog.el
index 1e2141c..a3eec01 100644
--- a/emacs/custom/fcuny-prog.el
+++ b/emacs/custom/fcuny-prog.el
@@ -35,6 +35,7 @@
   :commands (lsp lsp-deferred)
   :diminish lsp-mode
   :hook ((go-mode . lsp-deferred)
+         (nix-mode . lsp-deferred)
          (lsp-mode . (lambda() (let ((lsp-keymap-prefix "C-c l"))
                                  (lsp-enable-which-key-integration)))))
   :config
@@ -163,4 +164,10 @@
   ;; Show three lines of context around the current message
   (compilation-context-lines 3))
 
+(use-package nix-mode
+  :ensure t
+  :mode "\\.nix\\'"
+  :hook ((before-save . nix-format-before-save))
+  :config)
+
 (provide 'fcuny-prog)