Skip to content

Instantly share code, notes, and snippets.

@MasWag
Created March 16, 2025 13:35
Show Gist options
  • Save MasWag/ba3f2a39aadb91ac54f9a64d2e190818 to your computer and use it in GitHub Desktop.
Save MasWag/ba3f2a39aadb91ac54f9a64d2e190818 to your computer and use it in GitHub Desktop.
(leaf satysfi
:mode (("\\.saty$" . satysfi-mode)
("\\.satyh$" . satysfi-mode)
("\\.satyg$" . satysfi-mode))
:hook (satysfi-mode-hook . lsp)
:config
(cond ((equal system-type 'darwin)
(setq satysfi-pdf-viewer-command "open -a Skim"
satysfi-command "opam exec satysfi"))
((equal system-type 'gnu/linux)
(setq satysfi-pdf-viewer-command "/usr/bin/evince"
satysfi-command "opam exec satysfi")))
;; LSP
(leaf lsp-mode
:ensure t
:commands (lsp lsp-deferred)
:require lsp
:config
(add-to-list 'lsp-language-id-configuration '(satysfi-mode . "satysfi-ls"))
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection '("~/.cargo/bin/satysfi-language-server"))
:major-modes '(satysfi-mode)
:priority 0
:activation-fn (lsp-activate-on "satysfi-ls")
:server-id 'satysfi-ls)))
;; completion with company
(leaf company
:ensure t
:hook
(satysfi-mode . company-mode)
:config
(setq lsp-completion-provider :capf)
(setq company-minimum-prefix-length 1))
;; We use lsp for completion
(push 'company-capf company-backends))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment