GithubHelp home page GithubHelp logo

rsiwal / vim-terraform Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hashivim/vim-terraform

0.0 0.0 0.0 385 KB

basic vim/terraform integration

Home Page: http://hashivim.github.io/vim-terraform

License: ISC License

Ruby 9.93% Vim Script 75.51% Shell 9.61% Makefile 4.95%

vim-terraform's Introduction

Call For Maintainers

This plugin, along with others like it, is now maintained by the HashiVim organization, which is looking for additional maintainers and contributors. See the HashiVim home page for further information.


Overview: vim-terraform

This plugin adds a :Terraform command that runs terraform, with tab completion of subcommands. It also sets up *.tf, *.tfvars, .terraformrc and terraform.rc files to be highlighted as HCL and *.tfstate as JSON.


Installation

With Vim 8 packages:

git clone https://github.com/hashivim/vim-terraform.git ~/.vim/pack/plugins/start/vim-terraform

With Pathogen:

git clone https://github.com/hashivim/vim-terraform.git ~/.vim/bundle/vim-terraform

With Vundle, add the following to ~/.vimrc:

Plugin 'hashivim/vim-terraform'

Usage

Allow vim-terraform to align settings automatically with Tabularize.

let g:terraform_align=1

Allow vim-terraform to automatically fold (hide until unfolded) sections of terraform code. Defaults to 0 which is off.

let g:terraform_fold_sections=1

Allow vim-terraform to automatically format *.tf and *.tfvars files with terraform fmt. You can also do this manually with the :TerraformFmt command.

let g:terraform_fmt_on_save=1

Allow vim-terraform to use a custom path for the terraform binary. Defaults to terraform (found in $PATH)

let g:terraform_binary_path="/usr/local/Cellar/terraform/0.13.5/bin/terraform"

Use with other HCL files

This is a terraform plugin, with terraform-specific features. However, some users have reported that it also works well for other files that use the Hashicorp Configuration Language.

If you want to use this plugin for non-terraform files, the simplest way is to teach vim to treat them as terraform. For example to use this plugin for files with suffix .hcl, put the following in ~/.vim/ftdetect/terraform.vim:

autocmd BufRead,BufNewFile *.hcl set filetype=terraform

Updating vim-terraform

Note, this is only for maintainers of the vim-terraform project.

When a new version of Terraform drops, you can run the following where x.x.x is a version such as 0.11.11

./update_automagic.sh x.x.x

At this point, add the modified files to a git branch and open a pull request.

git checkout -b "feature/update-to-terraform-$VERSION"
git add $FILE
git commit -m "Message about update"
git push

Add another maintainer to the pull request and await confirmation.


Running tests

To run the test suite and verify functionality

make

Credits

Syntax highlighting and indentation by Kevin Le (@bkad) based on prior work by Larry Gilbert (@L2G). The rest originally written by Mark Cornick https://www.markcornick.com/ and contributors listed below. Licensed under the ISC license.

Thanks to the following contributors:

  • michael j talarczyk (@mijit)
  • Koji Nakayama (@knakayama)
  • Kris (@kostecky)
  • Okumura Takahiro (@hfm)
  • Paul Forman (@pforman)
  • Lowe Schmidt (@lsc)
  • Mario Kozjak (@mkozjak)

The :TerraformFmt command is adapted from vim-hclfmt.

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

vim-terraform's People

Contributors

pgporada avatar dimbleby avatar mcornick avatar mcrmonkey avatar ashb avatar loicgombeaud avatar mkozjak avatar minamijoyo avatar ojford avatar michaelpotter avatar knakayama avatar rkennedy avatar imkira avatar mandos avatar talarczykco avatar tgyurci avatar tmichel avatar stephenpaulger avatar hoelzro avatar padde avatar orlando avatar natw avatar moofish32 avatar lsc avatar kostecky avatar kesoji avatar esc avatar dougneal avatar dabio avatar dekimsey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.