Files
.emacs.d/lisp/init-eglot.el

58 lines
1.8 KiB
EmacsLisp
Raw Normal View History

2025-12-14 23:00:58 +11:00
;; -*- lexical-binding: t; -*-
2025-12-15 00:26:46 +11:00
2025-12-22 10:51:46 +11:00
(use-package flymake
2025-12-22 12:34:45 +11:00
:hook (prog-mode)
:diminish
:functions my-elisp-flymake-byte-compile
:bind ("C-c d" . flymake-show-buffer-diagnostics)
:custom
(flymake-no-changes-timeout nil)
(flymake-fringe-indicator-position 'right-fringe)
(flymake-margin-indicator-position 'right-margin)
:config
;; Check elisp with `load-path'
(defun my-elisp-flymake-byte-compile (fn &rest args)
"Wrapper for `elisp-flymake-byte-compile'."
(let ((elisp-flymake-byte-compile-load-path
(append elisp-flymake-byte-compile-load-path load-path)))
(apply fn args)))
(advice-add 'elisp-flymake-byte-compile :around #'my-elisp-flymake-byte-compile))
2025-12-22 19:09:21 +11:00
2025-12-22 12:34:45 +11:00
(use-package flyover
:diminish
:hook flymake-mode
:custom (flyover-checkers '(flymake)))
2025-12-15 00:56:00 +11:00
(use-package jsonrpc)
2025-12-15 00:26:46 +11:00
2025-12-14 23:00:58 +11:00
(use-package eglot
2025-12-17 03:29:19 +11:00
:hook ((prog-mode . (lambda ()
(unless (derived-mode-p
'emacs-lisp-mode 'lisp-mode
'makefile-mode 'snippet-mode
'ron-mode)
(eglot-ensure))))
2025-12-14 23:00:58 +11:00
((markdown-mode yaml-mode yaml-ts-mode) . eglot-ensure))
2025-12-17 03:29:19 +11:00
:init (setq eglot-autoshutdown t
2025-12-22 19:09:21 +11:00
eglot-events-buffer-config 0
2025-12-17 03:29:19 +11:00
eglot-send-changes-idle-time 0.5)
:bind (:map eglot-mode-map
("C-c c a" . eglot-code-actions)))
2025-12-14 23:00:58 +11:00
(use-package eglot-booster
2025-12-14 23:46:29 +11:00
:ensure (eglot-booster :type git :host nil :repo "https://github.com/jdtsmith/eglot-booster")
:after eglot
:config (eglot-booster-mode))
2025-12-14 23:00:58 +11:00
(use-package consult-eglot
:after consult eglot
:bind (:map eglot-mode-map
2025-12-14 23:46:29 +11:00
("C-M-." . consult-eglot-symbols))
:config
(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster))
(with-eval-after-load 'eglot
(setq completion-category-defaults nil))
2025-12-14 23:00:58 +11:00
(provide 'init-lsp)