commit 3d736b6be21cd9019a69830de548891f606094af
parent 0feb2b906b4f825335ef3dbfa7bfbbfa224224e9
Author: Vincent Demeester <vincent@sbr.pm>
Date: Mon, 14 Mar 2022 15:08:07 +0100
tools/emacs: more lsp, and nix mode
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/tools/emacs/config/programming-lsp.el b/tools/emacs/config/programming-lsp.el
@@ -3,13 +3,12 @@
;;; LSP configuration
;;; Code:
(use-package lsp-mode
- :unless noninteractive
+ :hook ((python-mode . lsp)
+ (go-mode . lsp)
+ (nix-mode . lsp))
:init
(setq lsp-keymap-prefix "C-c l")
:config
- (setq lsp-eldoc-render-all t)
- (add-hook 'python-mode-hook #'lsp)
- (add-hook 'go-mode-hook #'lsp)
(setq lsp-eldoc-render-all t))
(use-package consult-lsp
diff --git a/tools/emacs/config/programming-nix.el b/tools/emacs/config/programming-nix.el
@@ -4,7 +4,13 @@
;;; Code:
(use-package nix-mode
:if *nix*
- :mode ("\\.nix\\'" "\\.nix.in\\'"))
+ :mode ("\\.nix\\'" "\\.nix.in\\'")
+ :config
+ (add-to-list 'lsp-language-id-configuration '(nix-mode . "nix"))
+ (lsp-register-client
+ (make-lsp-client :new-connection (lsp-stdio-connection '("rnix-lsp"))
+ :major-modes '(nix-mode)
+ :server-id 'nix)))
(use-package nix-drv-mode
:if *nix*
diff --git a/users/vincent/dev/nix.nix b/users/vincent/dev/nix.nix
@@ -7,5 +7,6 @@
nix-update
nix-review
nix-prefetch-scripts
+ rnix-lsp
];
}