mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-09 02:24:03 +01:00
Merge branch 'master' of github.com:fklassen/ohmyzsh
* 'master' of github.com:fklassen/ohmyzsh: (38 commits) fix(aws): restore accidentally deleted variable feat(upgrade): add verbosity settings fix(uninstall): abort uninstall if unable to change shell (#10357) feat(juju): add functions to get current controller and model (#11572) fix(aws): do not print region if it's not defined feat(aws): set region when AWS_REGION is not set feat(gnu-utils): add `gindent` (#11569) fix(lib): set equivalent LS_COLORS and LSCOLORS variables feat(rails): add `rta` alias (#11553) docs(vi-mode): document how to add vi-mode info on the prompt (#11548) Fixing link to PA website in README feat(vi-mode): add settings for vi-mode cursor styles (#10860) fix(init): set completion colors on theme load, not with `precmd` feat(aws): add AWS_REGION to aws_prompt_info (#10062) fix(aliases): group properly aliases (#11546) fix(argocd): typo in filename feat(argocd): add completion plugin refactor(theme-and-appearance): reorganize and clean up logic (#11529) fix(lib): use `$BROWSER` in `open_command` if set (#11532) docs(brew): remove duplication (#11535) ... Conflicts: oh-my-zsh.sh
This commit is contained in:
commit
21c511d24e
47 changed files with 1103 additions and 155 deletions
14
README.md
14
README.md
|
|
@ -317,6 +317,18 @@ zstyle ':omz:update' frequency 7
|
|||
zstyle ':omz:update' frequency 0
|
||||
```
|
||||
|
||||
### Updates verbosity
|
||||
|
||||
You can also limit the update verbosity with the following settings:
|
||||
|
||||
```sh
|
||||
zstyle ':omz:update' verbose default # default update prompt
|
||||
|
||||
zstyle ':omz:update' verbose minimal # only few lines
|
||||
|
||||
zstyle ':omz:update' verbose silent # only errors
|
||||
```
|
||||
|
||||
### Manual Updates
|
||||
|
||||
If you'd like to update at any point in time (maybe someone just released a new plugin and you don't want to wait a week?) you just need to run:
|
||||
|
|
@ -374,4 +386,4 @@ Oh My Zsh is released under the [MIT license](LICENSE.txt).
|
|||
|
||||

|
||||
|
||||
Oh My Zsh was started by the team at [Planet Argon](https://www.planetargon.com/?utm_source=github), a [Ruby on Rails development agency](https://www.planetargon.com/skills/ruby-on-rails-development?utm_source=github). Check out our [other open source projects](https://www.planetargon.com/open-source?utm_source=github).
|
||||
Oh My Zsh was started by the team at [Planet Argon](https://www.planetargon.com/?utm_source=github), a [Ruby on Rails development agency](http://www.planetargon.com/services/ruby-on-rails-development?utm_source=github). Check out our [other open source projects](https://www.planetargon.com/open-source?utm_source=github).
|
||||
|
|
|
|||
|
|
@ -776,10 +776,11 @@ function _omz::update {
|
|||
local last_commit=$(builtin cd -q "$ZSH"; git rev-parse HEAD)
|
||||
|
||||
# Run update script
|
||||
zstyle -s ':omz:update' verbose verbose_mode || verbose_mode=default
|
||||
if [[ "$1" != --unattended ]]; then
|
||||
ZSH="$ZSH" command zsh -f "$ZSH/tools/upgrade.sh" --interactive || return $?
|
||||
ZSH="$ZSH" command zsh -f "$ZSH/tools/upgrade.sh" -i -v $verbose_mode || return $?
|
||||
else
|
||||
ZSH="$ZSH" command zsh -f "$ZSH/tools/upgrade.sh" || return $?
|
||||
ZSH="$ZSH" command zsh -f "$ZSH/tools/upgrade.sh" -v $verbose_mode || return $?
|
||||
fi
|
||||
|
||||
# Update last updated file
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ if [[ "$CASE_SENSITIVE" = true ]]; then
|
|||
zstyle ':completion:*' matcher-list 'r:|=*' 'l:|=* r:|=*'
|
||||
else
|
||||
if [[ "$HYPHEN_INSENSITIVE" = true ]]; then
|
||||
zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|=*' 'l:|=* r:|=*'
|
||||
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]-_}={[:upper:][:lower:]_-}' 'r:|=*' 'l:|=* r:|=*'
|
||||
else
|
||||
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
|
||||
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|=*' 'l:|=* r:|=*'
|
||||
fi
|
||||
fi
|
||||
unset CASE_SENSITIVE HYPHEN_INSENSITIVE
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
# Changing/making/removing directory
|
||||
setopt auto_cd
|
||||
setopt auto_pushd
|
||||
setopt pushd_ignore_dups
|
||||
setopt pushdminus
|
||||
|
|
@ -8,7 +9,7 @@ setopt pushdminus
|
|||
# to your `zshrc` before loading `oh-my-zsh.sh`
|
||||
# to disable the following aliases and functions
|
||||
|
||||
zstyle -T ':omz:directories' aliases || return
|
||||
zstyle -T ':omz:directories' aliases || return 0
|
||||
|
||||
alias -g ...='../..'
|
||||
alias -g ....='../../..'
|
||||
|
|
|
|||
|
|
@ -30,6 +30,13 @@ function open_command() {
|
|||
;;
|
||||
esac
|
||||
|
||||
# If a URL is passed, $BROWSER might be set to a local browser within SSH.
|
||||
# See https://github.com/ohmyzsh/ohmyzsh/issues/11098
|
||||
if [[ -n "$BROWSER" && "$1" = (http|https)://* ]]; then
|
||||
"$BROWSER" "$@"
|
||||
return
|
||||
fi
|
||||
|
||||
${=open_cmd} "$@" &>/dev/null
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,8 +15,9 @@ if [[ $DISABLE_MAGIC_FUNCTIONS != true ]]; then
|
|||
done
|
||||
fi
|
||||
|
||||
## jobs
|
||||
setopt long_list_jobs
|
||||
setopt multios # enable redirect to multiple streams: echo >file1 >file2
|
||||
setopt long_list_jobs # show long list format job notifications
|
||||
setopt interactivecomments # recognize comments
|
||||
|
||||
env_default 'PAGER' 'less'
|
||||
env_default 'LESS' '-R'
|
||||
|
|
@ -30,6 +31,3 @@ if (( $+commands[ack-grep] )); then
|
|||
elif (( $+commands[ack] )); then
|
||||
alias afind='ack -il'
|
||||
fi
|
||||
|
||||
# recognize comments
|
||||
setopt interactivecomments
|
||||
|
|
|
|||
|
|
@ -1,68 +1,83 @@
|
|||
# ls colors
|
||||
# Sets color variable such as $fg, $bg, $color and $reset_color
|
||||
autoload -U colors && colors
|
||||
|
||||
# Enable ls colors
|
||||
export LSCOLORS="Gxfxcxdxbxegedabagacad"
|
||||
|
||||
# TODO organise this chaotic logic
|
||||
|
||||
if [[ "$DISABLE_LS_COLORS" != "true" ]]; then
|
||||
if [[ -d "$ZSH" ]]; then
|
||||
_test_dir="$ZSH"
|
||||
else
|
||||
_test_dir="."
|
||||
fi
|
||||
# Find the option for using colors in ls, depending on the version
|
||||
if [[ "$OSTYPE" == netbsd* ]]; then
|
||||
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
|
||||
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
|
||||
gls --color -d "$_test_dir" &>/dev/null && alias ls='gls --color=tty'
|
||||
elif [[ "$OSTYPE" == openbsd* ]]; then
|
||||
# On OpenBSD, "gls" (ls from GNU coreutils) and "colorls" (ls from base,
|
||||
# with color and multibyte support) are available from ports. "colorls"
|
||||
# will be installed on purpose and can't be pulled in by installing
|
||||
# coreutils, so prefer it to "gls".
|
||||
gls --color -d "$_test_dir" &>/dev/null && alias ls='gls --color=tty'
|
||||
colorls -G -d "$_test_dir" &>/dev/null && alias ls='colorls -G'
|
||||
elif [[ "$OSTYPE" == (darwin|freebsd)* ]]; then
|
||||
# this is a good alias, it works by default just using $LSCOLORS
|
||||
ls -G "$_test_dir" &>/dev/null && alias ls='ls -G'
|
||||
|
||||
# only use coreutils ls if there is a dircolors customization present ($LS_COLORS or .dircolors file)
|
||||
# otherwise, gls will use the default color scheme which is ugly af
|
||||
[[ -n "$LS_COLORS" || -f "$HOME/.dircolors" ]] && gls --color -d "$_test_dir" &>/dev/null && alias ls='gls --color=tty'
|
||||
else
|
||||
# For GNU ls, we use the default ls color theme. They can later be overwritten by themes.
|
||||
if [[ -z "$LS_COLORS" ]]; then
|
||||
(( $+commands[dircolors] )) && eval "$(dircolors -b)"
|
||||
fi
|
||||
|
||||
ls --color -d "$_test_dir" &>/dev/null && alias ls='ls --color=tty' || { ls -G "$_test_dir" &>/dev/null && alias ls='ls -G' }
|
||||
|
||||
# Take advantage of $LS_COLORS for completion as well.
|
||||
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# enable diff color if possible.
|
||||
if command diff --color /dev/null /dev/null &>/dev/null; then
|
||||
function color-diff {
|
||||
diff --color $@
|
||||
}
|
||||
alias diff="color-diff"
|
||||
compdef _diff color-diff # compdef is already loaded by this point
|
||||
fi
|
||||
|
||||
setopt auto_cd
|
||||
setopt multios
|
||||
# Expand variables and commands in PROMPT variables
|
||||
setopt prompt_subst
|
||||
|
||||
[[ -n "$WINDOW" ]] && SCREEN_NO="%B$WINDOW%b " || SCREEN_NO=""
|
||||
|
||||
# git theming default: Variables for theming the git info prompt
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
|
||||
# Prompt function theming defaults
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Beginning of the git prompt, before the branch name
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX=")" # End of the git prompt
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
|
||||
ZSH_THEME_RUBY_PROMPT_PREFIX="("
|
||||
ZSH_THEME_RUBY_PROMPT_SUFFIX=")"
|
||||
|
||||
|
||||
# Use diff --color if available
|
||||
if command diff --color /dev/null{,} &>/dev/null; then
|
||||
function diff {
|
||||
command diff --color "$@"
|
||||
}
|
||||
fi
|
||||
|
||||
|
||||
# Don't set ls coloring if disabled
|
||||
[[ "$DISABLE_LS_COLORS" != true ]] || return 0
|
||||
|
||||
function test-ls-args {
|
||||
local cmd="$1" # ls, gls, colorls, ...
|
||||
local args="${@[2,-1]}" # arguments except the first one
|
||||
command "$cmd" "$args" /dev/null &>/dev/null
|
||||
}
|
||||
|
||||
# Find the option for using colors in ls, depending on the version
|
||||
case "$OSTYPE" in
|
||||
netbsd*)
|
||||
# On NetBSD, test if `gls` (GNU ls) is installed (this one supports colors);
|
||||
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
|
||||
test-ls-args gls --color && alias ls='gls --color=tty'
|
||||
;;
|
||||
openbsd*)
|
||||
# On OpenBSD, `gls` (ls from GNU coreutils) and `colorls` (ls from base,
|
||||
# with color and multibyte support) are available from ports.
|
||||
# `colorls` will be installed on purpose and can't be pulled in by installing
|
||||
# coreutils (which might be installed for ), so prefer it to `gls`.
|
||||
test-ls-args gls --color && alias ls='gls --color=tty'
|
||||
test-ls-args colorls -G && alias ls='colorls -G'
|
||||
;;
|
||||
(darwin|freebsd)*)
|
||||
# This alias works by default just using $LSCOLORS
|
||||
test-ls-args ls -G && alias ls='ls -G'
|
||||
# Only use GNU ls if installed and there are user defaults for $LS_COLORS,
|
||||
# as the default coloring scheme is not very pretty
|
||||
[[ -n "$LS_COLORS" || -f "$HOME/.dircolors" ]] \
|
||||
&& test-ls-args gls --color \
|
||||
&& alias ls='gls --color=tty'
|
||||
;;
|
||||
*)
|
||||
if test-ls-args ls --color; then
|
||||
alias ls='ls --color=tty'
|
||||
elif test-ls-args ls -G; then
|
||||
alias ls='ls -G'
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
unfunction test-ls-args
|
||||
|
||||
|
||||
# Default coloring for BSD-based ls
|
||||
export LSCOLORS="Gxfxcxdxbxegedabagacad"
|
||||
|
||||
# Default coloring for GNU-based ls
|
||||
if [[ -z "$LS_COLORS" ]]; then
|
||||
# Define LS_COLORS via dircolors if available. Otherwise, set a default
|
||||
# equivalent to LSCOLORS (generated via https://geoff.greer.fm/lscolors)
|
||||
if (( $+commands[dircolors] )); then
|
||||
[[ -f "$HOME/.dircolors" ]] \
|
||||
&& source <(dircolors -b "$HOME/.dircolors") \
|
||||
|| source <(dircolors -b)
|
||||
else
|
||||
export LS_COLORS="di=1;36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43"
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
# due to malicious input as a consequence of CVE-2021-45444, which affects
|
||||
# zsh versions from 5.0.3 to 5.8.
|
||||
#
|
||||
autoload -Uz +X regexp-replace VCS_INFO_formats 2>/dev/null || return
|
||||
autoload -Uz +X regexp-replace VCS_INFO_formats 2>/dev/null || return 0
|
||||
|
||||
# We use $tmp here because it's already a local variable in VCS_INFO_formats
|
||||
typeset PATCH='for tmp (base base-name branch misc revision subdir) hook_com[$tmp]="${hook_com[$tmp]//\%/%%}"'
|
||||
|
|
|
|||
|
|
@ -192,6 +192,9 @@ if [[ -n "$ZSH_THEME" ]]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# set completion colors to be the same as `ls`, after theme has been loaded
|
||||
[[ -z "$LS_COLORS" ]] || zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
||||
|
||||
for config_file ("$HOME"/.zsh.after/*.zsh(N)); do
|
||||
source "$config_file"
|
||||
done
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Requirements: Python needs to be installed.
|
|||
|
||||
- `acs -h/--help`: print help mesage
|
||||
|
||||
- `acs <keyword>`: filter aliases by `<keyword>` and highlight
|
||||
- `acs <keyword(s)>`: filter and highlight aliases by `<keyword>`
|
||||
|
||||
- `acs -g <group>/--group <group>`: show only aliases for group `<group>`. Multiple uses of the flag show all groups
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ def parse(line):
|
|||
|
||||
def cheatsheet(lines):
|
||||
exps = [ parse(line) for line in lines ]
|
||||
exps.sort(key=lambda exp:exp[2])
|
||||
cheatsheet = {'_default': []}
|
||||
for key, group in itertools.groupby(exps, lambda exp:exp[2]):
|
||||
group_list = [ item for item in group ]
|
||||
|
|
@ -56,8 +57,8 @@ def pretty_print(cheatsheet, wfilter, group_list=None, groups_only=False):
|
|||
pretty_print_group(key, [ alias for alias in aliases if alias[0].find(wfilter)>-1 or alias[1].find(wfilter)>-1], wfilter)
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description="Pretty print aliases.")
|
||||
parser.add_argument('filter', nargs="*", help="search aliases matching string")
|
||||
parser = argparse.ArgumentParser(description="Pretty print aliases.", prog="acs")
|
||||
parser.add_argument('filter', nargs="*", metavar="<keyword>", help="search aliases matching keywords")
|
||||
parser.add_argument('-g', '--group', dest="group_list", action='append', help="only print aliases in given groups")
|
||||
parser.add_argument('--groups', dest='groups_only', action='store_true', help="only print alias groups")
|
||||
args = parser.parse_args()
|
||||
|
|
|
|||
20
plugins/argocd/README.md
Normal file
20
plugins/argocd/README.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Argo CD plugin
|
||||
|
||||
This plugin adds completion for the [Argo CD](https://argoproj.github.io/cd/) CLI.
|
||||
|
||||
To use it, add `argocd` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... argocd)
|
||||
```
|
||||
|
||||
This plugin does not add any aliases.
|
||||
|
||||
## Cache
|
||||
|
||||
This plugin caches the completion script and is automatically updated asynchronously when the plugin is
|
||||
loaded, which is usually when you start up a new terminal emulator.
|
||||
|
||||
The cache is stored at:
|
||||
|
||||
- `$ZSH_CACHE/completions/_argocd` completions script
|
||||
14
plugins/argocd/argocd.plugin.zsh
Normal file
14
plugins/argocd/argocd.plugin.zsh
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Autocompletion for argocd.
|
||||
if (( ! $+commands[argocd] )); then
|
||||
return
|
||||
fi
|
||||
|
||||
# If the completion file doesn't exist yet, we need to autoload it and
|
||||
# bind it to `argocd`. Otherwise, compinit will have already done that.
|
||||
if [[ ! -f "$ZSH_CACHE_DIR/completions/_argocd" ]]; then
|
||||
typeset -g -A _comps
|
||||
autoload -Uz _argocd
|
||||
_comps[argocd]=_argocd
|
||||
fi
|
||||
|
||||
argocd completion zsh >| "$ZSH_CACHE_DIR/completions/_argocd" &|
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# aws
|
||||
|
||||
This plugin provides completion support for [awscli](https://docs.aws.amazon.com/cli/latest/reference/index.html)
|
||||
and a few utilities to manage AWS profiles and display them in the prompt.
|
||||
and a few utilities to manage AWS profiles/regions and display them in the prompt.
|
||||
|
||||
To use it, add `aws` to the plugins array in your zshrc file.
|
||||
|
||||
|
|
@ -12,10 +12,13 @@ plugins=(... aws)
|
|||
## Plugin commands
|
||||
|
||||
* `asp [<profile>]`: sets `$AWS_PROFILE` and `$AWS_DEFAULT_PROFILE` (legacy) to `<profile>`.
|
||||
It also sets `$AWS_EB_PROFILE` to `<profile>` for the Elastic Beanstalk CLI.
|
||||
It also sets `$AWS_EB_PROFILE` to `<profile>` for the Elastic Beanstalk CLI. It sets `$AWS_PROFILE_REGION` for display in `aws_prompt_info`.
|
||||
Run `asp` without arguments to clear the profile.
|
||||
* `asp [<profile>] login`: If AWS SSO has been configured in your aws profile, it will run the `aws sso login` command following profile selection.
|
||||
|
||||
* `asr [<region>]`: sets `$AWS_REGION` and `$AWS_DEFAULT_REGION` (legacy) to `<region>`.
|
||||
Run `asr` without arguments to clear the profile.
|
||||
|
||||
* `acp [<profile>] [<mfa_token>]`: in addition to `asp` functionality, it actually changes
|
||||
the profile by assuming the role specified in the `<profile>` configuration. It supports
|
||||
MFA and sets `$AWS_ACCESS_KEY_ID`, `$AWS_SECRET_ACCESS_KEY` and `$AWS_SESSION_TOKEN`, if
|
||||
|
|
@ -25,25 +28,34 @@ plugins=(... aws)
|
|||
|
||||
* `agp`: gets the current value of `$AWS_PROFILE`.
|
||||
|
||||
* `agr`: gets the current value of `$AWS_REGION`.
|
||||
|
||||
* `aws_change_access_key`: changes the AWS access key of a profile.
|
||||
|
||||
* `aws_profiles`: lists the available profiles in the `$AWS_CONFIG_FILE` (default: `~/.aws/config`).
|
||||
Used to provide completion for the `asp` function.
|
||||
|
||||
* `aws_regions`: lists the available regions.
|
||||
Used to provide completion for the `asr` function.
|
||||
|
||||
## Plugin options
|
||||
|
||||
* Set `SHOW_AWS_PROMPT=false` in your zshrc file if you want to prevent the plugin from modifying your RPROMPT.
|
||||
Some themes might overwrite the value of RPROMPT instead of appending to it, so they'll need to be fixed to
|
||||
see the AWS profile prompt.
|
||||
see the AWS profile/region prompt.
|
||||
|
||||
## Theme
|
||||
|
||||
The plugin creates an `aws_prompt_info` function that you can use in your theme, which displays
|
||||
the current `$AWS_PROFILE`. It uses two variables to control how that is shown:
|
||||
the current `$AWS_PROFILE` and `$AWS_REGION`. It uses four variables to control how that is shown:
|
||||
|
||||
* ZSH_THEME_AWS_PREFIX: sets the prefix of the AWS_PROFILE. Defaults to `<aws:`.
|
||||
* ZSH_THEME_AWS_PROFILE_PREFIX: sets the prefix of the AWS_PROFILE. Defaults to `<aws:`.
|
||||
|
||||
* ZSH_THEME_AWS_SUFFIX: sets the suffix of the AWS_PROFILE. Defaults to `>`.
|
||||
* ZSH_THEME_AWS_PROFILE_SUFFIX: sets the suffix of the AWS_PROFILE. Defaults to `>`.
|
||||
|
||||
* ZSH_THEME_AWS_REGION_PREFIX: sets the prefix of the AWS_REGION. Defaults to `<region:`.
|
||||
|
||||
* ZSH_THEME_AWS_REGION_SUFFIX: sets the suffix of the AWS_REGION. Defaults to `>`.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,14 @@ function agp() {
|
|||
echo $AWS_PROFILE
|
||||
}
|
||||
|
||||
function agr() {
|
||||
echo $AWS_REGION
|
||||
}
|
||||
|
||||
# AWS profile selection
|
||||
function asp() {
|
||||
if [[ -z "$1" ]]; then
|
||||
unset AWS_DEFAULT_PROFILE AWS_PROFILE AWS_EB_PROFILE
|
||||
unset AWS_DEFAULT_PROFILE AWS_PROFILE AWS_EB_PROFILE AWS_PROFILE_REGION
|
||||
echo AWS profile cleared.
|
||||
return
|
||||
fi
|
||||
|
|
@ -22,11 +26,32 @@ function asp() {
|
|||
export AWS_PROFILE=$1
|
||||
export AWS_EB_PROFILE=$1
|
||||
|
||||
export AWS_PROFILE_REGION=$(aws configure get region)
|
||||
|
||||
if [[ "$2" == "login" ]]; then
|
||||
aws sso login
|
||||
fi
|
||||
}
|
||||
|
||||
# AWS region selection
|
||||
function asr() {
|
||||
if [[ -z "$1" ]]; then
|
||||
unset AWS_DEFAULT_REGION AWS_REGION
|
||||
echo AWS region cleared.
|
||||
return
|
||||
fi
|
||||
|
||||
local -a available_regions
|
||||
available_regions=($(aws_regions))
|
||||
if [[ -z "${available_regions[(r)$1]}" ]]; then
|
||||
echo "${fg[red]}Available regions: \n$(aws_regions)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
export AWS_REGION=$1
|
||||
export AWS_DEFAULT_REGION=$1
|
||||
}
|
||||
|
||||
# AWS profile switch
|
||||
function acp() {
|
||||
if [[ -z "$1" ]]; then
|
||||
|
|
@ -145,12 +170,25 @@ function aws_change_access_key() {
|
|||
AWS_PAGER="" aws iam list-access-keys
|
||||
}
|
||||
|
||||
function aws_regions() {
|
||||
if [[ $AWS_DEFAULT_PROFILE || $AWS_PROFILE ]];then
|
||||
aws ec2 describe-regions |grep RegionName | awk -F ':' '{gsub(/"/, "", $2);gsub(/,/, "", $2);gsub(/ /, "", $2); print $2}'
|
||||
else
|
||||
echo "You must specify a AWS profile."
|
||||
fi
|
||||
}
|
||||
|
||||
function aws_profiles() {
|
||||
aws --no-cli-pager configure list-profiles 2> /dev/null && return
|
||||
[[ -r "${AWS_CONFIG_FILE:-$HOME/.aws/config}" ]] || return 1
|
||||
grep --color=never -Eo '\[.*\]' "${AWS_CONFIG_FILE:-$HOME/.aws/config}" | sed -E 's/^[[:space:]]*\[(profile)?[[:space:]]*([^[:space:]]+)\][[:space:]]*$/\2/g'
|
||||
}
|
||||
|
||||
function _aws_regions() {
|
||||
reply=($(aws_regions))
|
||||
}
|
||||
compctl -K _aws_regions asr
|
||||
|
||||
function _aws_profiles() {
|
||||
reply=($(aws_profiles))
|
||||
}
|
||||
|
|
@ -158,15 +196,22 @@ compctl -K _aws_profiles asp acp aws_change_access_key
|
|||
|
||||
# AWS prompt
|
||||
function aws_prompt_info() {
|
||||
[[ -n "$AWS_PROFILE" ]] || return
|
||||
echo "${ZSH_THEME_AWS_PREFIX=<aws:}${AWS_PROFILE:gs/%/%%}${ZSH_THEME_AWS_SUFFIX=>}"
|
||||
local _aws_to_show
|
||||
local region="${AWS_REGION:-${AWS_DEFAULT_REGION:-$AWS_PROFILE_REGION}}"
|
||||
if [[ -n $AWS_PROFILE ]];then
|
||||
_aws_to_show+="${ZSH_THEME_AWS_PROFILE_PREFIX:=<aws:}${AWS_PROFILE}${ZSH_THEME_AWS_PROFILE_SUFFIX:=>}"
|
||||
fi
|
||||
if [[ -n $AWS_REGION ]]; then
|
||||
[[ -n $AWS_PROFILE ]] && _aws_to_show+=" "
|
||||
_aws_to_show+="${ZSH_THEME_AWS_REGION_PREFIX:=<region:}${region}${ZSH_THEME_AWS_REGION_SUFFIX:=>}"
|
||||
fi
|
||||
echo "$_aws_to_show"
|
||||
}
|
||||
|
||||
if [[ "$SHOW_AWS_PROMPT" != false && "$RPROMPT" != *'$(aws_prompt_info)'* ]]; then
|
||||
RPROMPT='$(aws_prompt_info)'"$RPROMPT"
|
||||
fi
|
||||
|
||||
|
||||
# Load awscli completions
|
||||
|
||||
# AWS CLI v2 comes with its own autocompletion. Check if that is there, otherwise fall back
|
||||
|
|
@ -211,3 +256,4 @@ else
|
|||
[[ -r $_aws_zsh_completer_path ]] && source $_aws_zsh_completer_path
|
||||
unset _aws_zsh_completer_path _brew_prefix
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -32,12 +32,14 @@ function _az-homebrew-installed() {
|
|||
(( $+commands[brew] )) || return 1
|
||||
|
||||
# speculatively check default brew prefix
|
||||
if [ -h /usr/local/opt/az ]; then
|
||||
_brew_prefix=/usr/local/opt/az
|
||||
if [[ -d /usr/local ]]; then
|
||||
_brew_prefix=/usr/local
|
||||
elif [[ -d /opt/homebrew ]]; then
|
||||
_brew_prefix=/opt/homebrew
|
||||
else
|
||||
# ok, it is not in the default prefix
|
||||
# this call to brew is expensive (about 400 ms), so at least let's make it only once
|
||||
_brew_prefix=$(brew --prefix azure-cli)
|
||||
_brew_prefix=$(brew --prefix)
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -49,12 +51,12 @@ _az_zsh_completer_path="$commands[az_zsh_completer.sh]"
|
|||
if [[ -z $_az_zsh_completer_path ]]; then
|
||||
# Homebrew
|
||||
if _az-homebrew-installed; then
|
||||
_az_zsh_completer_path=$_brew_prefix/libexec/bin/az.completion.sh
|
||||
_az_zsh_completer_path=$_brew_prefix/etc/bash_completion.d/az
|
||||
# Linux
|
||||
else
|
||||
_az_zsh_completer_path=/etc/bash_completion.d/azure-cli
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ -r $_az_zsh_completer_path ]] && source $_az_zsh_completer_path
|
||||
[[ -r $_az_zsh_completer_path ]] && autoload -U +X bashcompinit && bashcompinit && source $_az_zsh_completer_path
|
||||
unset _az_zsh_completer_path _brew_prefix
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ defined for convenience.
|
|||
| -------- | --------------------------------------- | ------------------------------------------------------------------- |
|
||||
| `bcubc` | `brew upgrade --cask && brew cleanup` | Update outdated casks, then run cleanup. |
|
||||
| `bcubo` | `brew update && brew outdated --cask` | Update Homebrew data, then list outdated casks. |
|
||||
| `bcubc` | `brew upgrade --cask && brew cleanup` | Update outdated casks, then run cleanup. |
|
||||
| `brewp` | `brew pin` | Pin a specified formula so that it's not upgraded. |
|
||||
| `brews` | `brew list -1` | List installed formulae or the installed files for a given formula. |
|
||||
| `brewsp` | `brew list --pinned` | List pinned formulae, or show the version of a given formula. |
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# extract plugin
|
||||
|
||||
This plugin defines a function called `extract` that extracts the archive file
|
||||
you pass it, and it supports a wide variety of archive filetypes.
|
||||
This plugin defines a function called `extract` that extracts the archive file you pass it, and it supports a
|
||||
wide variety of archive filetypes.
|
||||
|
||||
This way you don't have to know what specific command extracts a file, you just
|
||||
do `extract <filename>` and the function takes care of the rest.
|
||||
This way you don't have to know what specific command extracts a file, you just do `extract <filename>` and
|
||||
the function takes care of the rest.
|
||||
|
||||
To use it, add `extract` to the plugins array in your zshrc file:
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ plugins=(... extract)
|
|||
## Supported file extensions
|
||||
|
||||
| Extension | Description |
|
||||
|:------------------|:-------------------------------------|
|
||||
| :---------------- | :----------------------------------- |
|
||||
| `7z` | 7zip file |
|
||||
| `Z` | Z archive (LZW) |
|
||||
| `apk` | Android app file |
|
||||
|
|
@ -32,6 +32,7 @@ plugins=(... extract)
|
|||
| `lrz` | LRZ archive |
|
||||
| `lz4` | LZ4 archive |
|
||||
| `lzma` | LZMA archive |
|
||||
| `obscpio` | cpio archive used on OBS |
|
||||
| `rar` | WinRAR archive |
|
||||
| `rpm` | RPM package |
|
||||
| `sublime-package` | Sublime Text package |
|
||||
|
|
@ -57,5 +58,5 @@ plugins=(... extract)
|
|||
| `zst` | Zstandard file (zstd) |
|
||||
| `zpaq` | Zpaq file |
|
||||
|
||||
See [list of archive formats](https://en.wikipedia.org/wiki/List_of_archive_formats) for
|
||||
more information regarding archive formats.
|
||||
See [list of archive formats](https://en.wikipedia.org/wiki/List_of_archive_formats) for more information
|
||||
regarding archive formats.
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@
|
|||
|
||||
_arguments \
|
||||
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
|
||||
"*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|cab|cpio|deb|ear|gz|ipa|ipsw|jar|lrz|lz4|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst|zpaq)(-.)'" \
|
||||
"*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|cab|cpio|deb|ear|gz|ipa|ipsw|jar|lrz|lz4|lzma|obscpio|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst|zpaq)(-.)'" \
|
||||
&& return 0
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ EOF
|
|||
builtin cd -q ..; command rm *.tar.* debian-binary ;;
|
||||
(*.zst) unzstd "$file" ;;
|
||||
(*.cab) cabextract -d "$extract_dir" "$file" ;;
|
||||
(*.cpio) cpio -idmvF "$file" ;;
|
||||
(*.cpio|*.obscpio) cpio -idmvF "$file" ;;
|
||||
(*.zpaq) zpaq x "$file" ;;
|
||||
(*)
|
||||
echo "extract: '$file' cannot be extracted" >&2
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ __gnu_utils() {
|
|||
'gchown' 'gchroot' 'gcksum' 'gcomm' 'gcp' 'gcsplit' 'gcut' 'gdate'
|
||||
'gdd' 'gdf' 'gdir' 'gdircolors' 'gdirname' 'gdu' 'gecho' 'genv' 'gexpand'
|
||||
'gexpr' 'gfactor' 'gfalse' 'gfmt' 'gfold' 'ggroups' 'ghead' 'ghostid'
|
||||
'gid' 'ginstall' 'gjoin' 'gkill' 'glink' 'gln' 'glogname' 'gls' 'gmd5sum'
|
||||
'gid' 'gindent' 'ginstall' 'gjoin' 'gkill' 'glink' 'gln' 'glogname' 'gls' 'gmd5sum'
|
||||
'gmkdir' 'gmkfifo' 'gmknod' 'gmktemp' 'gmv' 'gnice' 'gnl' 'gnohup' 'gnproc'
|
||||
'god' 'gpaste' 'gpathchk' 'gpinky' 'gpr' 'gprintenv' 'gprintf' 'gptx' 'gpwd'
|
||||
'greadlink' 'grm' 'grmdir' 'gruncon' 'gseq' 'gsha1sum' 'gsha224sum'
|
||||
|
|
@ -61,3 +61,14 @@ __gnu_utils_preexec() {
|
|||
|
||||
autoload -Uz add-zsh-hook
|
||||
add-zsh-hook preexec __gnu_utils_preexec
|
||||
|
||||
# lib/theme-and-appearance.zsh sets the alias for ls not knowing that
|
||||
# we'll be using GNU ls. We'll reset this to use GNU ls --color.
|
||||
# See https://github.com/ohmyzsh/ohmyzsh/issues/11503
|
||||
#
|
||||
# The ls alias might look like:
|
||||
# - ls='ls -G'
|
||||
# - ls='gls --color=tty'
|
||||
if [[ -x "${commands[gls]}" && "${aliases[ls]}" = (*-G*|gls*) ]]; then
|
||||
alias ls='ls --color=tty'
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -2,11 +2,20 @@
|
|||
|
||||
This plugin adds a few functions that are useful when using [iTerm2](https://www.iterm2.com/).
|
||||
|
||||
|
||||
To use it, add _iterm2_ to the plugins array of your zshrc file:
|
||||
```
|
||||
plugins=(... iterm2)
|
||||
```
|
||||
|
||||
Optionally, the plugin also applies the [Shell Integration Script for iTerm2](https://iterm2.com/documentation-shell-integration.html).
|
||||
You can enable the integration with zstyle. It's important to add this line
|
||||
before the line sourcing oh-my-zsh:
|
||||
|
||||
```
|
||||
zstyle :omz:plugins:iterm2 shell-integration yes
|
||||
```
|
||||
|
||||
## Plugin commands
|
||||
|
||||
* `_iterm2_command <iterm2-command>`
|
||||
|
|
@ -24,6 +33,9 @@ plugins=(... iterm2)
|
|||
* `iterm2_tab_color_reset`
|
||||
resets the color of iTerm2's current tab back to default.
|
||||
|
||||
|
||||
For shell integration features see the [official documentation](https://iterm2.com/documentation-shell-integration.html).
|
||||
|
||||
## Contributors
|
||||
|
||||
- [Aviv Rosenberg](https://github.com/avivrosenberg)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,17 @@
|
|||
# This plugin is only relevant if the terminal is iTerm2 on OSX.
|
||||
if [[ "$OSTYPE" == darwin* ]] && [[ -n "$ITERM_SESSION_ID" ]] ; then
|
||||
|
||||
# maybe make it the default in the future and allow opting out?
|
||||
if zstyle -t ':omz:plugins:iterm2' shell-integration; then
|
||||
# Handle $0 according to the standard:
|
||||
# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
|
||||
0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
|
||||
0="${${(M)0:#/*}:-$PWD/$0}"
|
||||
|
||||
# See official docs: https://iterm2.com/documentation-shell-integration.html
|
||||
source "${0:A:h}/iterm2_shell_integration.zsh"
|
||||
fi
|
||||
|
||||
###
|
||||
# Executes an arbitrary iTerm2 command via an escape code sequence.
|
||||
# See https://iterm2.com/documentation-escape-codes.html for all supported commands.
|
||||
|
|
|
|||
178
plugins/iterm2/iterm2_shell_integration.zsh
Normal file
178
plugins/iterm2/iterm2_shell_integration.zsh
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
if [[ -o interactive ]]; then
|
||||
if [ "${ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX-}""$TERM" != "tmux-256color" -a "${ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX-}""$TERM" != "screen" -a "${ITERM_SHELL_INTEGRATION_INSTALLED-}" = "" -a "$TERM" != linux -a "$TERM" != dumb ]; then
|
||||
ITERM_SHELL_INTEGRATION_INSTALLED=Yes
|
||||
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
||||
# Indicates start of command output. Runs just before command executes.
|
||||
iterm2_before_cmd_executes() {
|
||||
if [ "$TERM_PROGRAM" = "iTerm.app" ]; then
|
||||
printf "\033]133;C;\r\007"
|
||||
else
|
||||
printf "\033]133;C;\007"
|
||||
fi
|
||||
}
|
||||
|
||||
iterm2_set_user_var() {
|
||||
printf "\033]1337;SetUserVar=%s=%s\007" "$1" $(printf "%s" "$2" | base64 | tr -d '\n')
|
||||
}
|
||||
|
||||
# Users can write their own version of this method. It should call
|
||||
# iterm2_set_user_var but not produce any other output.
|
||||
# e.g., iterm2_set_user_var currentDirectory $PWD
|
||||
# Accessible in iTerm2 (in a badge now, elsewhere in the future) as
|
||||
# \(user.currentDirectory).
|
||||
whence -v iterm2_print_user_vars > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
iterm2_print_user_vars() {
|
||||
true
|
||||
}
|
||||
fi
|
||||
|
||||
iterm2_print_state_data() {
|
||||
local _iterm2_hostname="${iterm2_hostname-}"
|
||||
if [ -z "${iterm2_hostname:-}" ]; then
|
||||
_iterm2_hostname=$(hostname -f 2>/dev/null)
|
||||
fi
|
||||
printf "\033]1337;RemoteHost=%s@%s\007" "$USER" "${_iterm2_hostname-}"
|
||||
printf "\033]1337;CurrentDir=%s\007" "$PWD"
|
||||
iterm2_print_user_vars
|
||||
}
|
||||
|
||||
# Report return code of command; runs after command finishes but before prompt
|
||||
iterm2_after_cmd_executes() {
|
||||
printf "\033]133;D;%s\007" "$STATUS"
|
||||
iterm2_print_state_data
|
||||
}
|
||||
|
||||
# Mark start of prompt
|
||||
iterm2_prompt_mark() {
|
||||
printf "\033]133;A\007"
|
||||
}
|
||||
|
||||
# Mark end of prompt
|
||||
iterm2_prompt_end() {
|
||||
printf "\033]133;B\007"
|
||||
}
|
||||
|
||||
# There are three possible paths in life.
|
||||
#
|
||||
# 1) A command is entered at the prompt and you press return.
|
||||
# The following steps happen:
|
||||
# * iterm2_preexec is invoked
|
||||
# * PS1 is set to ITERM2_PRECMD_PS1
|
||||
# * ITERM2_SHOULD_DECORATE_PROMPT is set to 1
|
||||
# * The command executes (possibly reading or modifying PS1)
|
||||
# * iterm2_precmd is invoked
|
||||
# * ITERM2_PRECMD_PS1 is set to PS1 (as modified by command execution)
|
||||
# * PS1 gets our escape sequences added to it
|
||||
# * zsh displays your prompt
|
||||
# * You start entering a command
|
||||
#
|
||||
# 2) You press ^C while entering a command at the prompt.
|
||||
# The following steps happen:
|
||||
# * (iterm2_preexec is NOT invoked)
|
||||
# * iterm2_precmd is invoked
|
||||
# * iterm2_before_cmd_executes is called since we detected that iterm2_preexec was not run
|
||||
# * (ITERM2_PRECMD_PS1 and PS1 are not messed with, since PS1 already has our escape
|
||||
# sequences and ITERM2_PRECMD_PS1 already has PS1's original value)
|
||||
# * zsh displays your prompt
|
||||
# * You start entering a command
|
||||
#
|
||||
# 3) A new shell is born.
|
||||
# * PS1 has some initial value, either zsh's default or a value set before this script is sourced.
|
||||
# * iterm2_precmd is invoked
|
||||
# * ITERM2_SHOULD_DECORATE_PROMPT is initialized to 1
|
||||
# * ITERM2_PRECMD_PS1 is set to the initial value of PS1
|
||||
# * PS1 gets our escape sequences added to it
|
||||
# * Your prompt is shown and you may begin entering a command.
|
||||
#
|
||||
# Invariants:
|
||||
# * ITERM2_SHOULD_DECORATE_PROMPT is 1 during and just after command execution, and "" while the prompt is
|
||||
# shown and until you enter a command and press return.
|
||||
# * PS1 does not have our escape sequences during command execution
|
||||
# * After the command executes but before a new one begins, PS1 has escape sequences and
|
||||
# ITERM2_PRECMD_PS1 has PS1's original value.
|
||||
iterm2_decorate_prompt() {
|
||||
# This should be a raw PS1 without iTerm2's stuff. It could be changed during command
|
||||
# execution.
|
||||
ITERM2_PRECMD_PS1="$PS1"
|
||||
ITERM2_SHOULD_DECORATE_PROMPT=""
|
||||
|
||||
# Add our escape sequences just before the prompt is shown.
|
||||
# Use ITERM2_SQUELCH_MARK for people who can't mdoify PS1 directly, like powerlevel9k users.
|
||||
# This is gross but I had a heck of a time writing a correct if statetment for zsh 5.0.2.
|
||||
local PREFIX=""
|
||||
if [[ $PS1 == *"$(iterm2_prompt_mark)"* ]]; then
|
||||
PREFIX=""
|
||||
elif [[ "${ITERM2_SQUELCH_MARK-}" != "" ]]; then
|
||||
PREFIX=""
|
||||
else
|
||||
PREFIX="%{$(iterm2_prompt_mark)%}"
|
||||
fi
|
||||
PS1="$PREFIX$PS1%{$(iterm2_prompt_end)%}"
|
||||
ITERM2_DECORATED_PS1="$PS1"
|
||||
}
|
||||
|
||||
iterm2_precmd() {
|
||||
local STATUS="$?"
|
||||
if [ -z "${ITERM2_SHOULD_DECORATE_PROMPT-}" ]; then
|
||||
# You pressed ^C while entering a command (iterm2_preexec did not run)
|
||||
iterm2_before_cmd_executes
|
||||
if [ "$PS1" != "${ITERM2_DECORATED_PS1-}" ]; then
|
||||
# PS1 changed, perhaps in another precmd. See issue 9938.
|
||||
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
||||
fi
|
||||
fi
|
||||
|
||||
iterm2_after_cmd_executes "$STATUS"
|
||||
|
||||
if [ -n "$ITERM2_SHOULD_DECORATE_PROMPT" ]; then
|
||||
iterm2_decorate_prompt
|
||||
fi
|
||||
}
|
||||
|
||||
# This is not run if you press ^C while entering a command.
|
||||
iterm2_preexec() {
|
||||
# Set PS1 back to its raw value prior to executing the command.
|
||||
PS1="$ITERM2_PRECMD_PS1"
|
||||
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
||||
iterm2_before_cmd_executes
|
||||
}
|
||||
|
||||
# If hostname -f is slow on your system set iterm2_hostname prior to
|
||||
# sourcing this script. We know it is fast on macOS so we don't cache
|
||||
# it. That lets us handle the hostname changing like when you attach
|
||||
# to a VPN.
|
||||
if [ -z "${iterm2_hostname-}" ]; then
|
||||
if [ "$(uname)" != "Darwin" ]; then
|
||||
iterm2_hostname=`hostname -f 2>/dev/null`
|
||||
# Some flavors of BSD (i.e. NetBSD and OpenBSD) don't have the -f option.
|
||||
if [ $? -ne 0 ]; then
|
||||
iterm2_hostname=`hostname`
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ -z ${precmd_functions-} ]] && precmd_functions=()
|
||||
precmd_functions=($precmd_functions iterm2_precmd)
|
||||
|
||||
[[ -z ${preexec_functions-} ]] && preexec_functions=()
|
||||
preexec_functions=($preexec_functions iterm2_preexec)
|
||||
|
||||
iterm2_print_state_data
|
||||
printf "\033]1337;ShellIntegrationVersion=14;shell=zsh\007"
|
||||
fi
|
||||
fi
|
||||
4
plugins/iterm2/update
Executable file
4
plugins/iterm2/update
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
curl -s -L https://iterm2.com/shell_integration/zsh \
|
||||
-o iterm2_shell_integration.zsh
|
||||
|
|
@ -126,5 +126,7 @@ Naming convention:
|
|||
- `jaddr <app_name> [unit_num]`: display app or unit IP address.
|
||||
- `jreld <relation_name> <app_name> <unit_num>`: display app and unit relation data.
|
||||
- `jclean`: destroy all controllers
|
||||
- `jcontroller`: display the controller your are connected to.
|
||||
- `jmodel`: display the model your are connected to.
|
||||
- `wjst [interval_secs] [args_for_watch]`: watch juju status, with optional interval
|
||||
(default: 5s); you may pass additional arguments to `watch`.
|
||||
|
|
|
|||
|
|
@ -163,10 +163,40 @@ jreld() {
|
|||
juju run "relation-get -r $relid - $2" --unit $2/$3
|
||||
}
|
||||
|
||||
# Return Juju current controller
|
||||
jcontroller() {
|
||||
local controller="$(awk '/current-controller/ {print $2}' ~/.local/share/juju/controllers.yaml)"
|
||||
if [[ -z "$controller" ]]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo $controller
|
||||
return 0
|
||||
}
|
||||
|
||||
# Return Juju current model
|
||||
jmodel() {
|
||||
local yqbin="$(whereis yq | awk '{print $2}')"
|
||||
|
||||
if [[ -z "$yqbin" ]]; then
|
||||
echo "--"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local model="$(yq e ".controllers.$(jcontroller).current-model" < ~/.local/share/juju/models.yaml | cut -d/ -f2)"
|
||||
|
||||
if [[ -z "$model" ]]; then
|
||||
echo "--"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo $model
|
||||
return 0
|
||||
}
|
||||
|
||||
# Watch juju status, with optional interval (default: 5 sec)
|
||||
wjst() {
|
||||
local interval="${1:-5}"
|
||||
shift $(( $# > 0 ))
|
||||
watch -n "$interval" --color juju status --relations --color "$@"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ Original author: [Sorin Ionescu](https://github.com/sorin-ionescu)
|
|||
| `pxd` | Return the current Xcode project directory |
|
||||
| `cdx` | `cd` to the current Xcode project directory |
|
||||
| `quick-look` | Quick-Look a specified file |
|
||||
| `man-preview` | Open a specified man page in Preview app |
|
||||
| `man-preview` | Open man pages in Preview app |
|
||||
| `showfiles` | Show hidden files in Finder |
|
||||
| `hidefiles` | Hide the hidden files in Finder |
|
||||
| `itunes` | _DEPRECATED_. Use `music` from macOS Catalina on |
|
||||
|
|
|
|||
|
|
@ -224,9 +224,10 @@ function quick-look() {
|
|||
}
|
||||
|
||||
function man-preview() {
|
||||
local location
|
||||
# Don't let Preview.app steal focus if the man page doesn't exist
|
||||
location=$(man -w "$@") && mandoc -Tpdf $location | open -f -a Preview
|
||||
local page
|
||||
for page in "${(@f)"$(man -w $@)"}"; do
|
||||
command mandoc -Tpdf $page | open -f -a Preview
|
||||
done
|
||||
}
|
||||
compdef _man man-preview
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,5 @@
|
|||
# If marked is passed a file, open it in Marked
|
||||
#
|
||||
function marked() {
|
||||
if [ "$1" ]
|
||||
then
|
||||
open -a "marked 2.app" "$1"
|
||||
else
|
||||
open -a "marked 2.app"
|
||||
fi
|
||||
open -a "marked 2.app" "$1"
|
||||
}
|
||||
|
|
|
|||
17
plugins/marktext/README.md
Normal file
17
plugins/marktext/README.md
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
## marktext
|
||||
|
||||
Plugin for MarkText, a previewer for Markdown files on Mac OS X
|
||||
|
||||
### Requirements
|
||||
|
||||
* [MarkText](https://github.com/marktext/marktext)
|
||||
|
||||
### Usage
|
||||
|
||||
* If `marktext` is called without an argument, open MarkText
|
||||
|
||||
* If `marktext` is passed a file, open it in MarkText
|
||||
|
||||
### Credits
|
||||
|
||||
* just copied from plugins/marked2, all credits to marked2 plugin author
|
||||
7
plugins/marktext/marktext.plugin.zsh
Normal file
7
plugins/marktext/marktext.plugin.zsh
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#
|
||||
# If marktext is called without an argument, open MarkText
|
||||
# If marktext is passed a file, open it in MarkText
|
||||
#
|
||||
function marktext() {
|
||||
open -a "MarkText.app" "$1"
|
||||
}
|
||||
20
plugins/nodenv/README.md
Normal file
20
plugins/nodenv/README.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# nodenv plugin
|
||||
|
||||
The primary job of this plugin is to provide `nodenv_prompt_info` which can be added to your theme to include Node
|
||||
version information into your prompt.
|
||||
|
||||
To use it, add `nodenv` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... nodenv)
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
* `nodenv_prompt_info`: displays the Node version in use by nodenv; or the global Node
|
||||
version, if nodenv wasn't found. You can use this function in your prompt by adding
|
||||
`$(nodenv_prompt_info)` to PROMPT or RPROMPT:
|
||||
|
||||
```zsh
|
||||
RPROMPT='$(nodenv_prompt_info)'
|
||||
```
|
||||
43
plugins/nodenv/nodenv.plugin.zsh
Normal file
43
plugins/nodenv/nodenv.plugin.zsh
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# This plugin loads nodenv into the current shell and provides prompt info via
|
||||
# the 'nodenv_prompt_info' function.
|
||||
|
||||
FOUND_NODENV=${+commands[nodenv]}
|
||||
|
||||
if [[ $FOUND_NODENV -ne 1 ]]; then
|
||||
nodenvdirs=(
|
||||
"$HOME/.nodenv"
|
||||
"/usr/local/nodenv"
|
||||
"/opt/nodenv"
|
||||
"/usr/local/opt/nodenv"
|
||||
)
|
||||
for dir in $nodenvdirs; do
|
||||
if [[ -d "${dir}/bin" ]]; then
|
||||
export PATH="$PATH:${dir}/bin"
|
||||
FOUND_NODENV=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ $FOUND_NODENV -ne 1 ]]; then
|
||||
if (( $+commands[brew] )) && dir=$(brew --prefix nodenv 2>/dev/null); then
|
||||
if [[ -d "${dir}/bin" ]]; then
|
||||
export PATH="$PATH:${dir}/bin"
|
||||
FOUND_NODENV=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $FOUND_NODENV -eq 1 ]]; then
|
||||
eval "$(nodenv init --no-rehash - zsh)"
|
||||
function nodenv_prompt_info() {
|
||||
nodenv version-name 2>/dev/null
|
||||
}
|
||||
else
|
||||
# fallback to system node
|
||||
function nodenv_prompt_info() {
|
||||
echo "system: $(node -v 2>&1 | cut -c 2-)"
|
||||
}
|
||||
fi
|
||||
|
||||
unset FOUND_NODENV nodenvdirs dir
|
||||
|
|
@ -47,6 +47,7 @@ plugins=(... rails)
|
|||
| `rsp` | `rails server --port` | Launch a web server and specify the listening port |
|
||||
| `rsts` | `rails stats` | Print code statistics |
|
||||
| `rt` | `rails test` | Run Rails tests |
|
||||
| `rta` | `rails test:all` | Runs all Rails tests, including system tests |
|
||||
| `ru` | `rails runner` | Run Ruby code in the context of Rails |
|
||||
|
||||
### Foreman
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ alias rsd='rails server --debugger'
|
|||
alias rsp='rails server --port'
|
||||
alias rsts='rails stats'
|
||||
alias rt='rails test'
|
||||
alias rta='rails test:all'
|
||||
alias ru='rails runner'
|
||||
|
||||
# Foreman aliases
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ plugins=(... rvm)
|
|||
| `rb27` | `rvm use ruby-2.7` |
|
||||
| `rb30` | `rvm use ruby-3.0` |
|
||||
| `rb31` | `rvm use ruby-3.1` |
|
||||
| `rb32` | `rvm use ruby-3.2` |
|
||||
| `rvm-update` | `rvm get head` |
|
||||
| `gems` | `gem list` |
|
||||
| `rvms` | `rvm gemset` |
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ rubies=(
|
|||
27 'ruby-2.7'
|
||||
30 'ruby-3.0'
|
||||
31 'ruby-3.1'
|
||||
32 'ruby-3.2'
|
||||
)
|
||||
|
||||
for v in ${(k)rubies}; do
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ plugins=(... terraform)
|
|||
| ----- | -------------------- |
|
||||
| `tf` | `terraform` |
|
||||
| `tfa` | `terraform apply` |
|
||||
| `tfc` | `terraform console` |
|
||||
| `tfd` | `terraform destroy` |
|
||||
| `tff` | `terraform fmt` |
|
||||
| `tfi` | `terraform init` |
|
||||
|
|
|
|||
411
plugins/terraform/_terraform
Normal file
411
plugins/terraform/_terraform
Normal file
|
|
@ -0,0 +1,411 @@
|
|||
#compdef terraform
|
||||
|
||||
local -a _terraform_cmds opt_args
|
||||
_terraform_cmds=(
|
||||
'apply:Builds or changes infrastructure'
|
||||
'console:Interactive console for Terraform interpolations'
|
||||
'destroy:Destroy Terraform-managed infrastructure'
|
||||
'fmt:Rewrites config files to canonical format'
|
||||
'force-unlock:Manually unlock the terraform state'
|
||||
'get:Download and install modules for the configuration'
|
||||
'graph:Create a visual graph of Terraform resources'
|
||||
'import:Import existing infrastructure into Terraform'
|
||||
'init:Initialize a Terraform working directory'
|
||||
'login:Obtain and save credentials for a remote host'
|
||||
'logout:Remove locally-stored credentials for a remote host'
|
||||
'output:Read an output from a state file'
|
||||
'plan:Generate and show an execution plan'
|
||||
'providers:Prints a tree of the providers used in the configuration'
|
||||
'refresh:Update local state file against real resources'
|
||||
'show:Inspect Terraform state or plan'
|
||||
'state:Advanced state management'
|
||||
'taint:Manually mark a resource for recreation'
|
||||
'untaint:Manually unmark a resource as tainted'
|
||||
'validate:Validates the Terraform files'
|
||||
'version:Prints the Terraform version'
|
||||
'workspace:Workspace management'
|
||||
'0.12upgrade:Rewrites pre-0.12 module source code for v0.12'
|
||||
'0.13upgrade:Rewrites pre-0.13 module source code for v0.13'
|
||||
)
|
||||
|
||||
__012upgrade() {
|
||||
_arguments \
|
||||
'-yes[Skip the initial introduction messages and interactive confirmation. This can be used to run this command in batch from a script.]' \
|
||||
'-force[ Override the heuristic that attempts to detect if a configuration is already written for v0.12 or later. Some of the transformations made by this command are not idempotent, so re-running against the same module may change the meanings expressions in the module.]'
|
||||
}
|
||||
|
||||
__013upgrade() {
|
||||
_arguments \
|
||||
'-yes[Skip the initial introduction messages and interactive confirmation. This can be used to run this command in batch from a script.]'
|
||||
}
|
||||
|
||||
__apply() {
|
||||
_arguments \
|
||||
'-auto-approve[Skip interactive approval of plan before applying.]' \
|
||||
'-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \
|
||||
'-compact-warnings[If Terraform produces any warnings that are not accompanied by errors, show them in a more compact form that includes only the summary messages.]' \
|
||||
'-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \
|
||||
'-lock-timeout=[(0s) Duration to retry a state lock.]' \
|
||||
'-input=[(true) Ask for input for variables if not directly set.]' \
|
||||
'-no-color[If specified, output will be colorless.]' \
|
||||
'-parallelism=[(10) Limit the number of parallel resource operations.]' \
|
||||
'-refresh=[(true) Update state prior to checking for differences. This has no effect if a plan file is given to apply.]' \
|
||||
'-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]:statefile:_files -g "*.tfstate"' \
|
||||
'-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -g "*.tfstate"' \
|
||||
'*-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]:target:__statelist' \
|
||||
'*-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \
|
||||
'*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"'
|
||||
}
|
||||
|
||||
__console() {
|
||||
_arguments \
|
||||
'-state=[(terraform.tfstate) Path to read state.]' \
|
||||
'*-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \
|
||||
'*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"'
|
||||
}
|
||||
|
||||
__destroy() {
|
||||
_arguments \
|
||||
'-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \
|
||||
'-auto-approve[Skip interactive approval before destroying.]' \
|
||||
'-force[Deprecated: same as auto-approve.]' \
|
||||
'-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \
|
||||
'-lock-timeout=[(0s) Duration to retry a state lock.]' \
|
||||
'-no-color[If specified, output will contain no color.]' \
|
||||
'-parallelism=[(10) Limit the number of concurrent operations.]' \
|
||||
'-refresh=[(true) Update state prior to checking for differences. This has no effect if a plan file is given to apply.]' \
|
||||
'-state=[(terraform.tfstate) Path to read and save state (unless state-out is specified).]:statefile:_files -g "*.tfstate"' \
|
||||
'-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -g "*.tfstate"' \
|
||||
'*-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]:target:__statelist' \
|
||||
'*-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \
|
||||
'*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"'
|
||||
}
|
||||
|
||||
__fmt() {
|
||||
_arguments \
|
||||
'-list=[(true) List files whose formatting differs (always false if using STDIN)]' \
|
||||
'-write=[(true) Write result to source file instead of STDOUT (always false if using STDIN or -check)]' \
|
||||
'-diff=[(false) Display diffs of formatting changes]' \
|
||||
'-check=[(false) Check if the input is formatted. Exit status will be 0 if all input is properly formatted and non-zero otherwise.]' \
|
||||
'-recursive=[(false) Also process files in subdirectories. By default, only the given directory (or current directory) is processed.]'
|
||||
}
|
||||
|
||||
__force_unlock() {
|
||||
_arguments \
|
||||
"-force[Don't ask for input for unlock confirmation.]"
|
||||
}
|
||||
|
||||
__get() {
|
||||
_arguments \
|
||||
'-update=[(false) If true, modules already downloaded will be checked for updates and updated if necessary.]' \
|
||||
'-no-color[Disable text coloring in the output.]'
|
||||
}
|
||||
|
||||
__graph() {
|
||||
_arguments \
|
||||
'-draw-cycles[Highlight any cycles in the graph with colored edges. This helps when diagnosing cycle errors.]' \
|
||||
'-type=[(plan) Type of graph to output. Can be: plan, plan-destroy, apply, validate, input, refresh.]'
|
||||
}
|
||||
|
||||
__import() {
|
||||
_arguments \
|
||||
'-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \
|
||||
'-config=[(path) Path to a directory of Terraform configuration files to use to configure the provider. Defaults to pwd. If no config files are present, they must be provided via the input prompts or env vars.]' \
|
||||
'-allow-missing-config[Allow import when no resource configuration block exists.]' \
|
||||
'-input=[(true) Ask for input for variables if not directly set.]' \
|
||||
'-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \
|
||||
'-lock-timeout=[(0s) Duration to retry a state lock.]' \
|
||||
'-no-color[If specified, output will contain no color.]' \
|
||||
'-state=[(PATH) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]:statefile:_files -g "*.tfstate"' \
|
||||
'-state-out=[(PATH) Path to the destination state file to write to. If this is not specified, the source state file will be used. This can be a new or existing path.]:statefile:_files -g "*.tfstate"' \
|
||||
'*-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times. This is only useful with the "-config" flag.]' \
|
||||
'*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"'
|
||||
}
|
||||
|
||||
__init() {
|
||||
_arguments \
|
||||
'-backend=[(true) Configure the backend for this configuration.]' \
|
||||
'-backend-config=[This can be either a path to an HCL file with key/value assignments (same format as terraform.tfvars) or a 'key=value' format. This is merged with what is in the configuration file. This can be specified multiple times. The backend type must be in the configuration itself.]' \
|
||||
'-force-copy[Suppress prompts about copying state data. This is equivalent to providing a "yes" to all confirmation prompts.]' \
|
||||
'-from-module=[(SOURCE) Copy the contents of the given module into the target directory before initialization.]' \
|
||||
'-get=[(true) Download any modules for this configuration.]' \
|
||||
'-get-plugins=[(true) Download any missing plugins for this configuration.]' \
|
||||
'-input=[(true) Ask for input if necessary. If false, will error if input was required.]' \
|
||||
'-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \
|
||||
'-lock-timeout=[(0s) Duration to retry a state lock.]' \
|
||||
'-no-color[If specified, output will contain no color.]' \
|
||||
'-plugin-dir[Directory containing plugin binaries. This overrides all default search paths for plugins, and prevents the automatic installation of plugins. This flag can be used multiple times.]:plugin_dir:_files -/' \
|
||||
'-reconfigure[Reconfigure the backend, ignoring any saved configuration.]' \
|
||||
'-upgrade=[(false) If installing modules (-get) or plugins (-get-plugins), ignore previously-downloaded objects and install the latest version allowed within configured constraints.]' \
|
||||
'-verify-plugins=[(true) Verify the authenticity and integrity of automatically downloaded plugins.]'
|
||||
}
|
||||
|
||||
__login() {
|
||||
_arguments \
|
||||
|
||||
}
|
||||
|
||||
__logout() {
|
||||
_arguments \
|
||||
|
||||
}
|
||||
|
||||
__output() {
|
||||
_arguments \
|
||||
'-state=[(path) Path to the state file to read. Defaults to "terraform.tfstate".]:statefile:_files -g "*.tfstate"' \
|
||||
'-no-color[If specified, output will contain no color.]' \
|
||||
'-json[If specified, machine readable output will be printed in JSON format]'
|
||||
}
|
||||
|
||||
__plan() {
|
||||
_arguments \
|
||||
'-compact-warnings[If Terraform produces any warnings that are not accompanied by errors, show them in a more compact form that includes only the summary messages.]' \
|
||||
'-destroy[If set, a plan will be generated to destroy all resources managed by the given configuration and state.]' \
|
||||
'-detailed-exitcode[() Return detailed exit codes when the command exits. This will change the meaning of exit codes to: 0 - Succeeded, diff is empty (no changes); 1 - Errored, 2 - Succeeded; there is a diff]' \
|
||||
'-input=[(true) Ask for input for variables if not directly set.]' \
|
||||
'-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \
|
||||
'-lock-timeout=[(0s) Duration to retry a state lock.]' \
|
||||
'-no-color[() If specified, output will contain no color.]' \
|
||||
'-out=[(path) Write a plan file to the given path. This can be used as input to the "apply" command.]' \
|
||||
'-parallelism=[(10) Limit the number of concurrent operations.]' \
|
||||
'-refresh=[(true) Update state prior to checking for differences.]' \
|
||||
'-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default it will use the state "terraform.tfstate" if it exists.]:statefile:_files -g "*.tfstate"' \
|
||||
'*-target=[(resource) Resource to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]:target:__statelist' \
|
||||
'*-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \
|
||||
'*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"'
|
||||
}
|
||||
|
||||
__providers() {
|
||||
local -a __providers_cmds
|
||||
__providers_cmds=(
|
||||
'mirror:Mirrors the provider plugins needed for the current configuration'
|
||||
'schema:Prints the schemas of the providers used in the configuration'
|
||||
)
|
||||
_describe -t providers "providers commands" __providers_cmds
|
||||
|
||||
}
|
||||
|
||||
__providers_mirror() {
|
||||
_arguments \
|
||||
'-platform=[(os_arch) Choose which target platform to build a mirror for.]' \
|
||||
"*:target_dir:_files -/"
|
||||
}
|
||||
|
||||
__providers_schema() {
|
||||
_arguments \
|
||||
'-json[]' \
|
||||
'::'
|
||||
}
|
||||
|
||||
__refresh() {
|
||||
_arguments \
|
||||
'-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]::backupfile:_files -g "*.backup"' \
|
||||
'-compact-warnings[If Terraform produces any warnings that are not accompanied by errors, show them in a more compact form that includes only the summary messages.]' \
|
||||
'-input=[(true) Ask for input for variables if not directly set.]' \
|
||||
'-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \
|
||||
'-lock-timeout=[(0s) Duration to retry a state lock.]' \
|
||||
'-no-color[If specified, output will not contain any color.]' \
|
||||
'-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]:statefile:_files -g "*.tfstate"' \
|
||||
'-state-out=[(path) Path to write state to that is different than "-state". This can be used to preserve the old state.]:statefile:_files -g "*.tfstate"' \
|
||||
'*-target=[(resource) A Resource Address to target. Operation will be limited to this resource and its dependencies. This flag can be used multiple times.]:target:__statelist' \
|
||||
'*-var[("foo=bar") Set a variable in the Terraform configuration. This flag can be set multiple times.]' \
|
||||
'*-var-file=[(foo) Set variables in the Terraform configuration from a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded.]:file:_files -g "*.tfvars{,.json}"'
|
||||
}
|
||||
|
||||
__show() {
|
||||
_arguments \
|
||||
'-json[If specified, output the Terraform plan or state in a machine-readable form.]' \
|
||||
'-no-color[If specified, output will not contain any color.]'
|
||||
}
|
||||
|
||||
__state() {
|
||||
local -a __state_cmds
|
||||
__state_cmds=(
|
||||
'list:List resources in the state'
|
||||
'mv:Move an item in the state'
|
||||
'pull:Pull current state and output to stdout'
|
||||
'push:Update remote state from a local state file'
|
||||
'replace-provider:Replace provider for resources in the Terraform state'
|
||||
'rm:Remove instances from the state'
|
||||
'show:Show a resource in the state'
|
||||
)
|
||||
_describe -t state "state commands" __state_cmds
|
||||
}
|
||||
|
||||
__state_list() {
|
||||
_arguments \
|
||||
'-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default, Terraform will consult the state of the currently-selected workspace.]' \
|
||||
'-id=[(id) Filters the results to include only instances whose resource types have an attribute named id whose value equals the given id string.]' \
|
||||
"*:address:__statelist"
|
||||
}
|
||||
|
||||
__state_mv() {
|
||||
_arguments \
|
||||
"-dry-run[If set, prints out what would've been moved but doesn't actually move anything.]" \
|
||||
'-backup=[(PATH) Path where Terraform should write the backup for the original state. This can"t be disabled. If not set, Terraform will write it to the same path as the statefile with a ".backup" extension.]:backupfile:_files -g "*.backup"' \
|
||||
'-backup-out=[(PATH) Path where Terraform should write the backup for the destination state. This can"t be disabled. If not set, Terraform will write it to the same path as the destination state file with a backup extension. This only needs to be specified if -state-out is set to a different path than -state.]:backupfile:_files -g "*.backup"' \
|
||||
"-lock=[(true) Lock the state files when locking is supported.]:lock:(true false)" \
|
||||
"-lock-timeout=[(0s) Duration to retry a state lock.]" \
|
||||
'-state=[(path) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]:statefile:_files -g "*.tfstate"' \
|
||||
'-state-out=[(path) Path to the destination state file to write to. If this isn"t specified, the source state file will be used. This can be a new or existing path.]:statefile:_files -g "*.tfstate"' \
|
||||
"::" \
|
||||
":source:__statelist" \
|
||||
":destination: "
|
||||
}
|
||||
|
||||
__state_push() {
|
||||
_arguments \
|
||||
"-force[Write the state even if lineages don't match or the remote serial is higher.]" \
|
||||
'-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \
|
||||
"-lock-timeout=[(0s) Duration to retry a state lock.]" \
|
||||
"::" \
|
||||
":destination:_files"
|
||||
}
|
||||
|
||||
__state_replace_provider() {
|
||||
_arguments \
|
||||
'-auto-approve[Skip interactive approval.]' \
|
||||
'-backup=[(PATH) Path where Terraform should write the backup for the state file. This can"t be disabled. If not set, Terraform will write it to the same path as the state file with a ".backup" extension.]:backupfile:_files -g "*.backup"' \
|
||||
"-lock=[(true) Lock the state files when locking is supported.]:lock:(true false)" \
|
||||
"-lock-timeout=[(0s) Duration to retry a state lock.]" \
|
||||
'-state=[(PATH) Path to the source state file. Defaults to the configured backend, or "terraform.tfstate"]:statefile:_files -g "*.tfstate"' \
|
||||
":from_provider_fqn:" \
|
||||
":to_provider_fqn:"
|
||||
}
|
||||
|
||||
__state_rm() {
|
||||
_arguments \
|
||||
"-dry-run[If set, prints out what would've been removed but doesn't actually remove anything.]" \
|
||||
'-backup=[(PATH) Path where Terraform should write the backup for the original state.]::backupfile:_files -g "*.backup"' \
|
||||
"-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)" \
|
||||
"-lock-timeout=[(0s) Duration to retry a state lock.]" \
|
||||
'-state=[(PATH) Path to the state file to update. Defaults to the current workspace state.]:statefile:_files -g "*.tfstate"' \
|
||||
"*:address:__statelist"
|
||||
}
|
||||
|
||||
|
||||
__state_show() {
|
||||
_arguments \
|
||||
'-state=[(statefile) Path to a Terraform state file to use to look up Terraform-managed resources. By default it will use the state "terraform.tfstate" if it exists.]:statefile:_files -g "*.tfstate"' \
|
||||
"*:address:__statelist"
|
||||
}
|
||||
|
||||
__statelist() {
|
||||
compadd $(terraform state list $opt_args[-state])
|
||||
}
|
||||
|
||||
__taint() {
|
||||
_arguments \
|
||||
'-allow-missing[If specified, the command will succeed (exit code 0) even if the resource is missing.]' \
|
||||
'-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \
|
||||
'-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \
|
||||
'-lock-timeout=[(0s) Duration to retry a state lock.]' \
|
||||
'-module=[(path) The module path where the resource lives. By default this will be root. Child modules can be specified by names. Ex. "consul" or "consul.vpc" (nested modules).]' \
|
||||
'-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]:statefile:_files -g "*.tfstate"' \
|
||||
'-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]:statefile:_files -g "*.tfstate"' \
|
||||
"*:address:__statelist"
|
||||
}
|
||||
|
||||
__untaint() {
|
||||
_arguments \
|
||||
'-allow-missing[If specified, the command will succeed (exit code 0) even if the resource is missing.]' \
|
||||
'-backup=[(path) Path to backup the existing state file before modifying. Defaults to the "-state-out" path with ".backup" extension. Set to "-" to disable backup.]:backupfile:_files -g "*.backup"' \
|
||||
'-lock=[(true) Lock the state file when locking is supported.]:lock:(true false)' \
|
||||
'-lock-timeout=[(0s) Duration to retry a state lock.]' \
|
||||
'-module=[(path) The module path where the resource lives. By default this will be root. Child modules can be specified by names. Ex. "consul" or "consul.vpc" (nested modules).]' \
|
||||
'-state=[(path) Path to read and save state (unless state-out is specified). Defaults to "terraform.tfstate".]:statefile:_files -g "*.tfstate"' \
|
||||
'-state-out=[(path) Path to write updated state file. By default, the "-state" path will be used.]:statefile:_files -g "*.tfstate"'
|
||||
}
|
||||
|
||||
__validate() {
|
||||
_arguments \
|
||||
'-no-color[If specified, output will not contain any color.]' \
|
||||
'-json[Produce output in a machine-readable JSON format, suitable for use in text editor integrations and other automated systems.]' \
|
||||
':dir:_files -/'
|
||||
}
|
||||
|
||||
__version() {
|
||||
_arguments \
|
||||
'-json[Output the version information as a JSON object.]'
|
||||
}
|
||||
|
||||
__workspace() {
|
||||
local -a __workspace_cmds
|
||||
__workspace_cmds=(
|
||||
'delete:Delete a workspace'
|
||||
'list:List Workspaces'
|
||||
'new:Create a new workspace'
|
||||
'select:Select a workspace'
|
||||
'show:Show the name of the current workspace'
|
||||
)
|
||||
_describe -t workspace "workspace commands" __workspace_cmds
|
||||
}
|
||||
|
||||
_arguments '*:: :->command'
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands "terraform command" _terraform_cmds
|
||||
return
|
||||
fi
|
||||
|
||||
local -a _command_args
|
||||
case "$words[1]" in
|
||||
0.12upgrade)
|
||||
__012upgrade ;;
|
||||
0.13upgrade)
|
||||
__013upgrade ;;
|
||||
apply)
|
||||
__apply ;;
|
||||
console)
|
||||
__console;;
|
||||
destroy)
|
||||
__destroy ;;
|
||||
fmt)
|
||||
__fmt;;
|
||||
force-unlock)
|
||||
__force_unlock;;
|
||||
get)
|
||||
__get ;;
|
||||
graph)
|
||||
__graph ;;
|
||||
import)
|
||||
__import;;
|
||||
init)
|
||||
__init ;;
|
||||
login)
|
||||
__login ;;
|
||||
logout)
|
||||
__logout ;;
|
||||
output)
|
||||
__output ;;
|
||||
plan)
|
||||
__plan ;;
|
||||
providers)
|
||||
test $CURRENT -lt 3 && __providers
|
||||
[[ $words[2] = "mirror" ]] && __providers_mirror
|
||||
[[ $words[2] = "schema" ]] && __providers_schema
|
||||
;;
|
||||
refresh)
|
||||
__refresh ;;
|
||||
show)
|
||||
__show ;;
|
||||
state)
|
||||
test $CURRENT -lt 3 && __state
|
||||
[[ $words[2] = "list" ]] && __state_list
|
||||
[[ $words[2] = "mv" ]] && __state_mv
|
||||
[[ $words[2] = "push" ]] && __state_push
|
||||
[[ $words[2] = "replace-provider" ]] && __state_replace_provider
|
||||
[[ $words[2] = "rm" ]] && __state_rm
|
||||
[[ $words[2] = "show" ]] && __state_show
|
||||
;;
|
||||
taint)
|
||||
__taint ;;
|
||||
untaint)
|
||||
__untaint ;;
|
||||
validate)
|
||||
__validate ;;
|
||||
version)
|
||||
__version ;;
|
||||
workspace)
|
||||
test $CURRENT -lt 3 && __workspace ;;
|
||||
esac
|
||||
|
|
@ -10,14 +10,10 @@ function tf_prompt_info() {
|
|||
|
||||
alias tf='terraform'
|
||||
alias tfa='terraform apply'
|
||||
alias tfc='terraform console'
|
||||
alias tfd='terraform destroy'
|
||||
alias tff='terraform fmt'
|
||||
alias tfi='terraform init'
|
||||
alias tfo='terraform output'
|
||||
alias tfp='terraform plan'
|
||||
alias tfv='terraform validate'
|
||||
|
||||
if (( $+commands[terraform] )); then
|
||||
autoload -U +X bashcompinit && bashcompinit
|
||||
complete -o nospace -C terraform terraform
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ plugins=(... vi-mode)
|
|||
VI_MODE_SET_CURSOR=true
|
||||
```
|
||||
|
||||
See [Cursor Styles](#cursor-styles) for controlling how the cursor looks in different modes
|
||||
|
||||
- `MODE_INDICATOR`: controls the string displayed when the shell is in normal mode.
|
||||
See [Mode indicators](#mode-indicators) for details.
|
||||
|
||||
|
|
@ -49,8 +51,42 @@ MODE_INDICATOR="%F{white}+%f"
|
|||
INSERT_MODE_INDICATOR="%F{yellow}+%f"
|
||||
```
|
||||
|
||||
You can also use the `vi_mode_prompt_info` function in your prompt, which will display
|
||||
this mode indicator.
|
||||
### Adding mode indicators to your prompt
|
||||
|
||||
`Vi-mode` by default will add mode indicators to `RPROMPT` **unless** that is defined by
|
||||
a preceding plugin.
|
||||
|
||||
If `PROMPT` or `RPROMPT` is not defined to your liking, you can add mode info manually. The `vi_mode_prompt_info` function is available to insert mode indicator information.
|
||||
|
||||
Here are some examples:
|
||||
|
||||
```bash
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
|
||||
PROMPT="$PROMPT\$(vi_mode_prompt_info)"
|
||||
RPROMPT="\$(vi_mode_prompt_info)$RPROMPT"
|
||||
```
|
||||
|
||||
Note the `\$` here, which importantly prevents interpolation at the time of defining, but allows it to be executed for each prompt update event.
|
||||
|
||||
## Cursor Styles
|
||||
|
||||
You can control the cursor style used in each active vim mode by changing the values of the following variables.
|
||||
|
||||
```zsh
|
||||
# defaults
|
||||
VI_MODE_CURSOR_NORMAL=2
|
||||
VI_MODE_CURSOR_VISUAL=6
|
||||
VI_MODE_CURSOR_INSERT=6
|
||||
VI_MODE_CURSOR_OPPEND=0
|
||||
```
|
||||
|
||||
- 0, 1 - Blinking block
|
||||
- 2 - Solid block
|
||||
- 3 - Blinking underline
|
||||
- 4 - Solid underline
|
||||
- 5 - Blinking line
|
||||
- 6 - Solid line
|
||||
|
||||
## Key bindings
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,15 @@ typeset -g VI_MODE_RESET_PROMPT_ON_MODE_CHANGE
|
|||
# Unset or set to any other value to do the opposite.
|
||||
typeset -g VI_MODE_SET_CURSOR
|
||||
|
||||
# Control how the cursor appears in the various vim modes. This only applies
|
||||
# if $VI_MODE_SET_CURSOR=true.
|
||||
#
|
||||
# See https://vt100.net/docs/vt510-rm/DECSCUSR for cursor styles
|
||||
typeset -g VI_MODE_CURSOR_NORMAL=2
|
||||
typeset -g VI_MODE_CURSOR_VISUAL=6
|
||||
typeset -g VI_MODE_CURSOR_INSERT=6
|
||||
typeset -g VI_MODE_CURSOR_OPPEND=0
|
||||
|
||||
typeset -g VI_KEYMAP=main
|
||||
|
||||
function _vi-mode-set-cursor-shape-for-keymap() {
|
||||
|
|
@ -22,13 +31,13 @@ function _vi-mode-set-cursor-shape-for-keymap() {
|
|||
# https://vt100.net/docs/vt510-rm/DECSCUSR
|
||||
local _shape=0
|
||||
case "${1:-${VI_KEYMAP:-main}}" in
|
||||
main) _shape=6 ;; # vi insert: line
|
||||
viins) _shape=6 ;; # vi insert: line
|
||||
isearch) _shape=6 ;; # inc search: line
|
||||
command) _shape=6 ;; # read a command name
|
||||
vicmd) _shape=2 ;; # vi cmd: block
|
||||
visual) _shape=2 ;; # vi visual mode: block
|
||||
viopp) _shape=0 ;; # vi operation pending: blinking block
|
||||
main) _shape=$VI_MODE_CURSOR_INSERT ;; # vi insert: line
|
||||
viins) _shape=$VI_MODE_CURSOR_INSERT ;; # vi insert: line
|
||||
isearch) _shape=$VI_MODE_CURSOR_INSERT ;; # inc search: line
|
||||
command) _shape=$VI_MODE_CURSOR_INSERT ;; # read a command name
|
||||
vicmd) _shape=$VI_MODE_CURSOR_NORMAL ;; # vi cmd: block
|
||||
visual) _shape=$VI_MODE_CURSOR_VISUAL ;; # vi visual mode: block
|
||||
viopp) _shape=$VI_MODE_CURSOR_OPPEND ;; # vi operation pending: blinking block
|
||||
*) _shape=0 ;;
|
||||
esac
|
||||
printf $'\e[%d q' "${_shape}"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
# dashed separator size
|
||||
function afmagic_dashes {
|
||||
# check either virtualenv or condaenv variables
|
||||
local python_env="${VIRTUAL_ENV:-$CONDA_DEFAULT_ENV}"
|
||||
local python_env_dir="${VIRTUAL_ENV:-$CONDA_DEFAULT_ENV}"
|
||||
local python_env="${python_env_dir##*/}"
|
||||
|
||||
# if there is a python virtual environment and it is displayed in
|
||||
# the prompt, account for it when returning the number of dashes
|
||||
|
|
|
|||
|
|
@ -95,7 +95,8 @@ function update_last_updated_file() {
|
|||
}
|
||||
|
||||
function update_ohmyzsh() {
|
||||
if ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" --interactive; then
|
||||
zstyle -s ':omz:update' verbose verbose_mode || verbose_mode=default
|
||||
if ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" -i -v $verbose_mode; then
|
||||
update_last_updated_file
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,15 @@
|
|||
if hash chsh >/dev/null 2>&1 && [ -f ~/.shell.pre-oh-my-zsh ]; then
|
||||
old_shell=$(cat ~/.shell.pre-oh-my-zsh)
|
||||
echo "Switching your shell back to '$old_shell':"
|
||||
if chsh -s "$old_shell"; then
|
||||
rm -f ~/.shell.pre-oh-my-zsh
|
||||
else
|
||||
echo "Could not change default shell. Change it manually by running chsh"
|
||||
echo "or editing the /etc/passwd file."
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
read -r -p "Are you sure you want to remove Oh My Zsh? [y/N] " confirmation
|
||||
if [ "$confirmation" != y ] && [ "$confirmation" != Y ]; then
|
||||
echo "Uninstall cancelled"
|
||||
|
|
@ -25,16 +37,5 @@ else
|
|||
echo "No original zsh config found"
|
||||
fi
|
||||
|
||||
if hash chsh >/dev/null 2>&1 && [ -f ~/.shell.pre-oh-my-zsh ]; then
|
||||
old_shell=$(cat ~/.shell.pre-oh-my-zsh)
|
||||
echo "Switching your shell back to '$old_shell':"
|
||||
if chsh -s "$old_shell"; then
|
||||
rm -f ~/.shell.pre-oh-my-zsh
|
||||
else
|
||||
echo "Could not change default shell. Change it manually by running chsh"
|
||||
echo "or editing the /etc/passwd file."
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Thanks for trying out Oh My Zsh. It's been uninstalled."
|
||||
echo "Don't forget to restart your terminal!"
|
||||
|
|
|
|||
|
|
@ -12,6 +12,23 @@ esac
|
|||
|
||||
cd "$ZSH"
|
||||
|
||||
verbose_mode="default"
|
||||
interactive=false
|
||||
|
||||
while getopts "v:i" opt; do
|
||||
case $opt in
|
||||
v)
|
||||
if [[ $OPTARG == default || $OPTARG == minimal || $OPTARG == silent ]]; then
|
||||
verbose_mode=$OPTARG
|
||||
else
|
||||
echo "[oh-my-zsh] update verbosity '$OPTARG' is not valid"
|
||||
echo "[oh-my-zsh] valid options are 'default', 'minimal' and 'silent'"
|
||||
fi
|
||||
;;
|
||||
i) interactive=true ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Use colors, but only if connected to a terminal
|
||||
# and that terminal supports them.
|
||||
|
||||
|
|
@ -203,7 +220,9 @@ git checkout -q "$branch" -- || exit 1
|
|||
last_commit=$(git rev-parse "$branch")
|
||||
|
||||
# Update Oh My Zsh
|
||||
printf "${BLUE}%s${RESET}\n" "Updating Oh My Zsh"
|
||||
if [[ $verbose_mode != silent ]]; then
|
||||
printf "${BLUE}%s${RESET}\n" "Updating Oh My Zsh"
|
||||
fi
|
||||
if LANG= git pull --quiet --rebase $remote $branch; then
|
||||
# Check if it was really updated or not
|
||||
if [[ "$(git rev-parse HEAD)" = "$last_commit" ]]; then
|
||||
|
|
@ -215,24 +234,30 @@ if LANG= git pull --quiet --rebase $remote $branch; then
|
|||
git config oh-my-zsh.lastVersion "$last_commit"
|
||||
|
||||
# Print changelog to the terminal
|
||||
if [[ "$1" = --interactive ]]; then
|
||||
if [[ interactive == true && $verbose_mode == default ]] ; then
|
||||
"$ZSH/tools/changelog.sh" HEAD "$last_commit"
|
||||
fi
|
||||
|
||||
printf "${BLUE}%s \`${BOLD}%s${RESET}${BLUE}\`${RESET}\n" "You can see the changelog with" "omz changelog"
|
||||
if [[ $verbose_mode != silent ]]; then
|
||||
printf "${BLUE}%s \`${BOLD}%s${RESET}${BLUE}\`${RESET}\n" "You can see the changelog with" "omz changelog"
|
||||
fi
|
||||
fi
|
||||
|
||||
printf '%s %s__ %s %s %s %s %s__ %s\n' $RAINBOW $RESET
|
||||
printf '%s ____ %s/ /_ %s ____ ___ %s__ __ %s ____ %s_____%s/ /_ %s\n' $RAINBOW $RESET
|
||||
printf '%s / __ \\%s/ __ \\ %s / __ `__ \\%s/ / / / %s /_ / %s/ ___/%s __ \\ %s\n' $RAINBOW $RESET
|
||||
printf '%s/ /_/ /%s / / / %s / / / / / /%s /_/ / %s / /_%s(__ )%s / / / %s\n' $RAINBOW $RESET
|
||||
printf '%s\\____/%s_/ /_/ %s /_/ /_/ /_/%s\\__, / %s /___/%s____/%s_/ /_/ %s\n' $RAINBOW $RESET
|
||||
printf '%s %s %s %s /____/ %s %s %s %s\n' $RAINBOW $RESET
|
||||
printf '\n'
|
||||
printf "${BLUE}%s${RESET}\n\n" "$message"
|
||||
printf "${BLUE}${BOLD}%s %s${RESET}\n" "To keep up with the latest news and updates, follow us on Twitter:" "$(fmt_link @ohmyzsh https://twitter.com/ohmyzsh)"
|
||||
printf "${BLUE}${BOLD}%s %s${RESET}\n" "Want to get involved in the community? Join our Discord:" "$(fmt_link "Discord server" https://discord.gg/ohmyzsh)"
|
||||
printf "${BLUE}${BOLD}%s %s${RESET}\n" "Get your Oh My Zsh swag at:" "$(fmt_link "Planet Argon Shop" https://shop.planetargon.com/collections/oh-my-zsh)"
|
||||
if [[ $verbose_mode == default ]]; then
|
||||
printf '%s %s__ %s %s %s %s %s__ %s\n' $RAINBOW $RESET
|
||||
printf '%s ____ %s/ /_ %s ____ ___ %s__ __ %s ____ %s_____%s/ /_ %s\n' $RAINBOW $RESET
|
||||
printf '%s / __ \\%s/ __ \\ %s / __ `__ \\%s/ / / / %s /_ / %s/ ___/%s __ \\ %s\n' $RAINBOW $RESET
|
||||
printf '%s/ /_/ /%s / / / %s / / / / / /%s /_/ / %s / /_%s(__ )%s / / / %s\n' $RAINBOW $RESET
|
||||
printf '%s\\____/%s_/ /_/ %s /_/ /_/ /_/%s\\__, / %s /___/%s____/%s_/ /_/ %s\n' $RAINBOW $RESET
|
||||
printf '%s %s %s %s /____/ %s %s %s %s\n' $RAINBOW $RESET
|
||||
printf '\n'
|
||||
printf "${BLUE}%s${RESET}\n\n" "$message"
|
||||
printf "${BLUE}${BOLD}%s %s${RESET}\n" "To keep up with the latest news and updates, follow us on Twitter:" "$(fmt_link @ohmyzsh https://twitter.com/ohmyzsh)"
|
||||
printf "${BLUE}${BOLD}%s %s${RESET}\n" "Want to get involved in the community? Join our Discord:" "$(fmt_link "Discord server" https://discord.gg/ohmyzsh)"
|
||||
printf "${BLUE}${BOLD}%s %s${RESET}\n" "Get your Oh My Zsh swag at:" "$(fmt_link "Planet Argon Shop" https://shop.planetargon.com/collections/oh-my-zsh)"
|
||||
elif [[ $verbose_mode == minimal ]]; then
|
||||
printf "${BLUE}%s${RESET}\n" "$message"
|
||||
fi
|
||||
else
|
||||
ret=$?
|
||||
printf "${RED}%s${RESET}\n" 'There was an error updating. Try again later?'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue