48 lines
1.4 KiB
EmacsLisp
48 lines
1.4 KiB
EmacsLisp
;;; lsp.el --- Language server protocol. -*- lexical-binding: t; -*-
|
|
;;; Commentary:
|
|
;;; Code: https://github.com/emacs-lsp/lsp-mode
|
|
|
|
(use-package lsp-mode
|
|
:pin "MELPA"
|
|
:defer
|
|
:commands lsp
|
|
:hook ((lsp-after-open-hook . lsp-enable-imenu))
|
|
:config
|
|
(validate-setq
|
|
;; Automatically try to figure out project root.
|
|
lsp-auto-guess-root t
|
|
;; Location of persistent LSP session.
|
|
lsp-session-file (path-join *user-cache-directory* "lsp-session")
|
|
;; Disable yasnippet integration.
|
|
lsp-enable-snippet nil
|
|
;; Don't watch files for changes, prevents freeze during compilation.
|
|
lsp-enable-file-watchers nil
|
|
;; Disable headerline
|
|
lsp-headerline-breadcrumb-enable nil
|
|
;; Increase the amount of data that can be read from a language server.
|
|
read-process-output-max (* 3 1024 1024))
|
|
|
|
;; https://github.com/emacs-lsp/lsp-ui/
|
|
;; This package contains all the higher level UI modules of lsp-mode, like flycheck support and code lenses.
|
|
(use-package lsp-ui
|
|
:hook (lsp-mode-hook . lsp-ui-mode)
|
|
:config
|
|
;; https://emacs-lsp.github.io/lsp-mode/tutorials/how-to-turn-off/
|
|
(validate-setq
|
|
lsp-modeline-code-actions-enable nil
|
|
lsp-ui-sideline-enable nil
|
|
lsp-ui-doc-delay 3
|
|
lsp-ui-doc-position 'bottom))
|
|
|
|
(use-package lsp-treemacs
|
|
:ensure t
|
|
:defer t
|
|
;; :after (lsp treemacs)
|
|
:custom
|
|
(lsp-treemacs-sync-mode 1)
|
|
)
|
|
)
|
|
|
|
(provide 'utilities/lsp)
|
|
;;; lsp.el ends here
|