Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Nifty HCL Tools: .tf and .hcl Language SupportNew to Visual Studio Code? Get it now.
Nifty HCL Tools: .tf and .hcl Language Support

Nifty HCL Tools: .tf and .hcl Language Support

Nifty

|
2 installs
| (0) | Free
Fast, lightweight Terraform and OpenTofu support: highlighting, outline, go to definition and references across a module, hovers, completion, undefined-reference errors and formatting.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Nifty HCL Tools

Fast, lightweight Terraform and OpenTofu support: highlighting, outline, go to definition and references across a module, hovers, completion, undefined-reference errors and formatting.

Maintained. No sign-in. No telemetry. Works in VS Code, Cursor, Windsurf, VSCodium and other editors that use Open VSX.

Features

Hover on var.instance_type: its type, default and description, with reference counts above each block

A misspelled variable flagged before tofu plan: No variable var.alert_emial in this module

Find All References from a variable declaration

  • Fast and light. No language server to download and nothing running in the background, so it opens instantly even in large repos. Works with Terraform and OpenTofu (.tf, .tofu, .tfvars) and plain .hcl files.
  • Highlighting for blocks, labels, attributes, functions, references, strings with ${…} interpolation and heredocs.
  • Go to Definition across the module. Ctrl+click var.region, local.name, module.network, data.aws_iam_policy_document.read or aws_s3_bucket.logs to jump to its declaration, in whichever .tf file of the folder it lives.
  • Find All References from a variable, resource, data source, module or local, with a reference count above each block. Unused variables stand out at "0 references".
  • Hover over var.x for its type, default and description, over local.x for its value, and over a resource, data source or module for its declaration and source.
  • Completion after var., local., module., data. and a resource type, from the module's own declarations.
  • Undefined references are marked as errors (No variable var.missing in this module.) as you type, before you run plan.
  • Outline and breadcrumbs list every block, with locals entries nested.
  • Format Document runs tofu fmt or terraform fmt if one is on your PATH, or the program you set.
  • Works in the browser on vscode.dev and github.dev; formatting with tofu fmt or terraform fmt needs the desktop app.

Settings

Setting Default What it does
nifty.hcl.validateReferences true Report references to variables, locals, modules, data sources and resources that don't exist
nifty.hcl.referenceCodeLens true Show reference counts above blocks
nifty.hcl.formatter auto auto (tofu, then terraform), tofu, terraform, or a full path

A module is the set of .tf files in one folder, as in Terraform itself. Provider schemas (resource attribute names) aren't included. For those, use this alongside the official extension, or on its own when you want speed.

Terraform is a trademark of HashiCorp. This extension isn't affiliated with or endorsed by HashiCorp or the OpenTofu project.

Install

  • VS Code: search for "Nifty HCL Tools" in the Extensions view, or install from the Visual Studio Marketplace.
  • Cursor, Windsurf, VSCodium, Kiro, Antigravity: install from Open VSX.

Privacy

This extension collects no telemetry and needs no account.

More Nifty tools

  • Nifty Nginx: nginx.conf Formatting & IntelliSense: nginx config support: syntax highlighting, formatting, directive completion and docs on hover, context checks, and snippets for reverse proxies, SSL and PHP. (Open VSX)
  • Nifty TOML: Format, Validate & Schemas: TOML support: highlighting, errors, a formatter that keeps comments, outline, folding, and JSON Schema validation, completion and hover (Cargo.toml, pyproject.toml via SchemaStore). TOML to JSON/YAML. (Open VSX)
  • Nifty XML: XPath, Formatter & XML to JSON: Evaluate XPath with namespaces, copy the XPath of any element, format, minify, check well-formedness and convert XML to JSON. (Open VSX)
  • Nifty YAML: Formatter, Validator & Converter: Format YAML without losing comments (Kubernetes-style indents), sort keys, lint with yamllint, copy the key path, and convert to and from JSON. (Open VSX)
  • Nifty Helm & Kustomize: Values IntelliSense: Helm .Values IntelliSense (completion, hover, go to definition, missing values) and Kustomize navigation, checks with quick fixes, an overlay tree, patch target hovers, build previews and diffs. (Open VSX)
  • Nifty JSON Schema: Validate with Draft 2020-12 & 2019-09: Validate JSON, JSONC and YAML against JSON Schema 2020-12, 2019-09, draft-07, 06 and 04, with precise errors, hover, completion, SchemaStore lookup and schema generation. (Open VSX)

See all 100+ Nifty extensions and web tools at https://getnifty.dev

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft