spacemacs/layers/+tools/terraform
2021-06-06 22:26:31 +02:00
..
img
config.el terraform: refactor 2021-04-04 12:48:21 +02:00
funcs.el Defer loading of lsp servers up to when the buffer is visible 2021-06-06 22:26:31 +02:00
layers.el Apply GPLv3 terms explicitly to all elisp files 2021-03-25 22:59:32 -04:00
packages.el Apply GPLv3 terms explicitly to all elisp files 2021-03-25 22:59:32 -04:00
README.org

Terraform layer

/TakeV/spacemacs/media/commit/b8f471dc1ca0fa87d48dd1060ab75fd220da1e2e/layers/+tools/terraform/img/terraform.png

Description

This layer provides basic support for Terraform .tf files.

Features:

  • Basic syntax highlighting via terraform-mode
  • Auto formatting on save via terraform fmt
  • LSP support for terraform-lsp via terraform-backend

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add terraform to the existing dotspacemacs-configuration-layers list in this file.

You will also need a working native terraform installation on your system.

Configuration

Auto-format on save

If you want terraform fmt to be applied automatically on save then set the layer variable terraform-auto-format-on-save to t:

  (terraform :variables terraform-auto-format-on-save t)

LSP

To enable LSP, install terraform-lsp. Then set the layer variable terraform-backend to 'lsp like shown below:

  (terraform :variables terraform-backend 'lsp)

Alternatively you can also keep the variable on nil, then lsp will be used if lsp layer is loaded.