telescope-terraform-doc.nvim
is an extension for telescope.nvim that provides its users with ability to search and browse terraform providers docs.
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'ANGkeith/telescope-terraform-doc.nvim'
use {
"nvim-telescope/telescope.nvim",
requires = {
{ "nvim-lua/plenary.nvim" },
{ "ANGkeith/telescope-terraform-doc.nvim" },
},
}
Add the following to your init.vim
:
require('telescope').load_extension('terraform_doc')
Browse the official hashicorp providers:
:Telescope terraform_doc
Browse resources from the latest hashicorp/aws
provider:
:Telescope terraform_doc full_name=hashicorp/aws
Browse resources from the v3.74.0 hashicorp/aws
provider:
:Telescope terraform_doc full_name=hashicorp/aws version=3.74.0
Browse all terraform modules:
:Telescope terraform_doc modules
nnoremap <space>ott :Telescope terraform_doc<cr>
nnoremap <space>otm :Telescope terraform_doc modules<cr>
nnoremap <space>ota :Telescope terraform_doc full_name=hashicorp/aws<cr>
nnoremap <space>otg :Telescope terraform_doc full_name=hashicorp/google<cr>
nnoremap <space>otk :Telescope terraform_doc full_name=hashicorp/kubernetes<cr>
Keys | Description | Options |
---|---|---|
url_open_command |
The shell command to open the url | string (default: open /xdg-open ) |
latest_provider_symbol |
The symbol for indicating that the current version is the latest | string (default: * ) |
wincmd |
Command to open documentation in a split window | string (default: botright vnew ) |
wrap |
Wrap lines in a documentation in a split window | string (default: nowrap ) |
require("telescope").setup({
extensions = {
terraform_doc = {
url_open_command = vim.fn.has("macunix") and "open" or "xdg-open",
latest_provider_symbol = " ",
wincmd = "botright vnew",
wrap = "nowrap",
}
}
})
key | Usage |
---|---|
<cr> |
Open documentation with url_open_command |
<c-d> |
Open documentation in a split window |