Files
sydnix/users/crumb/programs/emacs/modules/syd-tooling.el
2025-02-19 18:05:59 -07:00

38 lines
1.4 KiB
EmacsLisp

;;; syd-tooling.el -*- lexical-binding: t; -*-
(use-package lsp-mode
:init
;; We'll bind things ourselves.
(setq lsp-keymap-prefix nil)
;; Keep state out of my config dir.
(setq lsp-session-file (file-name-concat syd-data-dir "lsp-session")
;; We disable `lsp-install-server', but I don't want this to be nil.
lsp-server-install-dir (file-name-concat syd-data-dir "lsp"))
;; Disable features that have great potential to be slow. LSPs tend to be
;; quite slow compared to non-LSP equivalents.
(setq lsp-enable-folding nil
lsp-enable-text-document-color nil)
;; Reduce unexpected modifications to code
(setq lsp-enable-on-type-formatting nil)
;; Make breadcrumbs opt-in; they're redundant with the modeline and imenu
(setq lsp-headerline-breadcrumb-enable nil)
:hook (lsp-mode . lsp-enable-which-key-integration)
:commands lsp
:config
(syd-defadvice syd-lsp-install-server-a ()
"Override and disbale `lsp-install-server'"
:override #'lsp-install-server
(user-error (concat "Ignoring a call to `lsp-install-server'"
" — tell the caller to use Nix!")))
(set-popup-rule! (rx line-start "*lsp-" (or "help" "install"))
:size 0.35 :quit t :select nil))
(use-package envrc
;; REVIEW: Can we load this any later/better?
:hook (on-first-file . envrc-global-mode)
:config
(set-popup-rule! (rx "*envrc*")
:quit t :ttl 0))
(provide 'syd-tooling)