mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-10-16 11:40:46 +00:00
Compare commits
1 commit
02e314ce9d
...
c00ddff5c4
Author | SHA1 | Date | |
---|---|---|---|
|
c00ddff5c4 |
61 changed files with 268 additions and 526 deletions
2
.github/dependencies.yml
vendored
2
.github/dependencies.yml
vendored
|
@ -28,7 +28,7 @@ dependencies:
|
|||
plugins/wd:
|
||||
repo: mfaerevaag/wd
|
||||
branch: master
|
||||
version: tag:v0.9.0
|
||||
version: tag:v0.7.1
|
||||
precopy: |
|
||||
set -e
|
||||
rm -r test
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
certifi==2024.8.30
|
||||
certifi==2024.7.4
|
||||
charset-normalizer==3.3.2
|
||||
idna==3.10
|
||||
idna==3.7
|
||||
PyYAML==6.0.2
|
||||
requests==2.32.3
|
||||
semver==3.0.2
|
||||
urllib3==2.2.3
|
||||
urllib3==2.2.2
|
||||
|
|
10
README.md
10
README.md
|
@ -167,15 +167,7 @@ ZSH_THEME="agnoster" # (this is one of the fancy ones)
|
|||
# see https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#agnoster
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> You will many times see screenshots for a zsh theme, and try it out, and find that it doesn't look the same for you.
|
||||
>
|
||||
> This is because many themes require installing a [Powerline Font](https://github.com/powerline/fonts) or a [Nerd Font](https://github.com/ryanoasis/nerd-fonts) in order to render properly.
|
||||
> Without them, these themes will render weird prompt symbols. Check out [the FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#i-have-a-weird-character-in-my-prompt) for more information.
|
||||
>
|
||||
> Also, beware that themes only control what your prompt looks like. This is, the text you see before or after your cursor, where you'll type your commands.
|
||||
> Themes don't control things such as the colors of your terminal window (known as _color scheme_) or the font of your terminal. These are settings that you can change in your terminal emulator.
|
||||
> For more information, see [what is a zsh theme](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#what-is-a-zsh-theme).
|
||||
_Note: many themes require installing a [Powerline Font](https://github.com/powerline/fonts) or a [Nerd Font](https://github.com/ryanoasis/nerd-fonts) in order to render properly. Without them, these themes will render [weird prompt symbols](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#i-have-a-weird-character-in-my-prompt)_
|
||||
|
||||
Open up a new terminal window and your prompt should look something like this:
|
||||
|
||||
|
|
|
@ -57,16 +57,6 @@ function takeurl() {
|
|||
cd "$thedir"
|
||||
}
|
||||
|
||||
function takezip() {
|
||||
local data thedir
|
||||
data="$(mktemp)"
|
||||
curl -L "$1" > "$data"
|
||||
unzip "$data" -d "./"
|
||||
thedir="$(unzip -l "$data" | awk 'NR==4 {print $4}' | sed 's/\/.*//')"
|
||||
rm "$data"
|
||||
cd "$thedir"
|
||||
}
|
||||
|
||||
function takegit() {
|
||||
git clone "$1"
|
||||
cd "$(basename ${1%%.git})"
|
||||
|
@ -75,8 +65,6 @@ function takegit() {
|
|||
function take() {
|
||||
if [[ $1 =~ ^(https?|ftp).*\.(tar\.(gz|bz2|xz)|tgz)$ ]]; then
|
||||
takeurl "$1"
|
||||
elif [[ $1 =~ ^(https?|ftp).*\.(zip)$ ]]; then
|
||||
takezip "$1"
|
||||
elif [[ $1 =~ ^([A-Za-z0-9]\+@|https?|git|ssh|ftps?|rsync).*\.git/?$ ]]; then
|
||||
takegit "$1"
|
||||
else
|
||||
|
|
14
lib/git.zsh
14
lib/git.zsh
|
@ -162,18 +162,6 @@ function git_current_branch() {
|
|||
echo ${ref#refs/heads/}
|
||||
}
|
||||
|
||||
# Outputs the name of the previously checked out branch
|
||||
# Usage example: git pull origin $(git_current_branch)
|
||||
# rev-parse --symbolic-full-name @{-1} only prints if it is a branch
|
||||
function git_previous_branch() {
|
||||
local ref
|
||||
ref=$(__git_prompt_git rev-parse --quiet --symbolic-full-name @{-1} 2> /dev/null)
|
||||
local ret=$?
|
||||
if [[ $ret != 0 ]] || [[ -z $ref ]]; then
|
||||
return # no git repo or non-branch previous ref
|
||||
fi
|
||||
echo ${ref#refs/heads/}
|
||||
}
|
||||
|
||||
# Gets the number of commits ahead from remote
|
||||
function git_commits_ahead() {
|
||||
|
@ -239,7 +227,7 @@ function _omz_git_prompt_status() {
|
|||
prefix_constant_map=(
|
||||
'\?\? ' 'UNTRACKED'
|
||||
'A ' 'ADDED'
|
||||
'M ' 'MODIFIED'
|
||||
'M ' 'ADDED'
|
||||
'MM ' 'MODIFIED'
|
||||
' M ' 'MODIFIED'
|
||||
'AM ' 'MODIFIED'
|
||||
|
|
|
@ -24,8 +24,8 @@ else
|
|||
if [[ -n "$GREP_OPTIONS" ]]; then
|
||||
# export grep, egrep and fgrep settings
|
||||
alias grep="grep $GREP_OPTIONS"
|
||||
alias egrep="grep -E"
|
||||
alias fgrep="grep -F"
|
||||
alias egrep="grep -E $GREP_OPTIONS"
|
||||
alias fgrep="grep -F $GREP_OPTIONS"
|
||||
|
||||
# write to cache file if cache directory is writable
|
||||
if [[ -w "$ZSH_CACHE_DIR" ]]; then
|
||||
|
|
|
@ -1,15 +1,9 @@
|
|||
# Do nothing if op is not installed
|
||||
(( ${+commands[op]} )) || return
|
||||
|
||||
# If the completion file doesn't exist yet, we need to autoload it and
|
||||
# bind it to `op`. Otherwise, compinit will have already done that.
|
||||
if [[ ! -f "$ZSH_CACHE_DIR/completions/_op" ]]; then
|
||||
typeset -g -A _comps
|
||||
autoload -Uz _op
|
||||
_comps[op]=_op
|
||||
fi
|
||||
|
||||
op completion zsh >| "$ZSH_CACHE_DIR/completions/_op" &|
|
||||
# Load op completion
|
||||
eval "$(op completion zsh)"
|
||||
compdef _op op
|
||||
|
||||
# Load opswd function
|
||||
autoload -Uz opswd
|
||||
|
|
|
@ -27,7 +27,7 @@ function opswd() {
|
|||
|
||||
local password
|
||||
# Copy the password to the clipboard
|
||||
if ! password=$(op item get "$service" --reveal --fields password 2>/dev/null); then
|
||||
if ! password=$(op item get "$service" --fields password 2>/dev/null); then
|
||||
echo "error: could not obtain password for $service"
|
||||
return 1
|
||||
fi
|
||||
|
|
|
@ -47,7 +47,7 @@ case $state in
|
|||
"random[Generate random intervals in a genome.]" \
|
||||
"reldist[Calculate the distribution of relative distances b/w two files.]" \
|
||||
"sample[Sample random records from file using reservoir sampling.]" \
|
||||
"shuffle[Randomly redistribute intervals in a genome.]" \
|
||||
"shuffle[Randomly redistrubute intervals in a genome.]" \
|
||||
"slop[Adjust the size of intervals.]" \
|
||||
"sort[Order the intervals in a file.]" \
|
||||
"subtract[Remove intervals based on overlaps b/w two files.]" \
|
||||
|
|
|
@ -38,7 +38,6 @@ One can configure a few things:
|
|||
- `bgnotify_bell` enabled or disables the terminal bell (default true)
|
||||
- `bgnotify_threshold` sets the notification threshold time (default 6 seconds)
|
||||
- `function bgnotify_formatted` lets you change the notification. You can for instance customize the message and pass in an icon.
|
||||
- `bgnotify_extraargs` appends extra args to notifier (e.g. `-e` for notify-send to create a transient notification)
|
||||
|
||||
Use these by adding a function definition before the your call to source. Example:
|
||||
|
||||
|
|
|
@ -117,15 +117,15 @@ function bgnotify {
|
|||
local icon="$3"
|
||||
if (( ${+commands[terminal-notifier]} )); then # macOS
|
||||
local term_id=$(bgnotify_programid)
|
||||
terminal-notifier -message "$message" -title "$title" ${=icon:+-appIcon "$icon"} ${=term_id:+-activate "$term_id"} ${=bgnotify_extraargs:-} &>/dev/null
|
||||
terminal-notifier -message "$message" -title "$title" ${=icon:+-appIcon "$icon"} ${=term_id:+-activate "$term_id"} &>/dev/null
|
||||
elif (( ${+commands[growlnotify]} )); then # macOS growl
|
||||
growlnotify -m "$title" "$message" ${=bgnotify_extraargs:-}
|
||||
growlnotify -m "$title" "$message"
|
||||
elif (( ${+commands[notify-send]} )); then
|
||||
notify-send "$title" "$message" ${=icon:+--icon "$icon"} ${=bgnotify_extraargs:-}
|
||||
notify-send "$title" "$message" ${=icon:+--icon "$icon"}
|
||||
elif (( ${+commands[kdialog]} )); then # KDE
|
||||
kdialog --title "$title" --passivepopup "$message" 5 ${=bgnotify_extraargs:-}
|
||||
kdialog --title "$title" --passivepopup "$message" 5
|
||||
elif (( ${+commands[notifu]} )); then # cygwin
|
||||
notifu /m "$message" /p "$title" ${=icon:+/i "$icon"} ${=bgnotify_extraargs:-}
|
||||
notifu /m "$message" /p "$title" ${=icon:+/i "$icon"}
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ if (( ! $+commands[brew] )); then
|
|||
fi
|
||||
|
||||
if [[ -z "$HOMEBREW_PREFIX" ]]; then
|
||||
# Maintain compatibility with potential custom user profiles, where we had
|
||||
# Maintain compatability with potential custom user profiles, where we had
|
||||
# previously relied on always sourcing shellenv. OMZ plugins should not rely
|
||||
# on this to be defined due to out of order processing.
|
||||
export HOMEBREW_PREFIX="$(brew --prefix)"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# catimg
|
||||
|
||||
Plugin for displaying images on the terminal using the `catimg.sh` script provided by
|
||||
[posva](https://github.com/posva/catimg)
|
||||
Plugin for displaying images on the terminal using the `catimg.sh` script provided by [posva](https://github.com/posva/catimg)
|
||||
|
||||
To use it, add `catimg` to the plugins array in your zshrc file:
|
||||
|
||||
|
@ -11,7 +10,7 @@ plugins=(... catimg)
|
|||
|
||||
## Requirements
|
||||
|
||||
- `magick convert` (ImageMagick)
|
||||
- `convert` (ImageMagick)
|
||||
|
||||
## Functions
|
||||
|
||||
|
|
|
@ -9,11 +9,9 @@
|
|||
|
||||
|
||||
function catimg() {
|
||||
if (( $+commands[magick] )); then
|
||||
CONVERT_CMD="magick" zsh $ZSH/plugins/catimg/catimg.sh $@
|
||||
elif (( $+commands[convert] )); then
|
||||
CONVERT_CMD="convert" zsh $ZSH/plugins/catimg/catimg.sh $@
|
||||
if [[ -x `which convert` ]]; then
|
||||
zsh $ZSH/plugins/catimg/catimg.sh $@
|
||||
else
|
||||
echo "catimg need magick/convert (ImageMagick) to work)"
|
||||
echo "catimg need convert (ImageMagick) to work)"
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -7,10 +7,6 @@
|
|||
# GitHub: https://github.com/posva/catimg #
|
||||
################################################################################
|
||||
|
||||
# this should come from outside, either `magick` or `convert`
|
||||
# from imagemagick v7 and ahead `convert` is deprecated
|
||||
: ${CONVERT_CMD:=convert}
|
||||
|
||||
function help() {
|
||||
echo "Usage catimg [-h] [-w width] [-c char] img"
|
||||
echo "By default char is \" \" and w is the terminal width"
|
||||
|
@ -47,23 +43,23 @@ if [ ! "$WIDTH" ]; then
|
|||
else
|
||||
COLS=$(expr $WIDTH "/" $(echo -n "$CHAR" | wc -c))
|
||||
fi
|
||||
WIDTH=$($CONVERT_CMD "$IMG" -print "%w\n" /dev/null)
|
||||
WIDTH=$(convert "$IMG" -print "%w\n" /dev/null)
|
||||
if [ "$WIDTH" -gt "$COLS" ]; then
|
||||
WIDTH=$COLS
|
||||
fi
|
||||
|
||||
REMAP=""
|
||||
if $CONVERT_CMD "$IMG" -resize $COLS\> +dither -remap $COLOR_FILE /dev/null ; then
|
||||
if convert "$IMG" -resize $COLS\> +dither -remap $COLOR_FILE /dev/null ; then
|
||||
REMAP="-remap $COLOR_FILE"
|
||||
else
|
||||
echo "The version of convert is too old, don't expect good results :(" >&2
|
||||
# $CONVERT_CMD "$IMG" -colors 256 PNG8:tmp.png
|
||||
# IMG="tmp.png"
|
||||
#convert "$IMG" -colors 256 PNG8:tmp.png
|
||||
#IMG="tmp.png"
|
||||
fi
|
||||
|
||||
# Display the image
|
||||
I=0
|
||||
$CONVERT_CMD "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- 2>/dev/null |
|
||||
convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- 2>/dev/null |
|
||||
sed -e 's/.*none.*/NO NO NO/g' -e '1d;s/^.*(\(.*\)[,)].*$/\1/g;y/,/ /' |
|
||||
while read R G B f; do
|
||||
if [ ! "$R" = "NO" ]; then
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
# conda plugin
|
||||
|
||||
The conda plugin provides [aliases](#aliases) for `conda`, usually installed via [anaconda](https://www.anaconda.com/) or [miniconda](https://docs.conda.io/en/latest/miniconda.html).
|
||||
|
||||
To use it, add `conda` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... conda)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
| :------- | :-------------------------------------- | :------------------------------------------------------------------------------ |
|
||||
| `cna` | `conda activate` | Activate the specified conda environment |
|
||||
| `cnab` | `conda activate base` | Activate the base conda environment |
|
||||
| `cncf` | `conda env create -f` | Create a new conda environment from a YAML file |
|
||||
| `cncn` | `conda create -y -n` | Create a new conda environment with the given name |
|
||||
| `cnconf` | `conda config` | View or modify conda configuration |
|
||||
| `cncp` | `conda create -y -p` | Create a new conda environment with the given prefix |
|
||||
| `cncr` | `conda create -n` | Create new virtual environment with given name |
|
||||
| `cncss` | `conda config --show-source` | Show the locations of conda configuration sources |
|
||||
| `cnde` | `conda deactivate` | Deactivate the current conda environment |
|
||||
| `cnel` | `conda env list` | List all available conda environments |
|
||||
| `cni` | `conda install` | Install given package |
|
||||
| `cniy` | `conda install -y` | Install given package without confirmation |
|
||||
| `cnl` | `conda list` | List installed packages in the current environment |
|
||||
| `cnle` | `conda list --export` | Export the list of installed packages in the current environment |
|
||||
| `cnles` | `conda list --explicit > spec-file.txt` | Export the list of installed packages in the current environment to a spec file |
|
||||
| `cnr` | `conda remove` | Remove given package |
|
||||
| `cnrn` | `conda remove -y -all -n` | Remove all packages in the specified environment |
|
||||
| `cnrp` | `conda remove -y -all -p` | Remove all packages in the specified prefix |
|
||||
| `cnry` | `conda remove -y` | Remove given package without confirmation |
|
||||
| `cnsr` | `conda search` | Search conda repositories for package |
|
||||
| `cnu` | `conda update` | Update conda package manager |
|
||||
| `cnua` | `conda update --all` | Update all installed packages |
|
||||
| `cnuc` | `conda update conda` | Update conda package manager |
|
|
@ -1,23 +0,0 @@
|
|||
alias cna='conda activate'
|
||||
alias cnab='conda activate base'
|
||||
alias cncf='conda env create -f'
|
||||
alias cncn='conda create -y -n'
|
||||
alias cnconf='conda config'
|
||||
alias cncp='conda create -y -p'
|
||||
alias cncr='conda create -n'
|
||||
alias cncss='conda config --show-source'
|
||||
alias cnde='conda deactivate'
|
||||
alias cnel='conda env list'
|
||||
alias cni='conda install'
|
||||
alias cniy='conda install -y'
|
||||
alias cnl='conda list'
|
||||
alias cnle='conda list --export'
|
||||
alias cnles='conda list --explicit > spec-file.txt'
|
||||
alias cnr='conda remove'
|
||||
alias cnrn='conda remove -y -all -n'
|
||||
alias cnrp='conda remove -y -all -p'
|
||||
alias cnry='conda remove -y'
|
||||
alias cnsr='conda search'
|
||||
alias cnu='conda update'
|
||||
alias cnua='conda update --all'
|
||||
alias cnuc='conda update conda'
|
|
@ -39,7 +39,7 @@ if (( ! $+commands[docker] )); then
|
|||
return
|
||||
fi
|
||||
|
||||
# Standardized $0 handling
|
||||
# Standarized $0 handling
|
||||
# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
|
||||
0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
|
||||
0="${${(M)0:#/*}:-$PWD/$0}"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
"""
|
||||
Update Emoji.py
|
||||
Refreshes OMZ emoji database based on the latest Unicode spec
|
||||
Refeshes OMZ emoji database based on the latest Unicode spec
|
||||
"""
|
||||
import re
|
||||
import json
|
||||
|
@ -95,7 +95,7 @@ def name_to_omz(_name, _group, _subgroup, _status):
|
|||
shortname = snake_case(_name)
|
||||
# Special treatment by status
|
||||
# Enables us to have every emoji combination,
|
||||
# even the one that are not officially sanctioned
|
||||
# even the one that are not officially sanctionned
|
||||
# and are implemented by, say, only one vendor
|
||||
if _status == "unqualified":
|
||||
shortname += "_unqualified"
|
||||
|
|
|
@ -52,7 +52,6 @@ plugins=(... extract)
|
|||
| `tlz` | Tarball with lzma compression |
|
||||
| `txz` | Tarball with lzma2 compression |
|
||||
| `tzst` | Tarball with zstd compression |
|
||||
| `vsix` | VS Code extension zip file |
|
||||
| `war` | Web Application archive (Java-based) |
|
||||
| `whl` | Python wheel file |
|
||||
| `xpi` | Mozilla XPI module file |
|
||||
|
|
|
@ -1,54 +1,7 @@
|
|||
#compdef extract
|
||||
#autoload
|
||||
|
||||
local -a exts=(
|
||||
7z
|
||||
aar
|
||||
apk
|
||||
bz2
|
||||
cab
|
||||
cpio
|
||||
crx
|
||||
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
|
||||
vsix
|
||||
war
|
||||
whl
|
||||
xpi
|
||||
xz
|
||||
Z
|
||||
zip
|
||||
zpaq
|
||||
zst
|
||||
)
|
||||
|
||||
_arguments \
|
||||
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
|
||||
"*::archive file:_files -g '(#i)*.(${(j:|:)exts})(-.)'" \
|
||||
"*::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
|
||||
|
|
|
@ -76,7 +76,7 @@ EOF
|
|||
(*.lz4) lz4 -d "$full_path" ;;
|
||||
(*.lzma) unlzma "$full_path" ;;
|
||||
(*.z) uncompress "$full_path" ;;
|
||||
(*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl|*.vsix|*.crx) unzip "$full_path" ;;
|
||||
(*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$full_path" ;;
|
||||
(*.rar) unrar x -ad "$full_path" ;;
|
||||
(*.rpm)
|
||||
rpm2cpio "$full_path" | cpio --quiet -id ;;
|
||||
|
|
|
@ -23,7 +23,7 @@ if is-at-least 5.5; then
|
|||
fi
|
||||
|
||||
{
|
||||
# Standardized $0 handling
|
||||
# Standarized $0 handling
|
||||
# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
|
||||
0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
|
||||
0="${${(M)0:#/*}:-$PWD/$0}"
|
||||
|
|
|
@ -73,7 +73,6 @@ plugins=(... git)
|
|||
| `gcans!` | `git commit --verbose --all --signoff --no-edit --amend` |
|
||||
| `gcann!` | `git commit --verbose --all --date=now --no-edit --amend` |
|
||||
| `gc!` | `git commit --verbose --amend` |
|
||||
| `gcn` | `git commit --verbose --no-edit` |
|
||||
| `gcn!` | `git commit --verbose --no-edit --amend` |
|
||||
| `gcs` | `git commit -S` |
|
||||
| `gcss` | `git commit -S -s` |
|
||||
|
@ -115,7 +114,6 @@ plugins=(... git)
|
|||
| `gma` | `git merge --abort` |
|
||||
| `gmc` | `git merge --continue` |
|
||||
| `gms` | `git merge --squash` |
|
||||
| `gmff` | `git merge --ff-only` |
|
||||
| `gmom` | `git merge origin/$(git_main_branch)` |
|
||||
| `gmum` | `git merge upstream/$(git_main_branch)` |
|
||||
| `gmtl` | `git mergetool --no-prompt` |
|
||||
|
@ -127,8 +125,6 @@ plugins=(... git)
|
|||
| `gprav` | `git pull --rebase --autostash -v` |
|
||||
| `gprom` | `git pull --rebase origin $(git_main_branch)` |
|
||||
| `gpromi` | `git pull --rebase=interactive origin $(git_main_branch)` |
|
||||
| `gprum` | `git pull --rebase upstream $(git_main_branch)` |
|
||||
| `gprumi` | `git pull --rebase=interactive upstream $(git_main_branch)` |
|
||||
| `ggpull` | `git pull origin "$(git_current_branch)"` |
|
||||
| `ggl` | `git pull origin $(current_branch)` |
|
||||
| `gluc` | `git pull upstream $(git_current_branch)` |
|
||||
|
@ -158,7 +154,6 @@ plugins=(... git)
|
|||
| `grbd` | `git rebase $(git_develop_branch)` |
|
||||
| `grbm` | `git rebase $(git_main_branch)` |
|
||||
| `grbom` | `git rebase origin/$(git_main_branch)` |
|
||||
| `grbum` | `git rebase upstream/$(git_main_branch)` |
|
||||
| `grf` | `git reflog` |
|
||||
| `gr` | `git remote` |
|
||||
| `grv` | `git remote --verbose` |
|
||||
|
|
|
@ -197,7 +197,6 @@ alias gcan!='git commit --verbose --all --no-edit --amend'
|
|||
alias gcans!='git commit --verbose --all --signoff --no-edit --amend'
|
||||
alias gcann!='git commit --verbose --all --date=now --no-edit --amend'
|
||||
alias gc!='git commit --verbose --amend'
|
||||
alias gcn='git commit --verbose --no-edit'
|
||||
alias gcn!='git commit --verbose --no-edit --amend'
|
||||
alias gcf='git config --list'
|
||||
alias gdct='git describe --tags $(git rev-list --tags --max-count=1)'
|
||||
|
@ -256,7 +255,6 @@ alias gm='git merge'
|
|||
alias gma='git merge --abort'
|
||||
alias gmc='git merge --continue'
|
||||
alias gms="git merge --squash"
|
||||
alias gmff="git merge --ff-only"
|
||||
alias gmom='git merge origin/$(git_main_branch)'
|
||||
alias gmum='git merge upstream/$(git_main_branch)'
|
||||
alias gmtl='git mergetool --no-prompt'
|
||||
|
@ -276,8 +274,6 @@ compdef _git ggu=git-checkout
|
|||
|
||||
alias gprom='git pull --rebase origin $(git_main_branch)'
|
||||
alias gpromi='git pull --rebase=interactive origin $(git_main_branch)'
|
||||
alias gprum='git pull --rebase upstream $(git_main_branch)'
|
||||
alias gprumi='git pull --rebase=interactive upstream $(git_main_branch)'
|
||||
alias ggpull='git pull origin "$(git_current_branch)"'
|
||||
|
||||
function ggl() {
|
||||
|
@ -341,7 +337,6 @@ alias grbs='git rebase --skip'
|
|||
alias grbd='git rebase $(git_develop_branch)'
|
||||
alias grbm='git rebase $(git_main_branch)'
|
||||
alias grbom='git rebase origin/$(git_main_branch)'
|
||||
alias grbum='git rebase upstream/$(git_main_branch)'
|
||||
alias grf='git reflog'
|
||||
alias gr='git remote'
|
||||
alias grv='git remote --verbose'
|
||||
|
|
|
@ -295,8 +295,8 @@ _history-substring-search-begin() {
|
|||
fi
|
||||
|
||||
#
|
||||
# Escape and join query parts with wildcard character '*' as separator
|
||||
# `(j:CHAR:)` join array to string with CHAR as separator
|
||||
# Escape and join query parts with wildcard character '*' as seperator
|
||||
# `(j:CHAR:)` join array to string with CHAR as seperator
|
||||
#
|
||||
local search_pattern="${(j:*:)_history_substring_search_query_parts[@]//(#m)[\][()|\\*?#<>~^]/\\$MATCH}*"
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
- Zaphod.
|
||||
%
|
||||
"`In those days spirits were brave, the stakes were high, men were REAL men, women were REAL women, and small furry creatures from Alpha Centauri were REAL small furry creatures from Alpha Centauri.'"
|
||||
"`In those days spirits were brave, the stakes were high, men were REAL men, women were REAL women, and small furry creatures from Alpha Centauri were REAL small furry creatures from Aplha Centauri.'"
|
||||
|
||||
- The Book getting all nostalgic.
|
||||
%
|
||||
|
|
|
@ -19,7 +19,7 @@ Usage is simple... just take your json data and pipe it into the appropriate jso
|
|||
|
||||
### Supports NDJSON (Newline Delimited JSON)
|
||||
|
||||
The plugin also supports [NDJSON](https://github.com/ndjson/ndjson-spec) input, which means all functions
|
||||
The plugin also supports [NDJSON](http://ndjson.org/) input, which means all functions
|
||||
have an alternative function that reads and processes the input line by line. These
|
||||
functions have the same name except using `ndjson` instead of `json`:
|
||||
|
||||
|
|
|
@ -11,124 +11,122 @@ plugins=(... kubectl)
|
|||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
| :------- | :------------------------------------------------- | :----------------------------------------------------------------------------------------------- |
|
||||
| k | `kubectl` | The kubectl command |
|
||||
| kca | `kubectl --all-namespaces` | The kubectl command targeting all namespaces |
|
||||
| kaf | `kubectl apply -f` | Apply a YML file |
|
||||
| keti | `kubectl exec -ti` | Drop into an interactive terminal on a container |
|
||||
| | | **Manage configuration quickly to switch contexts between local, dev and staging** |
|
||||
| kcuc | `kubectl config use-context` | Set the current-context in a kubeconfig file |
|
||||
| kcsc | `kubectl config set-context` | Set a context entry in kubeconfig |
|
||||
| kcdc | `kubectl config delete-context` | Delete the specified context from the kubeconfig |
|
||||
| kccc | `kubectl config current-context` | Display the current-context |
|
||||
| kcgc | `kubectl config get-contexts` | List of contexts available |
|
||||
| | | **General aliases** |
|
||||
| kdel | `kubectl delete` | Delete resources by filenames, stdin, resources and names, or by resources and label selector |
|
||||
| kdelf | `kubectl delete -f` | Delete a pod using the type and name specified in -f argument |
|
||||
| | | **Pod management** |
|
||||
| kgp | `kubectl get pods` | List all pods in ps output format |
|
||||
| kgpl | `kgp -l` | Get pods by label. Example: `kgpl "app=myapp" -n myns` |
|
||||
| kgpn | `kgp -n` | Get pods by namespace. Example: `kgpn kube-system` |
|
||||
| kgpsl | `kubectl get pods --show-labels` | List all pods in ps output format with labels |
|
||||
| kgpw | `kgp --watch` | After listing/getting the requested object, watch for changes |
|
||||
| kgpwide | `kgp -o wide` | Output in plain-text format with any additional information. For pods, the node name is included |
|
||||
| kep | `kubectl edit pods` | Edit pods from the default editor |
|
||||
| kdp | `kubectl describe pods` | Describe all pods |
|
||||
| kdelp | `kubectl delete pods` | Delete all pods matching passed arguments |
|
||||
| | | **Service management** |
|
||||
| kgs | `kubectl get svc` | List all services in ps output format |
|
||||
| kgsw | `kgs --watch` | After listing all services, watch for changes |
|
||||
| kgswide | `kgs -o wide` | After listing all services, output in plain-text format with any additional information |
|
||||
| kes | `kubectl edit svc` | Edit services(svc) from the default editor |
|
||||
| kds | `kubectl describe svc` | Describe all services in detail |
|
||||
| kdels | `kubectl delete svc` | Delete all services matching passed argument |
|
||||
| | | **Ingress management** |
|
||||
| kgi | `kubectl get ingress` | List ingress resources in ps output format |
|
||||
| kei | `kubectl edit ingress` | Edit ingress resource from the default editor |
|
||||
| kdi | `kubectl describe ingress` | Describe ingress resource in detail |
|
||||
| kdeli | `kubectl delete ingress` | Delete ingress resources matching passed argument |
|
||||
| | | **Namespace management** |
|
||||
| kgns | `kubectl get namespaces` | List the current namespaces in a cluster |
|
||||
| kcn | `kubectl config set-context --current --namespace` | Change current namespace |
|
||||
| kens | `kubectl edit namespace` | Edit namespace resource from the default editor |
|
||||
| kdns | `kubectl describe namespace` | Describe namespace resource in detail |
|
||||
| kdelns | `kubectl delete namespace` | Delete the namespace. WARNING! This deletes everything in the namespace |
|
||||
| | | **ConfigMap management** |
|
||||
| kgcm | `kubectl get configmaps` | List the configmaps in ps output format |
|
||||
| kecm | `kubectl edit configmap` | Edit configmap resource from the default editor |
|
||||
| kdcm | `kubectl describe configmap` | Describe configmap resource in detail |
|
||||
| kdelcm | `kubectl delete configmap` | Delete the configmap |
|
||||
| | | **Secret management** |
|
||||
| kgsec | `kubectl get secret` | Get secret for decoding |
|
||||
| kdsec | `kubectl describe secret` | Describe secret resource in detail |
|
||||
| kdelsec | `kubectl delete secret` | Delete the secret |
|
||||
| | | **Deployment management** |
|
||||
| kgd | `kubectl get deployment` | Get the deployment |
|
||||
| kgdw | `kgd --watch` | After getting the deployment, watch for changes |
|
||||
| kgdwide | `kgd -o wide` | After getting the deployment, output in plain-text format with any additional information |
|
||||
| ked | `kubectl edit deployment` | Edit deployment resource from the default editor |
|
||||
| kdd | `kubectl describe deployment` | Describe deployment resource in detail |
|
||||
| kdeld | `kubectl delete deployment` | Delete the deployment |
|
||||
| ksd | `kubectl scale deployment` | Scale a deployment |
|
||||
| krsd | `kubectl rollout status deployment` | Check the rollout status of a deployment |
|
||||
| kres | `kubectl set env $@ REFRESHED_AT=...` | Recreate all pods in deployment with zero-downtime |
|
||||
| | | **Rollout management** |
|
||||
| kgrs | `kubectl get replicaset` | List all ReplicaSets `rs` created by the deployment |
|
||||
| kdrs | `kubectl describe replicaset` | Describe ReplicaSet in detail |
|
||||
| kers | `kubectl edit replicaset` | Edit ReplicaSet from the default editor |
|
||||
| krh | `kubectl rollout history` | Check the revisions of this deployment |
|
||||
| kru | `kubectl rollout undo` | Rollback to the previous revision |
|
||||
| | | **Port forwarding** |
|
||||
| kpf | `kubectl port-forward` | Forward one or more local ports to a pod |
|
||||
| | | **Tools for accessing all information** |
|
||||
| kga | `kubectl get all` | List all resources in ps format |
|
||||
| kgaa | `kubectl get all --all-namespaces` | List the requested object(s) across all namespaces |
|
||||
| | | **Logs** |
|
||||
| kl | `kubectl logs` | Print the logs for a container or resource |
|
||||
| klf | `kubectl logs -f` | Stream the logs for a container or resource (follow) |
|
||||
| | | **File copy** |
|
||||
| kcp | `kubectl cp` | Copy files and directories to and from containers |
|
||||
| | | **Node management** |
|
||||
| kgno | `kubectl get nodes` | List the nodes in ps output format |
|
||||
| kgnosl | `kubectl get nodes --show-labels` | List the nodes in ps output format with labels |
|
||||
| keno | `kubectl edit node` | Edit nodes resource from the default editor |
|
||||
| kdno | `kubectl describe node` | Describe node resource in detail |
|
||||
| kdelno | `kubectl delete node` | Delete the node |
|
||||
| | | **Persistent Volume Claim management** |
|
||||
| kgpvc | `kubectl get pvc` | List all PVCs |
|
||||
| kgpvcw | `kgpvc --watch` | After listing/getting the requested object, watch for changes |
|
||||
| kepvc | `kubectl edit pvc` | Edit pvcs from the default editor |
|
||||
| kdpvc | `kubectl describe pvc` | Describe all pvcs |
|
||||
| kdelpvc | `kubectl delete pvc` | Delete all pvcs matching passed arguments |
|
||||
| | | **StatefulSets management** |
|
||||
| kgss | `kubectl get statefulset` | List the statefulsets in ps format |
|
||||
| kgssw | `kgss --watch` | After getting the list of statefulsets, watch for changes |
|
||||
| kgsswide | `kgss -o wide` | After getting the statefulsets, output in plain-text format with any additional information |
|
||||
| kess | `kubectl edit statefulset` | Edit statefulset resource from the default editor |
|
||||
| kdss | `kubectl describe statefulset` | Describe statefulset resource in detail |
|
||||
| kdelss | `kubectl delete statefulset` | Delete the statefulset |
|
||||
| ksss | `kubectl scale statefulset` | Scale a statefulset |
|
||||
| krsss | `kubectl rollout status statefulset` | Check the rollout status of a deployment |
|
||||
| | | **Service Accounts management** |
|
||||
| kdsa | `kubectl describe sa` | Describe a service account in details |
|
||||
| kdelsa | `kubectl delete sa` | Delete the service account |
|
||||
| | | **DaemonSet management** |
|
||||
| kgds | `kubectl get daemonset` | List all DaemonSets in ps output format |
|
||||
| kgdsw | `kgds --watch` | After listing all DaemonSets, watch for changes |
|
||||
| keds | `kubectl edit daemonset` | Edit DaemonSets from the default editor |
|
||||
| kdds | `kubectl describe daemonset` | Describe all DaemonSets in detail |
|
||||
| kdelds | `kubectl delete daemonset` | Delete all DaemonSets matching passed argument |
|
||||
| | | **CronJob management** |
|
||||
| kgcj | `kubectl get cronjob` | List all CronJobs in ps output format |
|
||||
| kecj | `kubectl edit cronjob` | Edit CronJob from the default editor |
|
||||
| kdcj | `kubectl describe cronjob` | Describe a CronJob in details |
|
||||
| kdelcj | `kubectl delete cronjob` | Delete the CronJob |
|
||||
| | | **Job management** |
|
||||
| kgj | `kubectl get job` | List all Job in ps output format |
|
||||
| kej | `kubectl edit job` | Edit a Job in details |
|
||||
| kdj | `kubectl describe job` | Describe the Job |
|
||||
| kdelj | `kubectl delete job` | Delete the Job |
|
||||
| Alias | Command | Description |
|
||||
|:--------|:------------------------------------|:-------------------------------------------------------------------------------------------------|
|
||||
| k | `kubectl` | The kubectl command |
|
||||
| kca | `kubectl --all-namespaces` | The kubectl command targeting all namespaces |
|
||||
| kaf | `kubectl apply -f` | Apply a YML file |
|
||||
| keti | `kubectl exec -ti` | Drop into an interactive terminal on a container |
|
||||
| | | **Manage configuration quickly to switch contexts between local, dev and staging** |
|
||||
| kcuc | `kubectl config use-context` | Set the current-context in a kubeconfig file |
|
||||
| kcsc | `kubectl config set-context` | Set a context entry in kubeconfig |
|
||||
| kcdc | `kubectl config delete-context` | Delete the specified context from the kubeconfig |
|
||||
| kccc | `kubectl config current-context` | Display the current-context |
|
||||
| kcgc | `kubectl config get-contexts` | List of contexts available |
|
||||
| | | **General aliases** |
|
||||
| kdel | `kubectl delete` | Delete resources by filenames, stdin, resources and names, or by resources and label selector |
|
||||
| kdelf | `kubectl delete -f` | Delete a pod using the type and name specified in -f argument |
|
||||
| | | **Pod management** |
|
||||
| kgp | `kubectl get pods` | List all pods in ps output format |
|
||||
| kgpw | `kgp --watch` | After listing/getting the requested object, watch for changes |
|
||||
| kgpwide | `kgp -o wide` | Output in plain-text format with any additional information. For pods, the node name is included |
|
||||
| kep | `kubectl edit pods` | Edit pods from the default editor |
|
||||
| kdp | `kubectl describe pods` | Describe all pods |
|
||||
| kdelp | `kubectl delete pods` | Delete all pods matching passed arguments |
|
||||
| kgpl | `kgp -l` | Get pods by label. Example: `kgpl "app=myapp" -n myns` |
|
||||
| kgpn | `kgp -n` | Get pods by namespace. Example: `kgpn kube-system` |
|
||||
| | | **Service management** |
|
||||
| kgs | `kubectl get svc` | List all services in ps output format |
|
||||
| kgsw | `kgs --watch` | After listing all services, watch for changes |
|
||||
| kgswide | `kgs -o wide` | After listing all services, output in plain-text format with any additional information |
|
||||
| kes | `kubectl edit svc` | Edit services(svc) from the default editor |
|
||||
| kds | `kubectl describe svc` | Describe all services in detail |
|
||||
| kdels | `kubectl delete svc` | Delete all services matching passed argument |
|
||||
| | | **Ingress management** |
|
||||
| kgi | `kubectl get ingress` | List ingress resources in ps output format |
|
||||
| kei | `kubectl edit ingress` | Edit ingress resource from the default editor |
|
||||
| kdi | `kubectl describe ingress` | Describe ingress resource in detail |
|
||||
| kdeli | `kubectl delete ingress` | Delete ingress resources matching passed argument |
|
||||
| | | **Namespace management** |
|
||||
| kgns | `kubectl get namespaces` | List the current namespaces in a cluster |
|
||||
| kcn | `kubectl config set-context --current --namespace` | Change current namespace |
|
||||
| kens | `kubectl edit namespace` | Edit namespace resource from the default editor |
|
||||
| kdns | `kubectl describe namespace` | Describe namespace resource in detail |
|
||||
| kdelns | `kubectl delete namespace` | Delete the namespace. WARNING! This deletes everything in the namespace |
|
||||
| | | **ConfigMap management** |
|
||||
| kgcm | `kubectl get configmaps` | List the configmaps in ps output format |
|
||||
| kecm | `kubectl edit configmap` | Edit configmap resource from the default editor |
|
||||
| kdcm | `kubectl describe configmap` | Describe configmap resource in detail |
|
||||
| kdelcm | `kubectl delete configmap` | Delete the configmap |
|
||||
| | | **Secret management** |
|
||||
| kgsec | `kubectl get secret` | Get secret for decoding |
|
||||
| kdsec | `kubectl describe secret` | Describe secret resource in detail |
|
||||
| kdelsec | `kubectl delete secret` | Delete the secret |
|
||||
| | | **Deployment management** |
|
||||
| kgd | `kubectl get deployment` | Get the deployment |
|
||||
| kgdw | `kgd --watch` | After getting the deployment, watch for changes |
|
||||
| kgdwide | `kgd -o wide` | After getting the deployment, output in plain-text format with any additional information |
|
||||
| ked | `kubectl edit deployment` | Edit deployment resource from the default editor |
|
||||
| kdd | `kubectl describe deployment` | Describe deployment resource in detail |
|
||||
| kdeld | `kubectl delete deployment` | Delete the deployment |
|
||||
| ksd | `kubectl scale deployment` | Scale a deployment |
|
||||
| krsd | `kubectl rollout status deployment` | Check the rollout status of a deployment |
|
||||
| kres | `kubectl set env $@ REFRESHED_AT=...` | Recreate all pods in deployment with zero-downtime |
|
||||
| | | **Rollout management** |
|
||||
| kgrs | `kubectl get replicaset` | List all ReplicaSets `rs` created by the deployment |
|
||||
| kdrs | `kubectl describe replicaset` | Describe ReplicaSet in detail |
|
||||
| kers | `kubectl edit replicaset` | Edit ReplicaSet from the default editor |
|
||||
| krh | `kubectl rollout history` | Check the revisions of this deployment |
|
||||
| kru | `kubectl rollout undo` | Rollback to the previous revision |
|
||||
| | | **Port forwarding** |
|
||||
| kpf | `kubectl port-forward` | Forward one or more local ports to a pod |
|
||||
| | | **Tools for accessing all information** |
|
||||
| kga | `kubectl get all` | List all resources in ps format |
|
||||
| kgaa | `kubectl get all --all-namespaces` | List the requested object(s) across all namespaces |
|
||||
| | | **Logs** |
|
||||
| kl | `kubectl logs` | Print the logs for a container or resource |
|
||||
| klf | `kubectl logs -f` | Stream the logs for a container or resource (follow) |
|
||||
| | | **File copy** |
|
||||
| kcp | `kubectl cp` | Copy files and directories to and from containers |
|
||||
| | | **Node management** |
|
||||
| kgno | `kubectl get nodes` | List the nodes in ps output format |
|
||||
| keno | `kubectl edit node` | Edit nodes resource from the default editor |
|
||||
| kdno | `kubectl describe node` | Describe node resource in detail |
|
||||
| kdelno | `kubectl delete node` | Delete the node |
|
||||
| | | **Persistent Volume Claim management** |
|
||||
| kgpvc | `kubectl get pvc` | List all PVCs |
|
||||
| kgpvcw | `kgpvc --watch` | After listing/getting the requested object, watch for changes |
|
||||
| kepvc | `kubectl edit pvc` | Edit pvcs from the default editor |
|
||||
| kdpvc | `kubectl describe pvc` | Describe all pvcs |
|
||||
| kdelpvc | `kubectl delete pvc` | Delete all pvcs matching passed arguments |
|
||||
| | | **StatefulSets management** |
|
||||
| kgss | `kubectl get statefulset` | List the statefulsets in ps format |
|
||||
| kgssw | `kgss --watch` | After getting the list of statefulsets, watch for changes |
|
||||
| kgsswide| `kgss -o wide` | After getting the statefulsets, output in plain-text format with any additional information |
|
||||
| kess | `kubectl edit statefulset` | Edit statefulset resource from the default editor |
|
||||
| kdss | `kubectl describe statefulset` | Describe statefulset resource in detail |
|
||||
| kdelss | `kubectl delete statefulset` | Delete the statefulset |
|
||||
| ksss | `kubectl scale statefulset` | Scale a statefulset |
|
||||
| krsss | `kubectl rollout status statefulset`| Check the rollout status of a deployment |
|
||||
| | | **Service Accounts management** |
|
||||
| kdsa | `kubectl describe sa` | Describe a service account in details |
|
||||
| kdelsa | `kubectl delete sa` | Delete the service account |
|
||||
| | | **DaemonSet management** |
|
||||
| kgds | `kubectl get daemonset` | List all DaemonSets in ps output format |
|
||||
| kgdsw | `kgds --watch` | After listing all DaemonSets, watch for changes |
|
||||
| keds | `kubectl edit daemonset` | Edit DaemonSets from the default editor |
|
||||
| kdds | `kubectl describe daemonset` | Describe all DaemonSets in detail |
|
||||
| kdelds | `kubectl delete daemonset` | Delete all DaemonSets matching passed argument |
|
||||
| | | **CronJob management** |
|
||||
| kgcj | `kubectl get cronjob` | List all CronJobs in ps output format |
|
||||
| kecj | `kubectl edit cronjob` | Edit CronJob from the default editor |
|
||||
| kdcj | `kubectl describe cronjob` | Describe a CronJob in details |
|
||||
| kdelcj | `kubectl delete cronjob` | Delete the CronJob |
|
||||
| | | **Job management** |
|
||||
| kgj | `kubectl get job` | List all Job in ps output format |
|
||||
| kej | `kubectl edit job` | Edit a Job in details |
|
||||
| kdj | `kubectl describe job` | Describe the Job |
|
||||
| kdelj | `kubectl delete job` | Delete the Job |
|
||||
|
||||
## Wrappers
|
||||
|
||||
|
|
|
@ -39,9 +39,6 @@ alias kdelf='kubectl delete -f'
|
|||
|
||||
# Pod management.
|
||||
alias kgp='kubectl get pods'
|
||||
alias kgpl='kgp -l'
|
||||
alias kgpn='kgp -n'
|
||||
alias kgpsl='kubectl get pods --show-labels'
|
||||
alias kgpa='kubectl get pods --all-namespaces'
|
||||
alias kgpw='kgp --watch'
|
||||
alias kgpwide='kgp -o wide'
|
||||
|
@ -50,6 +47,12 @@ alias kdp='kubectl describe pods'
|
|||
alias kdelp='kubectl delete pods'
|
||||
alias kgpall='kubectl get pods --all-namespaces -o wide'
|
||||
|
||||
# get pod by label: kgpl "app=myapp" -n myns
|
||||
alias kgpl='kgp -l'
|
||||
|
||||
# get pod by namespace: kgpn kube-system"
|
||||
alias kgpn='kgp -n'
|
||||
|
||||
# Service management.
|
||||
alias kgs='kubectl get svc'
|
||||
alias kgsa='kubectl get svc --all-namespaces'
|
||||
|
@ -141,7 +144,6 @@ alias kcp='kubectl cp'
|
|||
|
||||
# Node Management
|
||||
alias kgno='kubectl get nodes'
|
||||
alias kgnosl='kubectl get nodes --show-labels'
|
||||
alias keno='kubectl edit node'
|
||||
alias kdno='kubectl describe node'
|
||||
alias kdelno='kubectl delete node'
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
# Localstack plugin #
|
||||
|
||||
CLI support for LOCALSTACK interaction
|
||||
|
||||
## Description ##
|
||||
To use it, add `localstack` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... localstack)
|
||||
```
|
||||
|
||||
## Usage ##
|
||||
|
||||
This plugin supplies one command, `lsk`, through which all its features are exposed.
|
||||
|
||||
## Commands
|
||||
|
||||
| Command | Description |
|
||||
| :------------ | :-------------------------------------------------------------------- |
|
||||
| `lsk sqs-send <queue> <message.json>` | sends a given message in sqs to a given queue |
|
||||
|
||||
## Examples
|
||||
|
||||
![staging](sqs-send-result.png)
|
|
@ -1,37 +0,0 @@
|
|||
# CLI support for LOCALSTACK interaction
|
||||
#
|
||||
# See README.md for details
|
||||
lsk() {
|
||||
case $1 in
|
||||
sqs-send)
|
||||
shift
|
||||
sqs-send "$@"
|
||||
;;
|
||||
*)
|
||||
echo "Command not found: $1"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Send SQS function
|
||||
#
|
||||
# This function sends a given message in sqs to a given queue, when used Localstack
|
||||
#
|
||||
# Use:
|
||||
# sqs-send <queue> <message>
|
||||
#
|
||||
# Parameters
|
||||
# <queue> A given queue
|
||||
# <message> A content of message em json archive
|
||||
#
|
||||
# Example
|
||||
# sqs-send user user.json
|
||||
sqs-send(){
|
||||
if [ -z "$1" ]; then
|
||||
echo "Use: sqs-send <queue> <payload>"
|
||||
return 1
|
||||
fi
|
||||
|
||||
curl -X POST "http://localhost:4566/000000000000/$1" -d "Action=SendMessage" -d "MessageBody=$(cat $2)"
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 69 KiB |
|
@ -78,7 +78,7 @@ _lpass() {
|
|||
has_sync=1
|
||||
;;
|
||||
status)
|
||||
_arguments : '(-q --quiet)'{-q,--quiet}'[Suppress output to stdout]'
|
||||
_arguments : '(-q --quiet)'{-q,--quiet}'[Supress output to stdout]'
|
||||
has_color=1
|
||||
;;
|
||||
sync)
|
||||
|
|
|
@ -17,4 +17,3 @@ plugins=(... mix)
|
|||
| Ecto | [Ecto](https://hexdocs.pm/ecto/Ecto.html) |
|
||||
| Hex | [Hex](https://hex.pm/) |
|
||||
| Nerves | [Nerves](https://nerves-project.org/) |
|
||||
| mix_test_watch | [mix_test_watch](https://hex.pm/packages/mix_test_watch) |
|
||||
|
|
|
@ -109,7 +109,6 @@ _1st_arguments=(
|
|||
'release.init:Generates sample files for releases'
|
||||
'run:Run the given file or expression'
|
||||
"test:Run a project's tests"
|
||||
"test.watch:Run a project's tests continuously using hex package mix_test_watch"
|
||||
'test.coverage:Build report from exported test coverage'
|
||||
'xref:Prints cross reference information'
|
||||
'--help:Describe available tasks'
|
||||
|
@ -121,7 +120,7 @@ __task_list ()
|
|||
local expl
|
||||
declare -a tasks
|
||||
|
||||
tasks=(app.config app.start app.tree archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.tree deps.unlock deps.update do ecto.create ecto.drop ecto.dump ecto.gen.migration ecto.gen.repo ecto.load ecto.migrate ecto.migrations ecto.rollback escript escript.build escript.install escript.uninstall firmware firmware.burn firmware.image format help hex hex.audit hex.build hex.config hex.docs hex.info hex.organization hex.key hex.outdated hex.owner hex.package hex.publish hex.registry hex.repo hex.retire hex.search hex.sponsor hex.user loadconfig local local.hex local.phoenix local.phx local.public_keys local.rebar nerves.artifact nerves.artifact.get nerves.info nerves.new nerves.release.init new phoenix.digest phoenix.gen.channel phoenix.gen.html phoenix.gen.json phoenix.gen.model phoenix.gen.secret phoenix.new phoenix.routes phoenix.server phx.digest phx.digest.clean phx.gen.auth phx.gen.cert phx.gen.channel phx.gen.context phx.gen.embedded phx.gen.html phx.gen.json phx.gen.live phx.gen.notifier phx.gen.presence phx.gen.schema phx.gen.secret phx.gen.socket phx.new phx.new.ecto phx.new.web phx.routes phx.server profile.cprof profile.eprof profile.fprof release release.init run test test.watch test.coverage xref)
|
||||
tasks=(app.config app.start app.tree archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.tree deps.unlock deps.update do ecto.create ecto.drop ecto.dump ecto.gen.migration ecto.gen.repo ecto.load ecto.migrate ecto.migrations ecto.rollback escript escript.build escript.install escript.uninstall firmware firmware.burn firmware.image format help hex hex.audit hex.build hex.config hex.docs hex.info hex.organization hex.key hex.outdated hex.owner hex.package hex.publish hex.registry hex.repo hex.retire hex.search hex.sponsor hex.user loadconfig local local.hex local.phoenix local.phx local.public_keys local.rebar nerves.artifact nerves.artifact.get nerves.info nerves.new nerves.release.init new phoenix.digest phoenix.gen.channel phoenix.gen.html phoenix.gen.json phoenix.gen.model phoenix.gen.secret phoenix.new phoenix.routes phoenix.server phx.digest phx.digest.clean phx.gen.auth phx.gen.cert phx.gen.channel phx.gen.context phx.gen.embedded phx.gen.html phx.gen.json phx.gen.live phx.gen.notifier phx.gen.presence phx.gen.schema phx.gen.secret phx.gen.socket phx.new phx.new.ecto phx.new.web phx.routes phx.server profile.cprof profile.eprof profile.fprof release release.init run test test.coverage xref)
|
||||
|
||||
_wanted tasks expl 'help' compadd $tasks
|
||||
}
|
||||
|
@ -149,9 +148,6 @@ case $state in
|
|||
(test)
|
||||
_files
|
||||
;;
|
||||
(test.watch)
|
||||
_files
|
||||
;;
|
||||
(run)
|
||||
_files
|
||||
;;
|
||||
|
|
|
@ -26,10 +26,9 @@ These settings should go in your zshrc file, before Oh My Zsh is sourced:
|
|||
#### Lazy startup
|
||||
|
||||
This option will help you to defer nvm's load until you use it to speed-up your zsh startup. This will source
|
||||
nvm script only when using it, and will create a function for `node`, `npm`, `npx`, `pnpm`, `pnpx`, `yarn`,
|
||||
`corepack` and the command(s) specified by `lazy-cmd` option, so when you call either of them, nvm will be
|
||||
loaded and run with default version. To enable it, you can add this snippet to your zshrc, before Oh My Zsh is
|
||||
sourced:
|
||||
nvm script only when using it, and will create a function for `node`, `npm`, `npx`, `pnpm`, `yarn`, `corepack`
|
||||
and the command(s) specified by `lazy-cmd` option, so when you call either of them, nvm will be loaded and run
|
||||
with default version. To enable it, you can add this snippet to your zshrc, before Oh My Zsh is sourced:
|
||||
|
||||
```zsh
|
||||
zstyle ':omz:plugins:nvm' lazy yes
|
||||
|
@ -42,8 +41,6 @@ as you want:
|
|||
zstyle ':omz:plugins:nvm' lazy-cmd eslint prettier typescript ...
|
||||
```
|
||||
|
||||
There will be a function `_omz_nvm_load` available to load `nvm` without executing any other trigger command.
|
||||
|
||||
#### `.nvmrc` autoload
|
||||
|
||||
Note: _if used at the same time as `lazy`, `autoload` will start working only after nvm has been lazy-loaded_
|
||||
|
|
|
@ -20,7 +20,7 @@ if [[ -z "$NVM_DIR" ]] || [[ ! -f "$NVM_DIR/nvm.sh" ]]; then
|
|||
return
|
||||
fi
|
||||
|
||||
function _omz_nvm_setup_completion {
|
||||
function _omz_load_nvm_completion {
|
||||
local _nvm_completion
|
||||
# Load nvm bash completion
|
||||
for _nvm_completion in "$NVM_DIR/bash_completion" "$NVM_HOMEBREW/etc/bash_completion.d/nvm"; do
|
||||
|
@ -33,12 +33,12 @@ function _omz_nvm_setup_completion {
|
|||
break
|
||||
fi
|
||||
done
|
||||
unfunction _omz_nvm_setup_completion
|
||||
unfunction _omz_load_nvm_completion
|
||||
}
|
||||
|
||||
function _omz_nvm_setup_autoload {
|
||||
function _omz_setup_autoload {
|
||||
if ! zstyle -t ':omz:plugins:nvm' autoload; then
|
||||
unfunction _omz_nvm_setup_autoload
|
||||
unfunction _omz_setup_autoload
|
||||
return
|
||||
fi
|
||||
|
||||
|
@ -68,13 +68,13 @@ function _omz_nvm_setup_autoload {
|
|||
add-zsh-hook chpwd load-nvmrc
|
||||
|
||||
load-nvmrc
|
||||
unfunction _omz_nvm_setup_autoload
|
||||
unfunction _omz_setup_autoload
|
||||
}
|
||||
|
||||
if zstyle -t ':omz:plugins:nvm' lazy; then
|
||||
# Call nvm when first using nvm, node, npm, pnpm, yarn, corepack or other commands in lazy-cmd
|
||||
zstyle -a ':omz:plugins:nvm' lazy-cmd nvm_lazy_cmd
|
||||
nvm_lazy_cmd=(_omz_nvm_load nvm node npm npx pnpm pnpx yarn corepack $nvm_lazy_cmd) # default values
|
||||
nvm_lazy_cmd=(nvm node npm npx pnpm yarn corepack $nvm_lazy_cmd) # default values
|
||||
eval "
|
||||
function $nvm_lazy_cmd {
|
||||
for func in $nvm_lazy_cmd; do
|
||||
|
@ -84,16 +84,14 @@ if zstyle -t ':omz:plugins:nvm' lazy; then
|
|||
done
|
||||
# Load nvm if it exists in \$NVM_DIR
|
||||
[[ -f \"\$NVM_DIR/nvm.sh\" ]] && source \"\$NVM_DIR/nvm.sh\"
|
||||
_omz_nvm_setup_completion
|
||||
_omz_nvm_setup_autoload
|
||||
if [[ \"\$0\" != _omz_nvm_load ]]; then
|
||||
\"\$0\" \"\$@\"
|
||||
fi
|
||||
_omz_load_nvm_completion
|
||||
_omz_setup_autoload
|
||||
\"\$0\" \"\$@\"
|
||||
}
|
||||
"
|
||||
unset nvm_lazy_cmd
|
||||
else
|
||||
source "$NVM_DIR/nvm.sh"
|
||||
_omz_nvm_setup_completion
|
||||
_omz_nvm_setup_autoload
|
||||
_omz_load_nvm_completion
|
||||
_omz_setup_autoload
|
||||
fi
|
||||
|
|
|
@ -15,23 +15,22 @@ plugins=(... opentofu)
|
|||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command |
|
||||
|--------|-----------------------|
|
||||
| `tt` | `tofu` |
|
||||
| `tta` | `tofu apply` |
|
||||
| `ttc` | `tofu console` |
|
||||
| `ttd` | `tofu destroy` |
|
||||
| `ttf` | `tofu fmt` |
|
||||
| `ttfr` | `tofu fmt -recursive` |
|
||||
| `tti` | `tofu init` |
|
||||
| `tto` | `tofu output` |
|
||||
| `ttp` | `tofu plan` |
|
||||
| `ttv` | `tofu validate` |
|
||||
| `tts` | `tofu state` |
|
||||
| `ttsh` | `tofu show` |
|
||||
| `ttr` | `tofu refresh` |
|
||||
| `ttt` | `tofu test` |
|
||||
| `ttws` | `tofu workspace` |
|
||||
| Alias | Command |
|
||||
| ----- | --------------- |
|
||||
| `tt` | `tofu` |
|
||||
| `tta` | `tofu apply` |
|
||||
| `ttc` | `tofu console` |
|
||||
| `ttd` | `tofu destroy` |
|
||||
| `ttf` | `tofu fmt` |
|
||||
| `tti` | `tofu init` |
|
||||
| `tto` | `tofu output` |
|
||||
| `ttp` | `tofu plan` |
|
||||
| `ttv` | `tofu validate` |
|
||||
| `tts` | `tofu state` |
|
||||
| `ttsh`| `tofu show` |
|
||||
| `ttr` | `tofu refresh` |
|
||||
| `ttt` | `tofu test` |
|
||||
| `ttws`| `tofu workspace`|
|
||||
|
||||
|
||||
## Prompt functions
|
||||
|
|
|
@ -32,7 +32,6 @@ alias tta='tofu apply'
|
|||
alias ttc='tofu console'
|
||||
alias ttd='tofu destroy'
|
||||
alias ttf='tofu fmt'
|
||||
alias ttfr='tofu fmt -recursive'
|
||||
alias tti='tofu init'
|
||||
alias tto='tofu output'
|
||||
alias ttp='tofu plan'
|
||||
|
|
|
@ -13,6 +13,7 @@ plugins=(... python)
|
|||
| Command | Description |
|
||||
| ---------------- | -------------------------------------------------------------------------------------- |
|
||||
| `py` | Runs `python3`. Only set if `py` is not installed. |
|
||||
| `ipython` | Runs the appropriate `ipython` version according to the activated virtualenv |
|
||||
| `pyfind` | Finds .py files recursively in the current directory |
|
||||
| `pyclean [dirs]` | Deletes byte-code and cache files from a list of directories or the current one |
|
||||
| `pygrep <text>` | Looks for `text` in `*.py` files in the current directory, recursively |
|
||||
|
|
|
@ -43,6 +43,9 @@ function pyuserpaths() {
|
|||
# Grep among .py files
|
||||
alias pygrep='grep -nr --include="*.py"'
|
||||
|
||||
# Run proper IPython regarding current virtualenv (if any)
|
||||
alias ipython='python3 -c "import sys; del sys.path[0]; import IPython; sys.exit(IPython.start_ipython())"'
|
||||
|
||||
# Share local directory as a HTTP server
|
||||
alias pyserver="python3 -m http.server"
|
||||
|
||||
|
@ -71,7 +74,7 @@ function vrun() {
|
|||
}
|
||||
|
||||
# Create a new virtual environment using the specified name.
|
||||
# If none specified, use $PYTHON_VENV_NAME
|
||||
# If none specfied, use $PYTHON_VENV_NAME
|
||||
function mkv() {
|
||||
local name="${1:-$PYTHON_VENV_NAME}"
|
||||
local venvpath="${name:P}"
|
||||
|
|
|
@ -366,10 +366,10 @@ _rails_generate() {
|
|||
;|
|
||||
(controller|job|model|resource|scaffold)
|
||||
opts+=(
|
||||
'--parent=[The parent class for the generated controller]:parent class'
|
||||
'--parent=[The parent class for the generated controler]:parent class'
|
||||
)
|
||||
;|
|
||||
(controller|mailer|resource|scaffold|scaffold_controller)
|
||||
(controler|mailer|resource|scaffold|scaffold_controller)
|
||||
opts+=(
|
||||
'(-e --template-engine)'{-e,--template-engine=}'[Template engine to be invoked]:engine:(erb)'
|
||||
)
|
||||
|
|
|
@ -445,7 +445,7 @@ _scd_Y19oug_match() {
|
|||
# build a list of matching directories reverse-sorted by their probabilities
|
||||
dmatching=( ${(f)"$(
|
||||
builtin printf "%s %s\n" ${(Oakv)drank} |
|
||||
command sort -grk1 )"}
|
||||
/usr/bin/sort -grk1 )"}
|
||||
)
|
||||
dmatching=( ${dmatching#*[[:blank:]]} )
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ function _add_identities() {
|
|||
# this is to mimic the call to ssh-add with no identities
|
||||
if [[ ${#identities} -eq 0 ]]; then
|
||||
# key list found on `ssh-add` man page's DESCRIPTION section
|
||||
for id in id_rsa id_dsa id_ecdsa id_ed25519 id_ed25519_sk identity; do
|
||||
for id in id_rsa id_dsa id_ecdsa id_ed25519 identity; do
|
||||
# check if file exists
|
||||
[[ -f "$HOME/.ssh/$id" ]] && identities+=($id)
|
||||
done
|
||||
|
|
|
@ -634,7 +634,7 @@ _swift_package_unedit() {
|
|||
integer ret=1
|
||||
local -a args
|
||||
args+=(
|
||||
'--force[Unedit the package even if it has uncommitted and unpushed changes]'
|
||||
'--force[Unedit the package even if it has uncommited and unpushed changes]'
|
||||
':package-name:'
|
||||
'--version[Show the version.]'
|
||||
'(-help -h --help)'{-help,-h,--help}'[Show help information.]'
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
# tailscale
|
||||
|
||||
This plugin provides completion for [tailscale](https://tailscale.com/) (Easy software-defined networks using an implementation of wireguard).
|
||||
|
||||
To use it, add `tailscale` to the plugins array in your zshrc file.
|
||||
|
||||
```
|
||||
plugins=(... tailscale)
|
||||
```
|
||||
|
||||
**Author:** [@lukeab](https://github.com/lukeab)
|
|
@ -1,13 +0,0 @@
|
|||
if (( ! $+commands[tailscale] )); then
|
||||
return
|
||||
fi
|
||||
|
||||
# If the completion file doesn't exist yet, we need to autoload it and
|
||||
# bind it to `tailscale`. Otherwise, compinit will have already done that.
|
||||
if [[ ! -f "$ZSH_CACHE_DIR/completions/_tailscale" ]]; then
|
||||
typeset -g -A _comps
|
||||
autoload -Uz _tailscale
|
||||
_comps[tailscale]=_tailscale
|
||||
fi
|
||||
|
||||
tailscale completion zsh >| "$ZSH_CACHE_DIR/completions/_tailscale" &|
|
|
@ -15,23 +15,21 @@ plugins=(... terraform)
|
|||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command |
|
||||
|---------|----------------------------------|
|
||||
| `tf` | `terraform` |
|
||||
| `tfa` | `terraform apply` |
|
||||
| `tfaa` | `terraform apply -auto-approve` |
|
||||
| `tfc` | `terraform console` |
|
||||
| `tfd` | `terraform destroy` |
|
||||
| `tff` | `terraform fmt` |
|
||||
| `tffr` | `terraform fmt -recursive` |
|
||||
| `tfi` | `terraform init` |
|
||||
| `tfiu` | `terraform init -upgrade` |
|
||||
| `tfo` | `terraform output` |
|
||||
| `tfp` | `terraform plan` |
|
||||
| `tfv` | `terraform validate` |
|
||||
| `tfs` | `terraform state` |
|
||||
| `tft` | `terraform test` |
|
||||
| `tfsh` | `terraform show` |
|
||||
| Alias | Command |
|
||||
| ------ | ------------------------- |
|
||||
| `tf` | `terraform` |
|
||||
| `tfa` | `terraform apply` |
|
||||
| `tfc` | `terraform console` |
|
||||
| `tfd` | `terraform destroy` |
|
||||
| `tff` | `terraform fmt` |
|
||||
| `tfi` | `terraform init` |
|
||||
| `tfiu` | `terraform init -upgrade` |
|
||||
| `tfo` | `terraform output` |
|
||||
| `tfp` | `terraform plan` |
|
||||
| `tfv` | `terraform validate` |
|
||||
| `tfs` | `terraform state` |
|
||||
| `tft` | `terraform test` |
|
||||
| `tfsh` | `terraform show` |
|
||||
|
||||
|
||||
## Prompt function
|
||||
|
|
|
@ -17,11 +17,9 @@ function tf_version_prompt_info() {
|
|||
|
||||
alias tf='terraform'
|
||||
alias tfa='terraform apply'
|
||||
alias tfaa='terraform apply -auto-approve'
|
||||
alias tfc='terraform console'
|
||||
alias tfd='terraform destroy'
|
||||
alias tff='terraform fmt'
|
||||
alias tffr='terraform fmt -recursive'
|
||||
alias tfi='terraform init'
|
||||
alias tfiu='terraform init -upgrade'
|
||||
alias tfo='terraform output'
|
||||
|
|
|
@ -29,18 +29,18 @@ The plugin also supports the following:
|
|||
|
||||
## Configuration Variables
|
||||
|
||||
| Variable | Description |
|
||||
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `ZSH_TMUX_AUTOSTART` | Automatically starts tmux (default: `false`) |
|
||||
| `ZSH_TMUX_AUTOSTART_ONCE` | Autostart only if tmux hasn't been started previously (default: `true`) |
|
||||
| `ZSH_TMUX_AUTOCONNECT` | Automatically connect to a previous session if it exits (default: `true`) |
|
||||
| `ZSH_TMUX_AUTOQUIT` | Automatically closes terminal once tmux exits (default: `ZSH_TMUX_AUTOSTART`) |
|
||||
| `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`, `$XDG_CONFIG_HOME/tmux/tmux.conf`) |
|
||||
| `ZSH_TMUX_DEFAULT_SESSION_NAME` | Set tmux default session name when autostart is enabled |
|
||||
| `ZSH_TMUX_AUTONAME_SESSION` | Automatically name new sessions based on the basename of `$PWD` (default: `false`) |
|
||||
| `ZSH_TMUX_DETACHED` | Set the detached mode (default: `false`) |
|
||||
| `ZSH_TMUX_FIXTERM` | Sets `$TERM` to 256-color term or not based on current terminal support |
|
||||
| `ZSH_TMUX_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `tmux` if available, `screen` otherwise) |
|
||||
| `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `tmux-256color` if available, `screen-256color` otherwise) |
|
||||
| `ZSH_TMUX_ITERM2` | Sets the `-CC` option for [iTerm2 tmux integration](https://iterm2.com/documentation-tmux-integration.html) (default: `false`) |
|
||||
| `ZSH_TMUX_UNICODE` | Set `tmux -u` option to support unicode |
|
||||
| Variable | Description |
|
||||
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
||||
| `ZSH_TMUX_AUTOSTART` | Automatically starts tmux (default: `false`) |
|
||||
| `ZSH_TMUX_AUTOSTART_ONCE` | Autostart only if tmux hasn't been started previously (default: `true`) |
|
||||
| `ZSH_TMUX_AUTOCONNECT` | Automatically connect to a previous session if it exits (default: `true`) |
|
||||
| `ZSH_TMUX_AUTOQUIT` | Automatically closes terminal once tmux exits (default: `ZSH_TMUX_AUTOSTART`) |
|
||||
| `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`, `$XDG_CONFIG_HOME/tmux/tmux.conf`) |
|
||||
| `ZSH_TMUX_DEFAULT_SESSION_NAME` | Set tmux default session name when autostart is enabled |
|
||||
| `ZSH_TMUX_AUTONAME_SESSION` | Automatically name new sessions based on the basename of `$PWD` (default: `false`) |
|
||||
| `ZSH_TMUX_DETACHED` | Set the detached mode (default: `false`) |
|
||||
| `ZSH_TMUX_FIXTERM` | Sets `$TERM` to 256-color term or not based on current terminal support |
|
||||
| `ZSH_TMUX_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `tmux` if available, `screen` otherwise) |
|
||||
| `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `tmux-256color` if available, `screen-256color` otherwise) |
|
||||
| `ZSH_TMUX_ITERM2` | Sets the `-CC` option for iTerm2 tmux integration (default: `false`) |
|
||||
| `ZSH_TMUX_UNICODE` | Set `tmux -u` option to support unicode |
|
||||
|
|
|
@ -115,11 +115,9 @@ wd() {
|
|||
|
||||
3. Install manpage (optional):
|
||||
|
||||
Move manpage into an appropriate directory, then trigger `mandb` to discover it
|
||||
|
||||
```zsh
|
||||
sudo install -m 644 ~/.local/wd/wd.1 /usr/share/man/man1/wd.1
|
||||
sudo mandb /usr/share/man/man1
|
||||
sudo cp ~/.local/wd/wd.1 /usr/share/man/man1/wd.1
|
||||
sudo chmod 644 /usr/share/man/man1/wd.1
|
||||
```
|
||||
|
||||
**Note:** when pulling and updating `wd`, you'll need to repeat step 3 should the manpage change
|
||||
|
@ -141,11 +139,10 @@ rm -f ~/.zcompdump; compinit
|
|||
|
||||
## Browse
|
||||
|
||||
`wd` comes with an `fzf`-powered browse feature to fuzzy search through all your warp points. It's available through the `wd browse` command. For quick access you can set up an alias or keybind in your `.zshrc`:
|
||||
If you want to make use of the `fzf`-powered browse feature to fuzzy search through all your warp points, set up a keybind in your `.zshrc`:
|
||||
|
||||
```zsh
|
||||
# ctrl-b to open the fzf browser
|
||||
bindkey ${FZF_WD_BINDKEY:-'^B'} wd_browse_widget
|
||||
bindkey ${FZF_WD_BINDKEY:-'^B'} fuzzy_wd_widget
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
@ -258,6 +255,12 @@ wd --version
|
|||
wd --config ./file <command>
|
||||
```
|
||||
|
||||
* Force `exit` with return code after running. This is not default, as it will *exit your terminal*, though required for testing/debugging.
|
||||
|
||||
```zsh
|
||||
wd --debug <command>
|
||||
```
|
||||
|
||||
* Silence all output:
|
||||
|
||||
```zsh
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env zsh
|
||||
#!/bin/zsh
|
||||
|
||||
# WARP DIRECTORY
|
||||
# ==============
|
||||
|
@ -18,3 +18,4 @@ zle -N wd_browse_widget
|
|||
zle -N wd_restore_buffer
|
||||
autoload -Uz add-zle-hook-widget
|
||||
add-zle-hook-widget line-init wd_restore_buffer
|
||||
bindkey ${FZF_WD_BINDKEY:-'^B'} wd_browse_widget
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env zsh
|
||||
#!/bin/zsh
|
||||
|
||||
# WARP DIRECTORY
|
||||
# ==============
|
||||
|
@ -8,7 +8,7 @@
|
|||
# @github.com/mfaerevaag/wd
|
||||
|
||||
# version
|
||||
readonly WD_VERSION=0.9.0
|
||||
readonly WD_VERSION=0.7.0
|
||||
|
||||
# colors
|
||||
readonly WD_BLUE="\033[96m"
|
||||
|
@ -90,6 +90,7 @@ Commands:
|
|||
clean Remove points warping to nonexistent directories (will prompt unless --force is used)
|
||||
|
||||
-v | --version Print version
|
||||
-d | --debug Exit after execution with exit codes (for testing)
|
||||
-c | --config Specify config file (default ~/.warprc)
|
||||
-q | --quiet Suppress all output
|
||||
-f | --force Allows overwriting without warning (for add & clean)
|
||||
|
@ -425,6 +426,7 @@ wd_export_static_named_directories() {
|
|||
WD_CONFIG=${WD_CONFIG:-$HOME/.warprc}
|
||||
local WD_QUIET=0
|
||||
local WD_EXIT_CODE=0
|
||||
local WD_DEBUG=0
|
||||
|
||||
# Parse 'meta' options first to avoid the need to have them before
|
||||
# other commands. The `-D` flag consumes recognized options so that
|
||||
|
@ -434,6 +436,7 @@ zparseopts -D -E \
|
|||
c:=wd_alt_config -config:=wd_alt_config \
|
||||
q=wd_quiet_mode -quiet=wd_quiet_mode \
|
||||
v=wd_print_version -version=wd_print_version \
|
||||
d=wd_debug_mode -debug=wd_debug_mode \
|
||||
f=wd_force_mode -force=wd_force_mode
|
||||
|
||||
if [[ ! -z $wd_print_version ]]
|
||||
|
@ -580,4 +583,9 @@ unset args
|
|||
unset points
|
||||
unset val &> /dev/null # fixes issue #1
|
||||
|
||||
return $WD_EXIT_CODE
|
||||
if [[ -n $wd_debug_mode ]]
|
||||
then
|
||||
exit $WD_EXIT_CODE
|
||||
else
|
||||
unset wd_debug_mode
|
||||
fi
|
||||
|
|
|
@ -50,18 +50,16 @@ Available search contexts are:
|
|||
| `npmpkg` | `https://www.npmjs.com/search?q=` |
|
||||
| `packagist` | `https://packagist.org/?query=` |
|
||||
| `gopkg` | `https://pkg.go.dev/search?m=package&q=` |
|
||||
| `chatgpt` | `https://chatgpt.com/?q=` |
|
||||
| `reddit` | `https://www.reddit.com/search/?q=` |
|
||||
|
||||
Also there are aliases for bang-searching DuckDuckGo:
|
||||
|
||||
| Context | Bang |
|
||||
| ------- | ---- |
|
||||
| `wiki` | `!w` |
|
||||
| `news` | `!n` |
|
||||
| `map` | `!m` |
|
||||
| `image` | `!i` |
|
||||
| `ducky` | `!` |
|
||||
| Context | Bang |
|
||||
| --------- | ----- |
|
||||
| `wiki` | `!w` |
|
||||
| `news` | `!n` |
|
||||
| `map` | `!m` |
|
||||
| `image` | `!i` |
|
||||
| `ducky` | `!` |
|
||||
|
||||
### Custom search engines
|
||||
|
||||
|
|
|
@ -31,8 +31,6 @@ function web_search() {
|
|||
npmpkg "https://www.npmjs.com/search?q="
|
||||
packagist "https://packagist.org/?query="
|
||||
gopkg "https://pkg.go.dev/search?m=package&q="
|
||||
chatgpt "https://chatgpt.com/?q="
|
||||
reddit "https://www.reddit.com/search/?q="
|
||||
)
|
||||
|
||||
# check whether the search engine is supported
|
||||
|
@ -85,8 +83,6 @@ alias dockerhub='web_search dockerhub'
|
|||
alias npmpkg='web_search npmpkg'
|
||||
alias packagist='web_search packagist'
|
||||
alias gopkg='web_search gopkg'
|
||||
alias chatgpt='web_search chatgpt'
|
||||
alias reddit='web_search reddit'
|
||||
|
||||
#add your own !bang searches here
|
||||
alias wiki='web_search duckduckgo \!w'
|
||||
|
|
|
@ -185,7 +185,7 @@ Result is stored as `$reply[REPLY]` (`$` isn't needed before `REPLY` because
|
|||
of arithmetic context inside `[]`). The returned array might be different from
|
||||
input arguments as `n-list` can process them via incremental search or uniq
|
||||
mode. `$REPLY` is the index in that possibly processed array. If `$REPLY`
|
||||
equals `-1` it means that no selection have been made (user quit via `q`
|
||||
equals `-1` it means that no selection have been made (user quitted via `q`
|
||||
key).
|
||||
|
||||
To set up entries that can be jumped to with `[`,`]` keys add their indices to
|
||||
|
|
|
@ -170,7 +170,7 @@ while (( 1 )); do
|
|||
elif [ -n "$keypad" ]; then
|
||||
final_key="$keypad"
|
||||
else
|
||||
_vpreview_status_msg "Improper input detected"
|
||||
_vpreview_status_msg "Inproper input detected"
|
||||
zcurses refresh status
|
||||
fi
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ source $ZSH/oh-my-zsh.sh
|
|||
# if [[ -n $SSH_CONNECTION ]]; then
|
||||
# export EDITOR='vim'
|
||||
# else
|
||||
# export EDITOR='nvim'
|
||||
# export EDITOR='mvim'
|
||||
# fi
|
||||
|
||||
# Compilation flags
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# the svn plugin has to be activated for this to work.
|
||||
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
|
||||
PROMPT='${ret_status}%{$fg_bold[green]%} %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}'
|
||||
PROMPT='%{${ret_status}%}%{$fg_bold[green]%} %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}$(svn_prompt_info)%{$reset_color%}'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
|
|
|
@ -30,9 +30,8 @@ local return_code="%(?..%F{red}%? ↵%f)"
|
|||
local user_host="${PR_USER}%F{cyan}@${PR_HOST}"
|
||||
local current_dir="%B%F{blue}%~%f%b"
|
||||
local git_branch='$(git_prompt_info)'
|
||||
local venv_prompt='$(virtualenv_prompt_info)'
|
||||
|
||||
PROMPT="╭─${venv_prompt}${user_host} ${current_dir} \$(ruby_prompt_info) ${git_branch}
|
||||
PROMPT="╭─${user_host} ${current_dir} \$(ruby_prompt_info) ${git_branch}
|
||||
╰─$PR_PROMPT "
|
||||
RPROMPT="${return_code}"
|
||||
|
||||
|
@ -40,7 +39,5 @@ ZSH_THEME_GIT_PROMPT_PREFIX="%F{yellow}‹"
|
|||
ZSH_THEME_GIT_PROMPT_SUFFIX="› %f"
|
||||
ZSH_THEME_RUBY_PROMPT_PREFIX="%F{red}‹"
|
||||
ZSH_THEME_RUBY_PROMPT_SUFFIX="›%f"
|
||||
ZSH_THEME_VIRTUALENV_PREFIX="%F{red}("
|
||||
ZSH_THEME_VIRTUALENV_SUFFIX=")%f "
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue