mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
Both cause annoyances and freezes, to the point they're generally not worth using right now.
57 lines
1.5 KiB
EmacsLisp
57 lines
1.5 KiB
EmacsLisp
;;; siren-terraform.el --- jimeh's Emacs Siren: terraform-mode configuration.
|
|
|
|
;;; Commentary:
|
|
|
|
;; Basic configuration for terraform-mode.
|
|
|
|
;;; Code:
|
|
|
|
(require 'siren-lsp)
|
|
(require 'siren-reformatter)
|
|
|
|
(use-package terraform-mode
|
|
:hook
|
|
(terraform-mode . siren-terraform-mode-setup)
|
|
|
|
:custom
|
|
(terraform-indent-level 2)
|
|
|
|
:preface
|
|
(defun siren-terraform-mode-setup ()
|
|
(setq-local tab-width 2)
|
|
(terraform-format-on-save-mode t))
|
|
|
|
:config
|
|
;; This does a better job of injecting formatted content than the default
|
|
;; formatting commands included with terraform-mode.
|
|
(reformatter-define terraform-format
|
|
:program "terraform"
|
|
:args '("fmt" "-no-color" "-")
|
|
:lighter " fmt"))
|
|
|
|
(use-package lsp-terraform
|
|
:straight lsp-mode
|
|
:hook
|
|
(terraform-mode . siren-lsp-terraform-mode-setup)
|
|
|
|
:preface
|
|
(defun siren-lsp-terraform-mode-setup ()
|
|
;; TODO: Re-evaluate lsp-mode for Terraform at some point in the future.
|
|
;; Currently it mostly just gets in the way and causes enough annoyance that
|
|
;; it's not worth using by default.
|
|
|
|
;; Disable semantic tokens as it typically causes an annoying delay with the
|
|
;; syntax highlighting as you type. Essentially all new text is a very faded
|
|
;; out grey color for the first 1-2 seconds as you type.
|
|
;; (setq-local lsp-semantic-tokens-enable nil)
|
|
|
|
;; (lsp-format-buffer-on-save-mode t)
|
|
;; (lsp-deferred)
|
|
))
|
|
|
|
(use-package terraform-doc
|
|
:defer t)
|
|
|
|
(provide 'siren-terraform)
|
|
;;; siren-terraform.el ends here
|