mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
Since we enable global-company-mode, explicitly enabling it in the setup for various major modes does nothing. But it does tie the code to company mode, making it harder to try alternatives like corfu.
41 lines
1.1 KiB
EmacsLisp
41 lines
1.1 KiB
EmacsLisp
;;; siren-jsonnet.el --- jimeh's Emacs Siren: jsonnet-mode configuration.
|
|
|
|
;;; Commentary:
|
|
|
|
;; Basic configuration for jsonnet-mode.
|
|
|
|
;;; Code:
|
|
|
|
(use-package jsonnet-mode
|
|
:bind (:map jsonnet-mode-map
|
|
("C-c C-c" . jsonnet-eval-buffer)
|
|
("C-c C-f" . jsonnet-reformat-buffer)
|
|
("C-c C-j" . jsonnet-jump))
|
|
|
|
:hook
|
|
(jsonnet-mode . siren-jsonnet-mode-setup)
|
|
|
|
:custom
|
|
(jsonnet-library-search-directories '("vendor"))
|
|
|
|
:init
|
|
(defun siren-jsonnet-mode-setup ()
|
|
"Default tweaks for `jsonnet-mode'."
|
|
(jsonnet-format-buffer-on-save-mode t)
|
|
(subword-mode)
|
|
(siren-folding))
|
|
|
|
:config
|
|
(with-eval-after-load 'flycheck
|
|
(setq flycheck-jsonnet-executable "jsonnet -jpath vendor"))
|
|
|
|
(define-minor-mode jsonnet-format-buffer-on-save-mode
|
|
"Run jsonnet-format-buffer as a before-save-hook."
|
|
:lighter " fmt"
|
|
(if jsonnet-format-buffer-on-save-mode
|
|
(add-hook 'before-save-hook 'jsonnet-reformat-buffer t t)
|
|
(remove-hook 'before-save-hook 'jsonnet-reformat-buffer t))))
|
|
|
|
(provide 'siren-jsonnet)
|
|
;;; siren-js.el ends here
|