;;; init-terraform.el --- Work with Terraform configurations -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

;;; Terraform

(when (maybe-require-package 'terraform-mode)
  (when (maybe-require-package 'company-terraform)
    (after-load 'terraform-mode
      (company-terraform-init))))

(provide 'init-terraform)
;;; init-terraform.el ends here
;;; init-terraform.el ends here

;;; init-terraform.el --- Work with Terraform configurations -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

;;; Terraform

(when (maybe-require-package 'terraform-mode)
  (when (maybe-require-package 'company-terraform)
    (after-load 'terraform-mode
      (company-terraform-init)

      ;; I find formatters based on "reformatter" to be more reliable
      ;; so I redefine `terraform-format-on-save-mode' here.
      (when (maybe-require-package 'reformatter)
        (reformatter-define terraform-format
          :program "terraform" :args '("fmt" "-"))))))

(provide 'init-terraform)
;;; init-terraform.el ends here
;;; init-terraform.el ends here

Use reformatter to redefine terraform-format-on-save-mode
Use reformatter to redefine terraform-format-on-save-mode

gsmlg/emacs.d,krzysz00/emacs.d,sgarciac/emacs.d,dcorking/emacs.d,baohaojun/emacs.d,qianwan/emacs.d,purcell/emacs.d,emuio/emacs.d,braveoyster/emacs.d,svenyurgensson/emacs.d,blueseason/emacs.d,blueabysm/emacs.d,arthurl/emacs.d,lust4life/emacs.d