diff --git a/init.el b/init.el index 0397e9d..2fd2237 100644 --- a/init.el +++ b/init.el @@ -118,6 +118,7 @@ If freezing sometimes, decrease it. If stuttering, increase it.") (require 'init-which-key) (require 'init-editorconfig) (require 'init-typescript) +(require 'init-eglot) (setq custom-file (expand-file-name "custom.el" creature/cache-dir)) diff --git a/lisp/init-eglot.el b/lisp/init-eglot.el new file mode 100644 index 0000000..1010c5f --- /dev/null +++ b/lisp/init-eglot.el @@ -0,0 +1,21 @@ +;; -*- coding: utf-8; lexical-binding: t; -*- + +(require 'lazy-load) + +(with-eval-after-load 'eglot + (setq eglot-events-buffer-size 0) + (setq eglot-confirm-server-initiated-edits nil) + (setq eglot-autoshutdown t) + + (lazy-load-set-keys + '(("M-." . xref-find-definitions) + ("M-?" . xref-find-references) + ("C-c r" . eglot-rename) + ("C-c o" . eglot-code-actions)) + eglot-mode-map)) + +(dolist (hook '(css-mode-hook js-mode-hook typescript-mode-hook)) + (add-hook hook #'eglot-ensure)) + + +(provide 'init-eglot)