back to lsp mode, i can't get eglot configured correctly

This commit is contained in:
Matt Nish-Lapidus 2025-07-02 11:39:45 -04:00
parent 75ef779bfe
commit 67ec5b1c18
3 changed files with 33 additions and 72 deletions

102
config.el
View file

@ -21,7 +21,6 @@
(custom-set-faces (custom-set-faces
'(default ((t (:background "#111111")))) '(default ((t (:background "#111111"))))
'(hl-line ((t (:background "#222222")))) '(hl-line ((t (:background "#222222"))))
;; '(solair-default-face ((t (:background "#111111"))))
'(cursor ((t (:background "#FCFCFA" :foreground "black")))) '(cursor ((t (:background "#FCFCFA" :foreground "black"))))
'(line-number ((t (:foreground "#424242")))) '(line-number ((t (:foreground "#424242"))))
'(mu4e-highlight-face ((t (:inherit nil :background "gray26" :foreground "gray85"))))) '(mu4e-highlight-face ((t (:inherit nil :background "gray26" :foreground "gray85")))))
@ -66,18 +65,12 @@
;; Modeline ;; Modeline
;; - add current workspace name ;; - add current workspace name
; - add major mode icon ;; - add major mode icon
(after! doom-modeline (after! doom-modeline
(setq doom-modeline-persp-name t (setq doom-modeline-persp-name t
doom-modeline-major-mode-icon t) doom-modeline-major-mode-icon t)
(setq doom-modeline-total-line-number t)) (setq doom-modeline-total-line-number t))
(defun +default/insert-snippet ()
(interactive)
(cond ((modulep! :completion vertico)
(call-interactively #'consult-yasnippet))
(t (call-interactively #'yas-insert-snippet))))
;; some global settings ;; some global settings
(setq shell-file-name (executable-find "bash")) (setq shell-file-name (executable-find "bash"))
(setq dired-vc-rename-file t) ; renaming and changing files in dired now integrates with magit (setq dired-vc-rename-file t) ; renaming and changing files in dired now integrates with magit
@ -87,7 +80,7 @@
;; reduce which-key waiting ;; reduce which-key waiting
(after! which-key (after! which-key
(setq which-key-idle-delay 0.3)) (setq which-key-idle-delay 0.2))
;; some defaults for cursor size, scrolling, and buffer handling ;; some defaults for cursor size, scrolling, and buffer handling
(setq x-stretch-cursor t (setq x-stretch-cursor t
@ -136,7 +129,6 @@
(setq css-fontify-colors nil)) (setq css-fontify-colors nil))
;; web-mode settings ;; web-mode settings
;; (add-hook! web-mode (web-mode-toggle-current-element-highlight))
(after! web-mode (after! web-mode
(setq web-mode-enable-css-colorization nil) (setq web-mode-enable-css-colorization nil)
(setq web-mode-markup-indent-offset 2) (setq web-mode-markup-indent-offset 2)
@ -157,27 +149,22 @@
(setq projectile-enable-caching t) (setq projectile-enable-caching t)
(setq projectile-indexing-method 'hybrid) (setq projectile-indexing-method 'hybrid)
(setq projectile-project-search-path '(("~/projects" . 4) ("~/source" . 2) ("~/music" . 3))) (setq projectile-project-search-path '(("~/projects" . 4) ("~/source" . 2) ("~/music" . 3)))
(setq projectile-globally-ignored-buffers
'("*scratch*"
"*lsp-log*"))
(add-to-list 'projectile-globally-ignored-directories "~/Music/_samples")) (add-to-list 'projectile-globally-ignored-directories "~/Music/_samples"))
;; projectile ignoring buffers by their major mode
(setq projectile-globally-ignored-modes
'("erc-mode"
"help-mode"
"completion-list-mode"
"Buffer-menu-mode"
"gnus-.*-mode"
"occur-mode"))
;; mouse support for vertico buffers ;; mouse support for vertico buffers
(after! vertico (after! vertico
(vertico-mouse-mode)) (vertico-mouse-mode))
;; modes
(use-package! kbd-mode :defer t) (use-package! kbd-mode :defer t)
(setq auto-mode-alist (delete '("\\.svelte\\'" . web-mode) auto-mode-alist))
(add-to-list 'auto-mode-alist '("\\.svelte\\'" . svelte-mode))
(add-to-list 'auto-mode-alist '("\\.vs\\'" . glsl-mode))
(add-to-list 'auto-mode-alist '("\\.fs\\'" . glsl-mode))
(add-to-list 'auto-mode-alist '("\\.ino\\'" . arduino-mode))
(add-to-list 'auto-mode-alist '("\\.ino\\'" . platformio-mode))
(add-to-list 'auto-mode-alist '("\\.lsx\\'" . lisp-mode))
(after! lsp-mode (after! lsp-mode
(setq lsp-signature-render-documentation nil) (setq lsp-signature-render-documentation nil)
@ -244,21 +231,12 @@
(after! lisp-markup (after! lisp-markup
(add-hook! 'lisp-mode 'lisp-markup-minor-mode)) (add-hook! 'lisp-mode 'lisp-markup-minor-mode))
(add-to-list 'auto-mode-alist '("\\.lsx\\'" . lisp-mode))
(after! nix-mode (after! nix-mode
(set-formatter! 'alejandra '("alejandra" "--quiet") :modes '(nix-mode)) (set-formatter! 'alejandra '("alejandra" "--quiet") :modes '(nix-mode))
(setopt lsp-nix-nixd-server-path "nixd" (setopt lsp-nix-nixd-server-path "nixd"
lsp-nix-nixd-formatting-command [ "nixpkgs-alejandra"])) lsp-nix-nixd-formatting-command [ "nixpkgs-alejandra"]))
;; add platformio to ino files
(add-to-list 'auto-mode-alist '("\\.ino\\'" . arduino-mode))
(add-to-list 'auto-mode-alist '("\\.ino\\'" . platformio-mode))
(after! gcode-mode
(add-hook! 'gcode-mode-hook 'eldoc-mode))
;; override aggressive key shortcuts for alt-l/r
(use-package! drag-stuff (use-package! drag-stuff
:defer t) :defer t)
@ -267,14 +245,30 @@
(use-package! eglot-booster (use-package! eglot-booster
:after eglot :after eglot
:config (eglot-booster-mode)) :config
(eglot-booster-mode))
(after! eglot (after! eglot
(add-to-list 'eglot-server-programs '(svelte-mode . ("svelteserver" "--stdio"))) (add-to-list 'eglot-server-programs '(svelte-mode . ("svelteserver" "--stdio")))
(add-to-list 'eglot-server-programs '(scad-mode . ("openscad-lsp" "--stdio")))) (add-to-list 'eglot-server-programs '(scad-mode . ("openscad-lsp" "--stdio")))
(setq-default eglot-workspace-configuration
'(:nixd (:formatting (:command ["alejandra"])))))
(setq-default eglot-workspace-configuration (use-package! colorful-mode
'(:nixd (:formatting (:command ["alejandra"])))) :custom
(colorful-use-prefix t)
;; (colorful-only-strings 'only-prog)
(css-fontify-colors nil)
:config
(global-colorful-mode t)
(add-to-list 'global-colorful-modes 'helpful-mode)
(add-to-list 'global-colorful-modes 'nix-mode)
(setq css-fontify-colors nil
web-mode-enable-css-colorization nil))
(use-package! magit-todos
:after magit
:config (magit-todos-mode 1))
;; load additional config files ;; load additional config files
(load! "obsidian-config.el") (load! "obsidian-config.el")
@ -290,18 +284,6 @@
(setq delete-active-region t) ; delete selected stuff! (setq delete-active-region t) ; delete selected stuff!
(+global-word-wrap-mode +1) ; default to soft word wrap (+global-word-wrap-mode +1) ; default to soft word wrap
(use-package! colorful-mode
:custom
(colorful-use-prefix t)
;; (colorful-only-strings 'only-prog)
(css-fontify-colors nil)
:config
(global-colorful-mode t)
(add-to-list 'global-colorful-modes 'helpful-mode)
(add-to-list 'global-colorful-modes 'nix-mode)
(setq css-fontify-colors nil
web-mode-enable-css-colorization nil))
(add-hook! 'post-command-hook (add-hook! 'post-command-hook
(lambda () (lambda ()
"delete colorful overlay on active mark" "delete colorful overlay on active mark"
@ -321,25 +303,3 @@
(beg (region-beginning)) (beg (region-beginning))
(end (region-end))) (end (region-end)))
(font-lock-flush beg end)))) (font-lock-flush beg end))))
(use-package! magit-todos
:after magit
:config (magit-todos-mode 1))
(defun +workspaces-associate-frame-fn (frame &optional _new-frame-p)
"Create a blank, new perspective and associate it with FRAME."
(when persp-mode
(with-selected-frame frame
(if (not (cdr-safe (persp-frame-list-without-daemon)))
(+workspace-switch +workspaces-main t)
(+workspace-switch (format "#%s" (+workspace--generate-id)) t))
(unless (doom-real-buffer-p (current-buffer))
(switch-to-buffer (doom-fallback-buffer)))
(set-frame-parameter frame 'workspace (+workspace-current-name))
;; ensure every buffer has a buffer-predicate
(persp-set-frame-buffer-predicate frame))
(run-at-time 0.1 nil #'+workspace/display)))
(add-to-list 'auto-mode-alist '("\\.svelte\\'" . svelte-mode))
(add-to-list 'auto-mode-alist '("\\.vs\\'" . glsl-mode))
(add-to-list 'auto-mode-alist '("\\.fs\\'" . glsl-mode))

View file

@ -72,7 +72,7 @@
ein ; tame Jupyter notebooks with emacs ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls) (eval +overlay) ; run code, run (also, repls)
(lookup +dictionary +offline +docsets) ; navigate your code and its documentation (lookup +dictionary +offline +docsets) ; navigate your code and its documentation
(lsp +eglot) ; M-x vscode (lsp +peak) ; M-x vscode
magit ; a git porcelain for Emacs magit ; a git porcelain for Emacs
make ; run make tasks from Emacs make ; run make tasks from Emacs
pdf ; pdf enhancements pdf ; pdf enhancements

View file

@ -104,3 +104,4 @@
:host github :host github
:repo "axelf4/hotfuzz")) :repo "axelf4/hotfuzz"))
(package! nushell-mode :recipe (:host github :repo "mrkkrp/nushell-mode"))