feat(emacs): Basic LSP
Includes basic Nix-mode config for the sake of testing the LSP.
This commit is contained in:
8
users/crumb/programs/emacs/modules/lang/syd-lang-nix.el
Normal file
8
users/crumb/programs/emacs/modules/lang/syd-lang-nix.el
Normal file
@@ -0,0 +1,8 @@
|
||||
;;; syd-lang-nix.el -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package nix-mode
|
||||
:mode "\\.nix\\'"
|
||||
:config
|
||||
(add-hook 'nix-mode-hook #'lsp))
|
||||
|
||||
(provide 'syd-lang-nix)
|
||||
@@ -2,5 +2,6 @@
|
||||
(file-name-concat user-emacs-directory "modules" "lang"))
|
||||
|
||||
(require 'syd-lang-emacs-lisp)
|
||||
(require 'syd-lang-nix)
|
||||
|
||||
(provide 'syd-lang)
|
||||
|
||||
30
users/crumb/programs/emacs/modules/syd-tooling.el
Normal file
30
users/crumb/programs/emacs/modules/syd-tooling.el
Normal file
@@ -0,0 +1,30 @@
|
||||
;;; 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))
|
||||
|
||||
(provide 'syd-tooling)
|
||||
Reference in New Issue
Block a user