Lot of optimisation, replace eglot with lsp-mode

This commit is contained in:
Zelong Kuang
2026-03-30 11:49:18 +11:00
parent e1374b0e88
commit a3468b833e
24 changed files with 311 additions and 179 deletions

View File

@@ -3,20 +3,19 @@
(use-package typst-ts-mode
:straight (:type git :host codeberg :repo "meow_king/typst-ts-mode")
:hook (typst-ts-mode . eglot-ensure)
:custom
;; (typst-ts-watch-options "--open")
(typst-ts-mode-grammar-location (expand-file-name "tree-sitter/libtree-sitter-typst.so" user-emacs-directory))
(typst-ts-mode-enable-raw-blocks-highlight t)
:config
(keymap-set typst-ts-mode-map "C-c C-c" #'typst-ts-tmenu)
(with-eval-after-load 'eglot
(with-eval-after-load 'typst-ts-mode
(add-to-list 'eglot-server-programs
`((typst-ts-mode) .
,(eglot-alternatives `(,typst-ts-lsp-download-path
"tinymist"
"typst-lsp"))))))
;; (with-eval-after-load 'eglot
;; (with-eval-after-load 'typst-ts-mode
;; (add-to-list 'eglot-server-programs
;; `((typst-ts-mode) .
;; ,(eglot-alternatives `(,typst-ts-lsp-download-path
;; "tinymist"
;; "typst-lsp"))))))
(setq typst-ts-preview-function 'find-file-other-window))
(use-package typst-preview