From 43c1ca770e23b335400fb8864bc5769aa02d023a Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 23 Dec 2019 16:17:09 -0800 Subject: emacs: use eglot for LSP I'm giving LSP a try with go, and I've decided to go with eglot for now, instead of lsp-mode. I gave a try to lsp-mode and the configuration was not obvious, it was slow, it kept asking questions, and the UI was pretty awful. --- emacs.d/custom/fcuny-prog.el | 9 +++++++++ emacs.d/init.el | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 emacs.d/custom/fcuny-prog.el diff --git a/emacs.d/custom/fcuny-prog.el b/emacs.d/custom/fcuny-prog.el new file mode 100644 index 0000000..ab7cc05 --- /dev/null +++ b/emacs.d/custom/fcuny-prog.el @@ -0,0 +1,9 @@ +(use-package eglot + :ensure t + :config + (define-key eglot-mode-map (kbd "C-c ; g .") 'xref-find-definitions) + (define-key eglot-mode-map (kbd "C-c ; g ,") 'pop-tag-mark) + (add-to-list 'eglot-server-programs '(go-mode . ("gopls"))) + (add-hook 'go-mode-hook 'eglot-ensure)) + +(provide 'fcuny-prog) diff --git a/emacs.d/init.el b/emacs.d/init.el index 4c3cd59..64b464a 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -34,6 +34,8 @@ (require 'fcuny-org) +(require 'fcuny-prog) + (require 'fcuny-docker) (require 'fcuny-json) (require 'fcuny-protobuf) -- cgit 1.4.1