Files
.emacs.d/modules/languages/siren-terraform.el
Jim Myhrberg bee04d384c docs(comment): Explain why we use reformatter for terraform-mode
Terraform-mode already comes with it's own
terraform-format-on-save-mode, but the way it inserts the corrected
source into the buffer often causes weird cursor movement which is
annoying.
2020-06-01 09:06:55 +01:00

41 lines
889 B
EmacsLisp

;;; siren-terraform.el --- jimeh's Emacs Siren: terraform-mode configuration.
;;; Commentary:
;; Basic configuration for terraform-mode.
;;; Code:
(require 'siren-reformatter)
(use-package terraform-mode
:hook
(terraform-mode . siren-terraform-mode-setup)
:custom
(terraform-indent-level 2)
:init
(defun siren-terraform-mode-setup ()
(setq tab-width 2)
(terraform-format-on-save-mode 1))
: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 " TF"))
(use-package company-terraform
:init
(with-eval-after-load 'terraform-mode
(company-terraform-init)))
(use-package terraform-doc
:defer t)
(provide 'siren-terraform)
;;; siren-terraform.el ends here