All Projects → juliosueiras → Vim Terraform Completion

juliosueiras / Vim Terraform Completion

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

Projects that are alternatives of or similar to Vim Terraform Completion

Provisioning
Kubernetes cluster provisioning using Terraform.
Stars: ✭ 277 (-1.07%)
Mutual labels:  terraform, hcl
Ale Sensible
Pretty, responsive and smooth defaults for a sane ALE, gets you started in 30 seconds
Stars: ✭ 30 (-89.29%)
Mutual labels:  linter, neovim
Terraform Aws Tfstate Backend
Terraform module that provision an S3 bucket to store the `terraform.tfstate` file and a DynamoDB table to lock the state file to prevent concurrent modifications and state corruption.
Stars: ✭ 229 (-18.21%)
Mutual labels:  terraform, hcl
Terraform Aws Elastic Beanstalk Environment
Terraform module to provision an AWS Elastic Beanstalk Environment
Stars: ✭ 211 (-24.64%)
Mutual labels:  terraform, hcl
nvim-lsp-compl
A fast and asynchronous auto-completion plugin for Neovim >= 0.5, focused on LSP.
Stars: ✭ 46 (-83.57%)
Mutual labels:  autocompletion, neovim
Terraform Aws Ecs Container Definition
Terraform module to generate well-formed JSON documents (container definitions) that are passed to the aws_ecs_task_definition Terraform resource
Stars: ✭ 217 (-22.5%)
Mutual labels:  terraform, hcl
Jupyterlab Lsp
Coding assistance for JupyterLab (code navigation + hover suggestions + linters + autocompletion + rename) using Language Server Protocol
Stars: ✭ 796 (+184.29%)
Mutual labels:  linter, autocompletion
Terraform Fargate Example
Example repository to run an ECS cluster on Fargate
Stars: ✭ 206 (-26.43%)
Mutual labels:  terraform, hcl
stein
A linter for config files with a customizable rule set
Stars: ✭ 92 (-67.14%)
Mutual labels:  linter, hcl
Neomake
Asynchronous linting and make framework for Neovim/Vim
Stars: ✭ 2,512 (+797.14%)
Mutual labels:  linter, neovim
Terraform Website S3 Cloudfront Route53
Terraform scripts to setup an S3 based static website, with a CloudFront distribution and the required Route53 entries.
Stars: ✭ 210 (-25%)
Mutual labels:  terraform, hcl
Cloudblock
Cloudblock automates deployment of secure ad-blocking for all of your devices - even when mobile. Step-by-step text and video guides included! Compatible clouds include AWS, Azure, Google Cloud, and Oracle Cloud. Cloudblock deploys Wireguard VPN, Pi-Hole DNS Ad-blocking, and DNS over HTTPS in a cloud provider - or locally - using Terraform and Ansible.
Stars: ✭ 257 (-8.21%)
Mutual labels:  terraform, hcl
Terraform Ecs Fargate
Source code for a tutorial on Medium I published - "Deploying Containers on Amazon’s ECS using Fargate and Terraform: Part 2"
Stars: ✭ 208 (-25.71%)
Mutual labels:  terraform, hcl
Azure arc
Automated Azure Arc environments
Stars: ✭ 224 (-20%)
Mutual labels:  terraform, hcl
Intellij Hcl
HCL language support for IntelliJ platform based IDEs
Stars: ✭ 207 (-26.07%)
Mutual labels:  terraform, hcl
Terraform validate
Assists in the enforcement of user-defined standards in Terraform
Stars: ✭ 245 (-12.5%)
Mutual labels:  terraform, hcl
Terraform Aws Jenkins
Terraform module to build Docker image with Jenkins, save it to an ECR repo, and deploy to Elastic Beanstalk running Docker stack
Stars: ✭ 197 (-29.64%)
Mutual labels:  terraform, hcl
Terragrunt Reference Architecture
Terragrunt Reference Architecture (upd: May 2020)
Stars: ✭ 204 (-27.14%)
Mutual labels:  terraform, hcl
Diagnostic Languageserver
diagnostic language server integrate with linters
Stars: ✭ 186 (-33.57%)
Mutual labels:  linter, neovim
Terraform Aws Eks Cluster
Terraform module for provisioning an EKS cluster
Stars: ✭ 256 (-8.57%)
Mutual labels:  terraform, hcl

(Neo)Vim Terraform Completion with Linter - Demos

IMPORTANT: This plugin now allow version based completion

Changelog

Provider Versions

Community Provider Versions

neovim build vim build terraform version Join the chat at https://gitter.im/juliosueiras/vim-terraform-completion FOSSA Status

Terraform Module is supported(though there might be bugs)

Overview

asciicast

Block Completions

(R) for Require , (O) for Optional and (B) for Block

block completion

block 2 completion

Dependencies

Installation

Require +ruby or +ruby/dyn for vim & json gem for ruby as well

Snippets completion is done through <C-X><C-K>

NeoBundle

