diff options
author | Franck Cuny <franck.cuny@gmail.com> | 2020-01-13 09:29:34 -0800 |
---|---|---|
committer | Franck Cuny <franck.cuny@gmail.com> | 2020-01-13 09:29:34 -0800 |
commit | e3270cc826cc1d0a64c93b3d317263949ea06902 (patch) | |
tree | 734d8bc8027b8db26b74013b0da9577a2dbe191d /emacs.d/custom/fcuny-prog.el | |
parent | emacs/ui: font size (diff) | |
download | emacs.d-e3270cc826cc1d0a64c93b3d317263949ea06902.tar.gz |
emacs/prog: switch to lsp-mode
Previously I was using the package `eglot` to provide LSP functionality. However, the package uses flymake for it, while my setup in general uses flycheck. Since lsp-mode supports both, I'm switching to ls-mode. I'm moving the code for company to the 'prog' module, so that all things related to general programming is in one location. Since I'm switching to lsp-mode mode primarily for go, I can also delete a bunch of extra functionality that is now provided by lsp-mode.
Diffstat (limited to 'emacs.d/custom/fcuny-prog.el')
-rw-r--r-- | emacs.d/custom/fcuny-prog.el | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/emacs.d/custom/fcuny-prog.el b/emacs.d/custom/fcuny-prog.el index ab7cc05..92dd9c7 100644 --- a/emacs.d/custom/fcuny-prog.el +++ b/emacs.d/custom/fcuny-prog.el @@ -1,9 +1,39 @@ -(use-package eglot +(require 'fcuny-vars) + +(use-package company + :ensure t + :diminish company-mode + + :custom + (company-minimum-prefix-length 2) + (company-tooltip-align-annotations t) + (company-tooltip-limit 12) + (company-idle-delay 1)) + +(use-package lsp-mode + :ensure t + :commands (lsp lsp-deferred) + :hook (go-mode . lsp-deferred) + :custom + (lsp-session-file (expand-file-name "lsp-session-v1" fcuny/path-emacs-var)) + (lsp-enable-snippet nil) + (lsp-prefer-flymake nil)) + +(use-package lsp-ui + :ensure t + :commands lsp-ui-mode + :custom + (lsp-ui-doc-enable t) + (lsp-ui-peek-enable t) + (lsp-ui-sideline-enable t) + (lsp-ui-imenu-enable t) + (lsp-ui-flycheck-enable t)) + +(use-package company-lsp :ensure t + :after company + :commands company-lsp :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)) + (push 'company-lsp company-backends)) (provide 'fcuny-prog) |