Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Terraform
  3. Emacs terraform-mode

Emacs terraform-mode

GPL-3.0Emacs Lisp1.1.0

An Emacs major mode for editing Terraform configuration files with syntax highlighting, indentation, and formatting.

GitHubGitHub
240 stars34 forks0 contributors

What is Emacs terraform-mode?

terraform-mode.el is an Emacs major mode for editing Terraform configuration files. It provides syntax highlighting, indentation, block folding, and integration with Terraform's formatting tool to streamline Infrastructure as Code development within Emacs.

Target Audience

Emacs users who work with Terraform for infrastructure provisioning and management, particularly DevOps engineers and system administrators who prefer Emacs as their primary editor.

Value Proposition

It offers a specialized, feature-rich editing environment for Terraform within Emacs, reducing the need to switch to external tools and enhancing productivity with built-in formatting, documentation access, and navigation features.

Overview

Major mode of Terraform configuration file

Use Cases

Best For

  • Editing Terraform configuration files in Emacs
  • Automatically formatting Terraform code on save
  • Navigating large Terraform projects with imenu
  • Folding and unfolding resource blocks for better code organization
  • Quickly accessing Terraform resource documentation
  • Customizing indentation levels for Terraform code

Not Ideal For

  • Projects where developers use IDEs like VSCode or IntelliJ with dedicated Terraform plugins
  • Teams requiring graphical user interfaces for Terraform visualization or integrated debugging tools
  • Environments where Terraform CLI is not installed or network access for `terraform providers` is restricted
  • Users who prefer editors with minimal configuration and no need to set up Emacs hooks or modes

Pros & Cons

Pros

Syntax Highlighting

Provides rich syntax highlighting for Terraform keywords, strings, and blocks, inheriting from hcl-mode for accurate parsing and improved readability.

Auto-Formatting Integration

Integrates with `terraform fmt` to automatically format code, with an option to enable formatting on save via `terraform-format-on-save` for consistent styling.

Quick Documentation Access

Offers keyboard shortcuts to open Terraform resource documentation in a browser or copy URLs, speeding up development with direct access to official docs.

Block Folding Support

Supports folding resource blocks using outline-mode, allowing for focused editing and better code organization, though it requires manual setup in hooks.

Imenu Navigation

Enables easy navigation through Terraform files using imenu, making it simple to jump between resources and data blocks for large projects.

Cons

Dependent on Terraform CLI

Features like documentation access require a working `terraform providers` command, which can fail without proper tokens or network access, adding external dependencies.

Emacs-Only Limitation

Exclusively for Emacs users, offering no cross-editor compatibility and limiting collaboration in mixed-tool environments where others use different IDEs.

Setup Overhead

Requires manual configuration, such as enabling outline-minor-mode in hooks for block folding, which can be cumbersome and non-intuitive for new Emacs users.

No Advanced IDE Features

Lacks modern IDE features like LSP support, autocompletion, or real-time error checking, making it less feature-rich compared to dedicated Terraform extensions in other editors.

Frequently Asked Questions

Quick Stats

Stars240
Forks34
Contributors0
Open Issues8
Last commit8 months ago
CreatedSince 2014

Tags

#emacs#devops#syntax-highlighting#editor-plugin#hcl#terraform#infrastructure-as-code#code-formatting#configuration-management

Built With

E
Emacs Lisp

Included in

Terraform6.3k
Auto-fetched 2 hours ago

Related Projects

Terraform-lsTerraform-ls

Terraform Language Server

Stars1,193
Forks153
Last commit3 days ago
Vim-TerraformVim-Terraform

basic vim/terraform integration

Stars1,109
Forks111
Last commit1 year ago
Terraform-lspTerraform-lsp

Language Server Protocol for Terraform

Stars589
Forks36
Last commit3 years ago
Vim-Terraform-CompletionVim-Terraform-Completion

A (Neo)Vim Autocompletion and linter for Terraform, a HashiCorp tool

Stars339
Forks24
Last commit4 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub