Commit 96fdfc9e35db

Vincent Demeester <vincent@sbr.pm>
2022-03-14 11:27:10
tools/emacs: add lsp-mode ๐Ÿ˜…
Add gopls and python-language-server as well. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent cb528c9
Changed files (4)
tools
users
tools/emacs/config/programming-lsp.el
@@ -0,0 +1,19 @@
+;;; programming-lsp.el --- -*- lexical-binding: t; -*-
+;;; Commentary:
+;;; LSP configuration
+;;; Code:
+(use-package lsp-mode
+  :unless noninteractive
+  :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
+  :after (lsp))
+
+(provide 'programming-lsp)
+;;; programming-lsp.el ends here
users/vincent/dev/emacs.nix
@@ -52,8 +52,9 @@ let
     expand-region
     flimenu
     # replace with flymake
-    flycheck
-    flycheck-golangci-lint
+    # flycheck
+    # flycheck-golangci-lint
+    focus
     git-annex
     git-modes
     git-commit
@@ -72,6 +73,10 @@ let
     ibuffer-vc
     icomplete-vertical
     json-mode
+    lsp-mode
+    lsp-ui
+    lsp-focus
+    consult-lsp
     magit
     magit-annex
     magit-popup
users/vincent/dev/go.nix
@@ -7,6 +7,7 @@
   home.packages = with pkgs; [
     gcc
     go_1_17
+    gopls
     godef
     golangci-lint
     golint
users/vincent/dev/python.nix
@@ -4,5 +4,6 @@
   home.packages = with pkgs; [
     python3
     pipenv
+    python-language-server
   ];
 }