pinwheel: Add go-mode and hook it up with eglot
This commit is contained in:
@@ -385,3 +385,31 @@ https://github.com/justbur/emacs-which-key
|
||||
(setq diff-hl-side 'right)
|
||||
(global-diff-hl-mode t))
|
||||
#+END_SRC
|
||||
|
||||
* LSP
|
||||
** Eglot
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defun alex/eglot-organize-imports () (interactive)
|
||||
(call-interactively 'eglot-code-action-organize-imports))
|
||||
|
||||
(defun alex/eglot-on-save ()
|
||||
(add-hook 'before-save-hook #'eglot-format-buffer -10 t)
|
||||
(add-hook 'before-save-hook #'alex/eglot-organize-imports nil t)
|
||||
)
|
||||
|
||||
(use-package eglot
|
||||
:hook (
|
||||
(eglot-managed-mode . alex/eglot-on-save)
|
||||
(go-mode . eglot-ensure)
|
||||
(nix-mode . eglot-ensure)
|
||||
)
|
||||
)
|
||||
#+END_SRC
|
||||
** Go
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package go-mode
|
||||
:hook (
|
||||
(go-mode . eglot-ensure)
|
||||
)
|
||||
)
|
||||
#+END_SRC
|
||||
|
||||
@@ -17,4 +17,6 @@ in
|
||||
pkgs.wl-clipboard
|
||||
];
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.ripgrep ];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user