spacemacs/layers/+tools/terraform
2020-06-22 20:15:12 +02:00
..
img
config.el [terraform] Add LSP support for terraform-lsp 2020-06-22 20:15:12 +02:00
funcs.el [terraform] Add LSP support for terraform-lsp 2020-06-22 20:15:12 +02:00
layers.el [terraform] Add LSP support for terraform-lsp 2020-06-22 20:15:12 +02:00
packages.el [terraform] Add LSP support for terraform-lsp 2020-06-22 20:15:12 +02:00
README.org [terraform] Add LSP support for terraform-lsp 2020-06-22 20:15:12 +02:00

Terraform layer

/TakeV/spacemacs/media/commit/05bc20d8063c5ed5cb115b1f07c60d45c231a0f6/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.

And set the layer variable terraform-backend to 'lsp like shown below:

  (terraform :variables terraform-backend 'lsp)