This commit is contained in:
Zelong Kuang
2026-04-08 15:25:39 +10:00
parent 14ecd3b17a
commit 3490e9daa9
12 changed files with 72 additions and 70 deletions

View File

@@ -1,22 +1,17 @@
;; -*- lexical-binding: t;-*-
(use-package typst-ts-mode
:ensure (:type git :host codeberg :repo "meow_king/typst-ts-mode")
:hook (typst-ts-mode . lsp-deferred)
: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
;; (typst-ts-watch-options "--open")
(setq typst-ts-mode-grammar-location (expand-file-name "tree-sitter/libtree-sitter-typst.so" user-emacs-directory))
(setq typst-ts-mode-enable-raw-blocks-highlight t)
(keymap-set typst-ts-mode-map "C-c C-c" #'typst-ts-tmenu)
(setq typst-ts-preview-function 'find-file-other-window))
(use-package typst-preview
:ensure (:type git :host github :repo "havarddj/typst-preview.el")
:init
(setq typst-preview-autostart t) ; start preview automatically when typst-preview-mode is activated
(setq typst-preview-open-browser-automatically t) ; open browser automatically when typst-preview-start is run
:custom
(typst-preview-browser "default") ; this is the default option; other options are `eaf-browser' or `xwidget'.
@@ -25,6 +20,8 @@
(typst-preview-partial-rendering t) ; enable partial rendering
:config
(setq typst-preview-autostart t) ; start preview automatically when typst-preview-mode is activated
(setq typst-preview-open-browser-automatically t) ; open browser automatically when typst-preview-start is run
(define-key typst-ts-mode-map (kbd "C-c C-j") 'typst-preview-send-position)
(define-key typst-ts-mode-map (kbd "C-c C-l") #'typst-preview-mode))