Add eglot keybinds

This commit is contained in:
eriedaberrie 2023-04-29 19:14:52 -07:00
parent 01009b782a
commit 90c5afd4f2

22
init.el
View file

@ -310,8 +310,21 @@
:config :config
(which-key-mode)) (which-key-mode))
(use-package flymake
:ensure nil
:bind (:map flymake-mode-map
("M-n" . flymake-goto-next-error)
("M-p" . flymake-goto-prev-error)))
(use-package eglot (use-package eglot
:demand nil :ensure nil
:bind (:map eglot-mode-map
("C-c e c" . eglot-code-actions)
("C-c e r" . eglot-rename)
("C-c e f" . eglot-format)
("C-c e s" . eglot-shutdown)
("C-c e S" . eglot-shutdown-all)
("C-c e R" . eglot-reconnect))
:hook :hook
(c-mode . eglot-ensure) (c-mode . eglot-ensure)
(c-ts-mode . eglot-ensure) (c-ts-mode . eglot-ensure)
@ -319,13 +332,10 @@
(c++-ts-mode . eglot-ensure) (c++-ts-mode . eglot-ensure)
(java-mode . eglot-ensure) (java-mode . eglot-ensure)
(java-ts-mode . eglot-ensure) (java-ts-mode . eglot-ensure)
(nix-mode . eglot-ensure)
:custom :custom
(eglot-events-buffer-size 0) (eglot-events-buffer-size 0)
(eglot-autoshutdown t) (eglot-autoshutdown t))
:config
(add-hook 'eglot-managed-mode-hook
(lambda ()
(setq-local indent-region-function #'eglot-format))))
(use-package eglot-java (use-package eglot-java
:hook java-mode java-ts-mode) :hook java-mode java-ts-mode)