Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
659dbb53
Unverified
Commit
659dbb53
authored
Jun 18, 2021
by
mehdicopter
Committed by
Marc Cornellà
Dec 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(terraform): add more aliases (#9989)
Closes #9989
parent
0e399d47
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
16 deletions
+35
-16
README.md
plugins/terraform/README.md
+29
-16
terraform.plugin.zsh
plugins/terraform/terraform.plugin.zsh
+6
-0
No files found.
plugins/terraform/README.md
View file @
659dbb53
#
# Terraform oh-my-zsh
plugin
#
Terraform
plugin
Plugin for Terraform, a tool from Hashicorp for managing infrastructure safely and efficiently.
Current as of Terraform v0.13
### Requirements
*
[
Terraform
](
https://terraform.io/
)
### Usage
It adds completion for
`terraform`
, as well as aliases and a prompt function.
To use it, add
`terraform`
to the plugins array of your
`~/.zshrc`
file:
...
...
@@ -16,14 +9,34 @@ To use it, add `terraform` to the plugins array of your `~/.zshrc` file:
plugins
=(
... terraform
)
```
*
Type
`terraform`
into your prompt and hit
`TAB`
to see available completion options
*
Type
`tf`
into your prompt as a short alias to
`terraform`
## Requirements
### Expanding ZSH prompt with current Terraform workspace name
*
[
Terraform
](
https://terraform.io/
)
If you want to get current Terraform workspace name in your ZSH prompt open
your .zsh-theme file and in a chosen place insert:
## Aliases
```
shell
PROMPT
=
$'%{$fg[white]%}$(tf_prompt_info)%{$reset_color%} '
| Alias | Command |
| ----- | -------------------- |
|
`tf`
|
`terraform`
|
|
`tfa`
|
`terraform apply`
|
|
`tfd`
|
`terraform destroy`
|
|
`tff`
|
`terraform fmt`
|
|
`tfi`
|
`terraform init`
|
|
`tfp`
|
`terraform plan`
|
|
`tfv`
|
`terraform validate`
|
## Prompt function
You can add the current Terraform workspace in your prompt by adding
`$(tf_prompt_info)`
to your
`PROMPT`
or
`RPROMPT`
variable.
```
sh
RPROMPT
=
'$(tf_prompt_info)'
```
You can also specify the PREFIX and SUFFIX for the workspace with the following variables:
```
sh
ZSH_THEME_TF_PROMPT_PREFIX
=
"%{
$fg
[white]%}"
ZSH_THEME_TF_PROMPT_SUFFIX
=
"%{
$reset_color
%}"
```
plugins/terraform/terraform.plugin.zsh
View file @
659dbb53
...
...
@@ -9,3 +9,9 @@ function tf_prompt_info() {
}
alias
tf
=
'terraform'
alias
tfa
=
'terraform apply'
alias
tfd
=
'terraform destroy'
alias
tff
=
'terraform fmt'
alias
tfi
=
'terraform init'
alias
tfp
=
'terraform plan'
alias
tfv
=
'terraform validate'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment