Skip to content
Vim plugin for hclfmt
Vim script
Branch: master
Clone or download
Pull request Compare This branch is even with ntk1000:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Vim plugin to format Hashicorp Configuration Language (HCL) files, using terraform fmt itself.

The plugin by default will format *.hcl, *.tf and *.nomad files on save. Under the hood it uses hclfmt to process the files.



Save the file or call :HclFmt2.

By default vim-hclfmt automatically formats *.hcl, *.tf and *.nomad files. You can permanently set this configuration in your ~/.vimrc as follows:

let g:hcl_fmt_autosave = 0
let g:tf_fmt_autosave = 0
let g:nomad_fmt_autosave = 0


Vim-hclfmt follows the standard runtime path structure. For Pathogen just clone the repo. For other plugin managers add the appropriate lines and execute the plugin's install command.

  • Pathogen
  • git clone ~/.vim/bundle/vim-hclfmt
  • vim-plug
  • Plug 'fatih/vim-hclfmt'
  • NeoBundle
  • NeoBundle 'fatih/vim-hclfmt'
  • Vundle
  • Plugin 'fatih/vim-hclfmt'
You can’t perform that action at this time.