NeoBundle 'hashivim/vim-terraform'
NeoBundle 'vim-syntastic/syntastic'
NeoBundle 'juliosueiras/vim-terraform-completion'

Vim-Plug

Plug 'hashivim/vim-terraform'
Plug 'vim-syntastic/syntastic'
Plug 'juliosueiras/vim-terraform-completion'

Minimal Configuration

" Minimal Configuration
set nocompatible
syntax on
filetype plugin indent on

call plug#begin('~/.vim/plugged')

" (Optinal) for Tag Sidebar
" Plug 'majutsushi/tagbar'

Plug 'hashivim/vim-terraform'
Plug 'vim-syntastic/syntastic'
Plug 'juliosueiras/vim-terraform-completion'
call plug#end()

" Syntastic Config
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

" (Optional)Remove Info(Preview) window
set completeopt-=preview

" (Optional)Hide Info(Preview) window after completions
autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
autocmd InsertLeave * if pumvisible() == 0|pclose|endif

" (Optional) Enable terraform plan to be include in filter
let g:syntastic_terraform_tffilter_plan = 1

" (Optional) Default: 0, enable(1)/disable(0) plugin's keymapping
let g:terraform_completion_keys = 1

" (Optional) Default: 1, enable(1)/disable(0) terraform module registry completion
let g:terraform_registry_module_completion = 0

Deoplete config

put this in your init.vim

let g:deoplete#omni_patterns = {}
let g:deoplete#omni_patterns.terraform = '[^ *\t"{=$]\w*'
let g:deoplete#enable_at_startup = 1
call deoplete#initialize()

NOTE: For newer version of deoplete if the above doesn't work

let g:deoplete#omni_patterns = {}

call deoplete#custom#option('omni_patterns', {
\ 'complete_method': 'omnifunc',
\ 'terraform': '[^ *\t"{=$]\w*',
\})

call deoplete#initialize()

Version config file

by default , all providers uses the latest version, but you can add a file call .tfcompleterc under working directory, and content can be this:

vsphere=1.0.3
aws=0.1.0

using the syatax of <provider>=<version>

Demo: asciicast

Community Providers

By default no community providers is enable, to use one, first refer to COMMUNITY_PROVIDER_VERSIONS.md , then add a .tfcompleterc to your current working dir , for ex. to use Generic REST Api Provider, the .tfcompleterc would look like

restapi=master

Specific Providers

Google Beta Provider

To use completion for google beta provider, please use .tfcompleterc and put google=beta_<version>

General Todo

Todolist
  • [X] Adapt to Upcoming terraform 0.10
  • [X] Added a bot for auto pushing of new provider version
  • [ ] (WIP) Refactoring Regex for linter and completion, and Trying out on api based(so it can integrade with other editor) solution
  • [ ] (WIP) More test cases
  • [x] Support for Neomake(Require further testing)
  • [X] Run terraform plan and output to a new window(<leader>rr)
  • [X] Async Run support(For Neovim/Vim 8)
  • [ ] Move regex code to a json(for easier extension)
  • [x] Test from zero to useful setup using Docker
  • [x] Jump Reference (Ctrl-L first time to jump to resource definition, second time on the same line to jump back)
  • [x] Show Doc (Ctrl-K)
  • [x] Provide config and example
  • [x] Integrate Basic terraform validate and tflint into Synstatic
  • [x] Added a custom linter for providing a better error
  • [ ] (WIP) Better linter
  • [ ] (WIP) Full Snippets

NOTE: enabling deep check for tflint can be a bit slow

NOTE: To use tffilter please add export PATH=$PATH:/path/to/this/plugin/bin to your bashrc or zshrc

Demo of the linter

Todo for Terraform completion

Todolist
  • [X] (Require more work) Lookup Attributes data using terraform.tfstate
  • [X] Evaluate Interpolation
  • [ ] (WIP) Custom Provider completion, might do Rest API style due to unstable custom provider
  • [ ] Provider
  • [x] Completion for functions(file,etc) and basic resource arguments(count,lifecyle, etc)
  • [x] Module (Make sure you run terraform get beforehand)
  • [x] Data
  • [x] Resource(with Provider)
  • [x] Parameter
  • [x] Adding Info to Argument and Attribute(Type not including ,since Info already indicate it)
  • [x] Variable
  • [ ] Cleaner code
  • [x] local/offline
  • [x] Add completion tags, ingress, and other subblock
  • [ ] Further seperate data source from resource

Todo for HCL

  • [ ] Add Completion for hcl
  • [X] Completion for Sublock(Indicate by Type(B) )

Todo for Improvement

  • [X] Add Travis-CI for testing, and ensuring the completion is outputing the right completion
  • [X] Look into the new module registry (Now support module name completion)
  • [X] Add config for allowing multiple version for providers

Credits

  • Provider Model Extraction script adapted from Intellij-hcl
  • Completion data is from Terraform Official Documentation and Model data from Intellij-HCL
  • Folding adapted from vim-terraform

Contributors

License

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].