Files
.emacs.d/modules/languages/siren-jsonnet.el
Jim Myhrberg 4ea4f6dc95 chore(completion): remove needless company-mode references
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.
2022-03-14 11:58:47 +00:00

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