dotfiles/emacs/emacs.legacy/custom/lsp.el
2021-12-31 17:51:23 -05:00

31 lines
764 B
EmacsLisp

(use-package lsp-mode
:after (treemacs)
:init
(setq lsp-keymap-prefix "C-c l")
:hook (
;; (python-mode . lsp)
(lsp-mode . lsp-enable-which-key-integration))
:config
(setq lsp-enable-snippet nil)
:defer
(lsp-treemacs-sync-mode 1)
:commands lsp)
(use-package lsp-ui
:commands lsp-ui-mode)
(use-package lsp-pyright
:ensure t
:hook (python-mode . (lambda ()
(require 'lsp-pyright)
(lsp))))
(use-package rustic)
(add-hook 'go-mode-hook #'lsp-deferred)
(defun lsp-go-install-save-hooks ()
(add-hook 'before-save-hook #'lsp-format-buffer t t)
(add-hook 'before-save-hook #'lsp-organize-imports t t))
(add-hook 'go-mode-hook #'lsp-go-install-save-hooks)
(provide 'lsp)