mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-11-28 11:23:03 +01:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44a5decbc4 | ||
|
|
90f9fbc532 | ||
|
|
801782e8a6 |
No files matched your search
@@ -2,6 +2,8 @@
|
|||||||
# P.C. Shyamshankar <sykora@lucentbeing.com>
|
# P.C. Shyamshankar <sykora@lucentbeing.com>
|
||||||
# Copied from https://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
|
# Copied from https://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
|
||||||
|
|
||||||
|
autoload -Uz is-at-least
|
||||||
|
|
||||||
typeset -AHg FX FG BG
|
typeset -AHg FX FG BG
|
||||||
|
|
||||||
FX=(
|
FX=(
|
||||||
@@ -18,7 +20,16 @@ FX=(
|
|||||||
() {
|
() {
|
||||||
setopt localoptions noksharrays
|
setopt localoptions noksharrays
|
||||||
local -a codes fg bg
|
local -a codes fg bg
|
||||||
|
local code
|
||||||
codes=({000..255})
|
codes=({000..255})
|
||||||
|
# ${a:^b} array zipping needs zsh 5.0.6
|
||||||
|
if ! is-at-least 5.0.6; then
|
||||||
|
for code in $codes; do
|
||||||
|
FG[$code]="%{"$'\e'"[38;5;${code}m%}"
|
||||||
|
BG[$code]="%{"$'\e'"[48;5;${code}m%}"
|
||||||
|
done
|
||||||
|
return
|
||||||
|
fi
|
||||||
fg=( "%{"$'\e'"[38;5;"${^codes}"m%}" )
|
fg=( "%{"$'\e'"[38;5;"${^codes}"m%}" )
|
||||||
bg=( "%{"$'\e'"[48;5;"${^codes}"m%}" )
|
bg=( "%{"$'\e'"[48;5;"${^codes}"m%}" )
|
||||||
FG=( ${codes:^fg} )
|
FG=( ${codes:^fg} )
|
||||||
|
|||||||
@@ -177,7 +177,6 @@ plugins=(... git)
|
|||||||
| `grhh` | `git reset --hard` |
|
| `grhh` | `git reset --hard` |
|
||||||
| `grhk` | `git reset --keep` |
|
| `grhk` | `git reset --keep` |
|
||||||
| `grhs` | `git reset --soft` |
|
| `grhs` | `git reset --soft` |
|
||||||
| `grpa` | `git reset --patch` |
|
|
||||||
| `gpristine` | `git reset --hard && git clean --force -dfx` |
|
| `gpristine` | `git reset --hard && git clean --force -dfx` |
|
||||||
| `gwipe` | `git reset --hard && git clean --force -df` |
|
| `gwipe` | `git reset --hard && git clean --force -df` |
|
||||||
| `groh` | `git reset origin/$(git_current_branch) --hard` |
|
| `groh` | `git reset origin/$(git_current_branch) --hard` |
|
||||||
|
|||||||
@@ -378,7 +378,6 @@ alias gru='git reset --'
|
|||||||
alias grhh='git reset --hard'
|
alias grhh='git reset --hard'
|
||||||
alias grhk='git reset --keep'
|
alias grhk='git reset --keep'
|
||||||
alias grhs='git reset --soft'
|
alias grhs='git reset --soft'
|
||||||
alias grpa='git reset --patch'
|
|
||||||
alias gpristine='git reset --hard && git clean --force -dfx'
|
alias gpristine='git reset --hard && git clean --force -dfx'
|
||||||
alias gwipe='git reset --hard && git clean --force -df'
|
alias gwipe='git reset --hard && git clean --force -df'
|
||||||
alias groh='git reset origin/$(git_current_branch) --hard'
|
alias groh='git reset origin/$(git_current_branch) --hard'
|
||||||
|
|||||||
@@ -12,6 +12,14 @@ plugins=(... terraform)
|
|||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- [Terraform](https://terraform.io/)
|
- [Terraform](https://terraform.io/)
|
||||||
|
- [terraform-docs](https://terraform-docs.io/) (optional, for completion)
|
||||||
|
|
||||||
|
## terraform-docs completion
|
||||||
|
|
||||||
|
If `terraform-docs` is installed, this plugin also enables its completion.
|
||||||
|
The completion script is generated from the installed version and cached in
|
||||||
|
`$ZSH_CACHE_DIR/completions/_terraform-docs`. It is refreshed in the background
|
||||||
|
each time the plugin loads, so completion stays in sync with the installed CLI.
|
||||||
|
|
||||||
## Aliases
|
## Aliases
|
||||||
|
|
||||||
|
|||||||
@@ -39,3 +39,23 @@ alias tfsh='terraform show'
|
|||||||
alias tfw='terraform workspace'
|
alias tfw='terraform workspace'
|
||||||
alias tfwl='terraform workspace list'
|
alias tfwl='terraform workspace list'
|
||||||
alias tfws='terraform workspace select'
|
alias tfws='terraform workspace select'
|
||||||
|
|
||||||
|
if (( $+commands[terraform-docs] )); then
|
||||||
|
# If the completion file doesn't exist yet, compinit hasn't registered it.
|
||||||
|
if [[ ! -f "$ZSH_CACHE_DIR/completions/_terraform-docs" ]]; then
|
||||||
|
typeset -g -A _comps
|
||||||
|
autoload -Uz _terraform-docs
|
||||||
|
_comps[terraform-docs]=_terraform-docs
|
||||||
|
fi
|
||||||
|
|
||||||
|
zmodload -F zsh/files b:zf_mv
|
||||||
|
() {
|
||||||
|
local completions
|
||||||
|
completions=$(command terraform-docs completion zsh) || return
|
||||||
|
[[ -n "$completions" ]] || return
|
||||||
|
|
||||||
|
local TMPPREFIX="$ZSH_CACHE_DIR/completions/._terraform-docs"
|
||||||
|
zf_mv -f -- =(print -r -- "$completions") \
|
||||||
|
"$ZSH_CACHE_DIR/completions/_terraform-docs"
|
||||||
|
} &|
|
||||||
|
fi
|
||||||
@@ -4,7 +4,9 @@
|
|||||||
|
|
||||||
To use it, add thefuck to the plugins array of your zshrc file:
|
To use it, add thefuck to the plugins array of your zshrc file:
|
||||||
|
|
||||||
|
```zsh
|
||||||
plugins=(... thefuck)
|
plugins=(... thefuck)
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
Press `ESC` twice to correct previous console command.
|
Press `ESC` twice to correct previous console command.
|
||||||
|
|||||||
Reference in new issue
Block a user