{"id":13505913,"url":"https://github.com/juliosueiras/vim-terraform-completion","last_synced_at":"2026-01-02T07:04:02.596Z","repository":{"id":20355982,"uuid":"89657729","full_name":"juliosueiras/vim-terraform-completion","owner":"juliosueiras","description":"A (Neo)Vim Autocompletion and linter for Terraform, a HashiCorp tool","archived":false,"fork":false,"pushed_at":"2022-03-04T13:52:42.000Z","size":7102,"stargazers_count":337,"open_issues_count":18,"forks_count":24,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-11-01T03:33:04.421Z","etag":null,"topics":["autocompletion","hcl","linter","neovim","terraform","vim","vim-terraform-completion"],"latest_commit_sha":null,"homepage":"","language":"Vim script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juliosueiras.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-28T02:06:26.000Z","updated_at":"2024-08-09T19:18:15.000Z","dependencies_parsed_at":"2022-07-08T21:47:44.202Z","dependency_job_id":null,"html_url":"https://github.com/juliosueiras/vim-terraform-completion","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliosueiras%2Fvim-terraform-completion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliosueiras%2Fvim-terraform-completion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliosueiras%2Fvim-terraform-completion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliosueiras%2Fvim-terraform-completion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juliosueiras","download_url":"https://codeload.github.com/juliosueiras/vim-terraform-completion/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246264659,"owners_count":20749494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autocompletion","hcl","linter","neovim","terraform","vim","vim-terraform-completion"],"created_at":"2024-08-01T00:01:17.324Z","updated_at":"2026-01-02T07:03:57.551Z","avatar_url":"https://github.com/juliosueiras.png","language":"Vim script","funding_links":[],"categories":["Editor Plugins"],"sub_categories":["Miscellaneous","IDE"],"readme":"# (Neo)Vim Terraform Completion with Linter - [Demos](./DEMO.md)\n\n**IMPORTANT: This plugin now allow version based completion**\n\n## [Changelog](./CHANGELOG.md)\n\n## [Provider Versions](./PROVIDER_VERSIONS.md)\n\n## [Community Provider Versions](./COMMUNITY_PROVIDER_VERSIONS.md)\n\n[![neovim build](https://badges.herokuapp.com/travis/juliosueiras/vim-terraform-completion?env=VIM_TYPE=nvim\u0026label=Neovim%20Build)](https://travis-ci.org/juliosueiras/vim-terraform-completion)\n[![vim build](https://badges.herokuapp.com/travis/juliosueiras/vim-terraform-completion?env=VIM_TYPE=vim\u0026label=Vim%20Build)](https://travis-ci.org/juliosueiras/vim-terraform-completion)\n![terraform version](https://img.shields.io/badge/terraform-0.11.7-blue.svg)\n[![Join the chat at https://gitter.im/juliosueiras/vim-terraform-completion](https://badges.gitter.im/juliosueiras/vim-terraform-completion.svg)](https://gitter.im/juliosueiras/vim-terraform-completion?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjuliosueiras%2Fvim-terraform-completion.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjuliosueiras%2Fvim-terraform-completion?ref=badge_shield)\n\n**Terraform Module is supported(though there might be bugs)**\n\n\n## Overview\n\n[![asciicast](https://asciinema.org/a/119610.png)](https://asciinema.org/a/119610)\n\n- [Vim Terraform Completion with Linter - Demos](#vim-terraform-completion-with-linter---demosdemomd)\n  * [Changelog](#changelog)\n  * [Dependencies](#dependencies)\n  * [Installation](#installation)\n    + [NeoBundle](#neobundle)\n    + [Vim-Plug](#vim-plug)\n    + [Minimal Configuration](#minimal-configuration)\n    + [Deoplete config](#deoplete-config)\n    + [Version config](#version-config-file)\n    + [Custom Provider](./CUSTOM_PROVIDER.md)\n\t\t- [Community Providers](#community-providers)\n\t- [Specific Providers Config](#specific-providers)\n  * [General Todo](#general-todo)\n  * [Todo for Terraform completion](#todo-for-terraform-completion)\n  * [Todo for HCL](#todo-for-hcl)\n  * [Todo for Improvement](#todo-for-improvement)\n  * [Credits](#credits)\n  * [Contributors](#contributors)\n\n### Block Completions\n(R) for Require , (O) for Optional and (B) for Block\n\n![block completion](pics/block_completion1.png)\n\n![block 2 completion](pics/block_completion2.png)\n\n## Dependencies\n\n- [vim-terraform](https://github.com/hashivim/vim-terraform) (For FileType)\n  (Optional not require for completion)\n- [vim-syntastic](https://github.com/vim-syntastic/syntastic) (Only for Linter)\n- [neomake](https://github.com/neomake/neomake) (Only for Linter, Neovim)\n- [Deoplete](https://github.com/Shougo/deoplete.nvim) (Neovim only, for completion)\n- Ctags \u0026 [tagbar](https://github.com/majutsushi/tagbar) (Optional for Tag Sidebar)\n\n## Installation\n\n**Require `+ruby` or `+ruby/dyn` for vim \u0026 json gem for ruby as well**\n\nSnippets completion is done through `\u003cC-X\u003e\u003cC-K\u003e`\n\n### NeoBundle\n```vim\nNeoBundle 'hashivim/vim-terraform'\nNeoBundle 'vim-syntastic/syntastic'\nNeoBundle 'juliosueiras/vim-terraform-completion'\n```\n\n### Vim-Plug\n```vim\nPlug 'hashivim/vim-terraform'\nPlug 'vim-syntastic/syntastic'\nPlug 'juliosueiras/vim-terraform-completion'\n```\n\n### Minimal Configuration\n```vim\n\" Minimal Configuration\nset nocompatible\nsyntax on\nfiletype plugin indent on\n\ncall plug#begin('~/.vim/plugged')\n\n\" (Optinal) for Tag Sidebar\n\" Plug 'majutsushi/tagbar'\n\nPlug 'hashivim/vim-terraform'\nPlug 'vim-syntastic/syntastic'\nPlug 'juliosueiras/vim-terraform-completion'\ncall plug#end()\n\n\" Syntastic Config\nset statusline+=%#warningmsg#\nset statusline+=%{SyntasticStatuslineFlag()}\nset statusline+=%*\n\nlet g:syntastic_always_populate_loc_list = 1\nlet g:syntastic_auto_loc_list = 1\nlet g:syntastic_check_on_open = 1\nlet g:syntastic_check_on_wq = 0\n\n\" (Optional)Remove Info(Preview) window\nset completeopt-=preview\n\n\" (Optional)Hide Info(Preview) window after completions\nautocmd CursorMovedI * if pumvisible() == 0|pclose|endif\nautocmd InsertLeave * if pumvisible() == 0|pclose|endif\n\n\" (Optional) Enable terraform plan to be include in filter\nlet g:syntastic_terraform_tffilter_plan = 1\n\n\" (Optional) Default: 0, enable(1)/disable(0) plugin's keymapping\nlet g:terraform_completion_keys = 1\n\n\" (Optional) Default: 1, enable(1)/disable(0) terraform module registry completion\nlet g:terraform_registry_module_completion = 0\n```\n\n## Deoplete config\nput this in your init.vim\n```vim\nlet g:deoplete#omni_patterns = {}\nlet g:deoplete#omni_patterns.terraform = '[^ *\\t\"{=$]\\w*'\nlet g:deoplete#enable_at_startup = 1\ncall deoplete#initialize()\n```\n\n**NOTE: For newer version of deoplete if the above doesn't work**\n\n```vim\n\nlet g:deoplete#omni_patterns = {}\n\ncall deoplete#custom#option('omni_patterns', {\n\\ 'complete_method': 'omnifunc',\n\\ 'terraform': '[^ *\\t\"{=$]\\w*',\n\\})\n\ncall deoplete#initialize()\n```\n\n\n## Version config file\nby default , all providers uses the latest version, but you can add a file call `.tfcompleterc` under working directory, and content can be this:\n```\nvsphere=1.0.3\naws=0.1.0\n```\n\nusing the syatax of `\u003cprovider\u003e=\u003cversion\u003e`\n\n*Demo:*\n[![asciicast](https://asciinema.org/a/157636.png)](https://asciinema.org/a/157636)\n\n## Community Providers\n\nBy 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\n\n```\nrestapi=master\n```\n\n## Specific Providers\n\n### Google Beta Provider\n\nTo use completion for google beta provider, please use `.tfcompleterc` and put `google=beta_\u003cversion\u003e`\n\n## General Todo\n\u003cdetails\u003e\n\u003csummary\u003eTodolist\u003c/summary\u003e\n\n- [X] Adapt to Upcoming terraform 0.10\n- [X] Added a bot for auto pushing of new provider version \n- [ ] (WIP) Refactoring Regex for linter and completion, and Trying out on api based(so it can integrade with other editor) solution\n- [ ] (WIP) More test cases\n- [x] Support for Neomake(Require further testing)\n- [X] Run terraform plan and output to a new window(`\u003cleader\u003err`) \n- [X] Async Run support(For Neovim/Vim 8) \n- [ ] Move regex code to a json(for easier extension)\n- [x] Test from zero to useful setup using Docker\n- [x] Jump Reference (Ctrl-L first time to jump to resource definition, second time\n    on the same line to jump back)\n- [x] Show Doc (Ctrl-K)\n- [x] Provide config and example\n- [x] Integrate Basic `terraform validate` and `tflint` into Synstatic\n- [x] Added a custom linter for providing a better error\n- [ ] (WIP) Better linter\n- [ ] (WIP) Full Snippets\n\u003c/details\u003e\n\n**NOTE:** enabling deep check for tflint can be a bit slow\n\n**NOTE:** To use `tffilter` please add `export PATH=$PATH:/path/to/this/plugin/bin` to your bashrc or zshrc\n\n[Demo of the linter](https://asciinema.org/a/118441)\n\n## Todo for Terraform completion\n\u003cdetails\u003e\n\u003csummary\u003eTodolist\u003c/summary\u003e\n\n- [X] (Require more work) Lookup Attributes data using terraform.tfstate\n- [X] Evaluate Interpolation\n- [ ] (WIP) Custom Provider completion, might do Rest API style due to unstable custom provider\n- [ ] Provider\n- [x] Completion for functions(file,etc) and basic resource arguments(count,lifecyle, etc)\n- [x] Module (Make sure you run `terraform get` beforehand)\n- [x] Data\n- [x] Resource(with Provider)\n- [x] Parameter\n- [x] Adding Info to Argument and Attribute(Type not including ,since Info\n    already indicate it)\n- [x] Variable\n- [ ] Cleaner code\n- [x] local/offline\n- [x] Add completion tags, ingress, and other subblock\n- [ ] Further seperate data source from resource\n\u003c/details\u003e\n\n## Todo for HCL\n- [ ] Add Completion for hcl\n- [X] Completion for Sublock(Indicate by `Type(B)` )\n## Todo for Improvement\n- [X] Add Travis-CI for testing, and ensuring the completion is outputing the right completion\n- [X] Look into the new module registry (Now support module name completion)\n- [X] Add config for allowing multiple version for providers\n\n## Credits\n- Provider Model Extraction script adapted from [Intellij-hcl](https://github.com/VladRassokhin/intellij-hcl)\n- Completion data is from Terraform Official Documentation and Model data from [Intellij-HCL](https://github.com/VladRassokhin/intellij-hcl/)\n- Folding adapted from [vim-terraform](https://github.com/hashivim/vim-terraform)\n\n## [Contributors](./CONTRIBUTORS.md)\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjuliosueiras%2Fvim-terraform-completion.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjuliosueiras%2Fvim-terraform-completion?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliosueiras%2Fvim-terraform-completion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliosueiras%2Fvim-terraform-completion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliosueiras%2Fvim-terraform-completion/lists"}