1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-10-16 11:40:46 +00:00

Compare commits

...

44 commits

Author SHA1 Message Date
Eric Johnson
02e314ce9d
Merge 8209567b3c into f11cc8fea1 2024-09-23 10:21:03 -04:00
dependabot[bot]
f11cc8fea1
chore(deps): bump idna in /.github/workflows/dependencies (#12688)
Bumps [idna](https://github.com/kjd/idna) from 3.9 to 3.10.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst)
- [Commits](https://github.com/kjd/idna/compare/v3.9...v3.10)

---
updated-dependencies:
- dependency-name: idna
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-22 16:20:33 +02:00
Carlo Sala
1514145a09
feat(nvm): add _omz_nvm_load function 2024-09-19 11:44:51 +02:00
Carlo Sala
99e2c31484
feat(git): add git_previous_branch function
Closes #12538
2024-09-18 21:05:45 +02:00
Francesco Cataldo
e52598a5cc
feat(web-search): add reddit (#12664) 2024-09-18 20:43:52 +02:00
rakeshgm
d91944d47e
feat(gnzh): add virtualenv prompt (#12666) 2024-09-18 20:42:18 +02:00
Tushar Mohod
865291cb7a
feat (terraform): add apply -auto-approve alias (#12658)
Closes #12591
2024-09-18 20:40:54 +02:00
Erik Teichmann
9bcafe1c27
feat(functions): add takezip (#12670) 2024-09-18 20:26:38 +02:00
Ruslan Tursunov
3151c9c1a3
fix(git): re-add accidentally removed gcn (#12681) 2024-09-18 12:58:00 +02:00
PukNgae Cryolitia
ac325a7cab
feat(bgnotify): add config to pass extra args (#12679) 2024-09-15 23:20:59 +02:00
dependabot[bot]
ec7d01faf8
chore(deps): bump urllib3 in /.github/workflows/dependencies (#12677)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.2 to 2.2.3.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.2.2...2.2.3)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-15 19:36:24 +02:00
dependabot[bot]
8c13f021bf
chore(deps): bump idna in /.github/workflows/dependencies (#12678)
Bumps [idna](https://github.com/kjd/idna) from 3.8 to 3.9.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst)
- [Commits](https://github.com/kjd/idna/compare/v3.8...v3.9)

---
updated-dependencies:
- dependency-name: idna
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-15 19:36:08 +02:00
Marc Cornellà
e3e80b98b5
chore(jsontools): change link to NDJSON spec (#12671)
Fixes #12671
2024-09-15 15:14:38 +02:00
Marc Cornellà
a84bc2dadd
fix(python)!: remove harmful ipython alias (#12676)
BREAKING CHANGE: the `ipython` alias was incorrectly trying to manually call
ipython from the installed module in the virtual environment, when actually
a command already exists when loading the virtual environment. This change
removes the unnecessary alias and allows calling the right command.

Fixes #12676
2024-09-15 15:12:22 +02:00
Saravana J
33ac2ee30f
fix(git): update prefix map for modified files (#12674) 2024-09-15 08:17:43 +02:00
ohmyzsh[bot]
f709cd4548
feat(wd): update to 7054de2b (#12675)
Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com>
2024-09-15 08:16:50 +02:00
Tulsi Prasad
f6cd6a7769
feat(web-search): add chatgpt (#12660) 2024-09-10 15:23:37 +02:00
Mattias Eriksson
2abecedf67
feat(ssh-agent): support id_ed25519_sk (#12663) 2024-09-10 11:32:18 +02:00
Carlo Sala
80fa5e1376
fix(1password): copy password properly in opswd
Closes #12635
2024-09-05 20:21:14 +02:00
Carlo Sala
95579e3ca1
feat(1password): make completion loading async 2024-09-05 20:21:13 +02:00
Jérémy
bc42097900
feat(kubectl): show labels in aliases kgpsl (get pod) and kgnosl (get node) (#12612)
Co-authored-by: Marc Cornellà <marc@mcornella.com>
2024-09-05 19:57:11 +02:00
michael-follmann
e6380085f3
feat(terraform): add fmt -recursive alias (#12637) 2024-09-05 19:52:39 +02:00
Eduardo Dos Santos Vilke
2acfe1aa0e
feat(localstack): add plugin (#12595) 2024-09-05 19:40:19 +02:00
Marc Cornellà
e50dd3417c
feat(extract): add support for .crx (Chrome extension format) (#12652) 2024-09-05 12:07:18 +02:00
Marc Cornellà
ab3d42a34c
Revert "fix(awesomepanda): new line wrap" (#12651)
This reverts commit 80c114cb3a.
2024-09-03 23:35:22 +02:00
dependabot[bot]
b8c69d2652
chore(deps): bump certifi in /.github/workflows/dependencies (#12646)
Bumps [certifi](https://github.com/certifi/python-certifi) from 2024.7.4 to 2024.8.30.
- [Commits](https://github.com/certifi/python-certifi/compare/2024.07.04...2024.08.30)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-01 21:02:04 +02:00
Alexander Cyon
d78275fdbb
chore: fix typos (#12647) 2024-09-01 21:01:27 +02:00
Marc Cornellà
c68ff8aeed
feat(extract): add support for .vsix files (VS Code extension) (#12643) 2024-08-30 14:30:57 +02:00
Carlo Sala
ea8068aa3e
fix(tailscale): make completion loading async 2024-08-29 12:19:19 +02:00
Luke Ashe-Browne
e2ba73af63
feat(tailscale): new tailscale plugin (#12523) 2024-08-28 15:01:36 -07:00
Błażej Sowa
c80050d6f5
fix(scd): avoid hardcoded binary path (#12641)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
2024-08-28 14:27:50 +02:00
Carlo Sala
a3dfe29036
feat(nvm): add pnpx as lazy cmd 2024-08-28 10:34:25 +02:00
robertoaceves
efe21261d0
fix(grep): remove duplicate options (#12639) 2024-08-27 08:13:47 +02:00
dependabot[bot]
f622e6a636
chore(deps): bump idna from 3.7 to 3.8 in /.github/workflows/dependencies (#12638)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-25 17:15:23 +02:00
Mathias
ebb479e5e2
feat(mix): add mix plugin test.watch (#10963) 2024-08-21 17:50:42 +02:00
Carlo Sala
c10a99406a
chore: typo 2024-08-20 16:34:08 +02:00
Marc Cornellà
2056aeeead Revert "feat(git)!: ask for confirmation in gpf alias (#10169)"
This reverts commit c13795d4c4.
2024-08-18 11:22:30 +02:00
whisperity
b0204f7839
feat(git): add gmff, gprum(i), grbum aliases to work with upstream remotes (#11428) 2024-08-15 17:53:03 +02:00
Marc Cornellà
f30df6c855
docs: document disclaimer about theme appearance 2024-08-15 17:04:50 +02:00
Marc Cornellà
c13795d4c4
feat(git)!: ask for confirmation in gpf alias (#10169)
- Rename `git push --force-with-lease ...` to `gpff`
- Add a y/n confirmation prompt to `gpf` before running `git push --force-with-lease ...`

BREAKING CHANGE: this change adds a confirmation prompt to the `gpf` alias before
running the potentially destructive `git push --force-with-lease` command. If you
want to force-run the command without having to confirm it, run `gpff`.
2024-08-15 16:48:03 +02:00
Marc Cornellà
d26c4a2766
chore(tmux): add link to iTerm2 integration docs 2024-08-15 16:26:46 +02:00
Sebastian Müller
9ba6daa1b5
feat(conda): add conda aliases plugin
Closes #7318
Closed #9691

Co-authored-by: garywei944 <33930674+garywei944@users.noreply.github.com>
Co-authored-by: Marc Cornellà <marc@mcornella.com>
2024-08-14 09:18:18 +02:00
Gentoo
d6f84f3e7d
fix(catimg): add support to magick binary (#12608)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
2024-08-12 11:46:16 +02:00
Eric Johnson
8209567b3c feat(sublime-merge): add windows path for sublime merge 2022-04-16 13:19:53 -04:00
62 changed files with 540 additions and 276 deletions

View file

@ -28,7 +28,7 @@ dependencies:
plugins/wd:
repo: mfaerevaag/wd
branch: master
version: tag:v0.7.1
version: tag:v0.9.0
precopy: |
set -e
rm -r test

View file

@ -1,7 +1,7 @@
certifi==2024.7.4
certifi==2024.8.30
charset-normalizer==3.3.2
idna==3.7
idna==3.10
PyYAML==6.0.2
requests==2.32.3
semver==3.0.2
urllib3==2.2.2
urllib3==2.2.3

View file

@ -167,7 +167,15 @@ ZSH_THEME="agnoster" # (this is one of the fancy ones)
# see https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#agnoster
```
_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)_
> [!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).
Open up a new terminal window and your prompt should look something like this:

View file

@ -57,6 +57,16 @@ 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})"
@ -65,6 +75,8 @@ 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

View file

@ -162,6 +162,18 @@ 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() {
@ -227,7 +239,7 @@ function _omz_git_prompt_status() {
prefix_constant_map=(
'\?\? ' 'UNTRACKED'
'A ' 'ADDED'
'M ' 'ADDED'
'M ' 'MODIFIED'
'MM ' 'MODIFIED'
' M ' 'MODIFIED'
'AM ' 'MODIFIED'

View file

@ -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 $GREP_OPTIONS"
alias fgrep="grep -F $GREP_OPTIONS"
alias egrep="grep -E"
alias fgrep="grep -F"
# write to cache file if cache directory is writable
if [[ -w "$ZSH_CACHE_DIR" ]]; then

View file

@ -1,9 +1,15 @@
# Do nothing if op is not installed
(( ${+commands[op]} )) || return
# Load op completion
eval "$(op completion zsh)"
compdef _op op
# 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 opswd function
autoload -Uz opswd

View file

@ -27,7 +27,7 @@ function opswd() {
local password
# Copy the password to the clipboard
if ! password=$(op item get "$service" --fields password 2>/dev/null); then
if ! password=$(op item get "$service" --reveal --fields password 2>/dev/null); then
echo "error: could not obtain password for $service"
return 1
fi

View file

@ -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 redistrubute intervals in a genome.]" \
"shuffle[Randomly redistribute 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.]" \

View file

@ -38,6 +38,7 @@ 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:

View file

@ -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"} &>/dev/null
terminal-notifier -message "$message" -title "$title" ${=icon:+-appIcon "$icon"} ${=term_id:+-activate "$term_id"} ${=bgnotify_extraargs:-} &>/dev/null
elif (( ${+commands[growlnotify]} )); then # macOS growl
growlnotify -m "$title" "$message"
growlnotify -m "$title" "$message" ${=bgnotify_extraargs:-}
elif (( ${+commands[notify-send]} )); then
notify-send "$title" "$message" ${=icon:+--icon "$icon"}
notify-send "$title" "$message" ${=icon:+--icon "$icon"} ${=bgnotify_extraargs:-}
elif (( ${+commands[kdialog]} )); then # KDE
kdialog --title "$title" --passivepopup "$message" 5
kdialog --title "$title" --passivepopup "$message" 5 ${=bgnotify_extraargs:-}
elif (( ${+commands[notifu]} )); then # cygwin
notifu /m "$message" /p "$title" ${=icon:+/i "$icon"}
notifu /m "$message" /p "$title" ${=icon:+/i "$icon"} ${=bgnotify_extraargs:-}
fi
}

View file

@ -24,7 +24,7 @@ if (( ! $+commands[brew] )); then
fi
if [[ -z "$HOMEBREW_PREFIX" ]]; then
# Maintain compatability with potential custom user profiles, where we had
# Maintain compatibility 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)"

View file

@ -1,6 +1,7 @@
# 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:
@ -10,7 +11,7 @@ plugins=(... catimg)
## Requirements
- `convert` (ImageMagick)
- `magick convert` (ImageMagick)
## Functions

View file

@ -9,9 +9,11 @@
function catimg() {
if [[ -x `which convert` ]]; then
zsh $ZSH/plugins/catimg/catimg.sh $@
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 $@
else
echo "catimg need convert (ImageMagick) to work)"
echo "catimg need magick/convert (ImageMagick) to work)"
fi
}

View file

@ -7,6 +7,10 @@
# 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"
@ -43,23 +47,23 @@ if [ ! "$WIDTH" ]; then
else
COLS=$(expr $WIDTH "/" $(echo -n "$CHAR" | wc -c))
fi
WIDTH=$(convert "$IMG" -print "%w\n" /dev/null)
WIDTH=$($CONVERT_CMD "$IMG" -print "%w\n" /dev/null)
if [ "$WIDTH" -gt "$COLS" ]; then
WIDTH=$COLS
fi
REMAP=""
if convert "$IMG" -resize $COLS\> +dither -remap $COLOR_FILE /dev/null ; then
if $CONVERT_CMD "$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 "$IMG" -colors 256 PNG8:tmp.png
#IMG="tmp.png"
# $CONVERT_CMD "$IMG" -colors 256 PNG8:tmp.png
# IMG="tmp.png"
fi
# Display the image
I=0
convert "$IMG" -resize $COLS\> +dither `echo $REMAP` txt:- 2>/dev/null |
$CONVERT_CMD "$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

37
plugins/conda/README.md Normal file
View file

@ -0,0 +1,37 @@
# 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 |

View file

@ -0,0 +1,23 @@
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'

View file

@ -39,7 +39,7 @@ if (( ! $+commands[docker] )); then
return
fi
# Standarized $0 handling
# Standardized $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}"

View file

@ -1,6 +1,6 @@
"""
Update Emoji.py
Refeshes OMZ emoji database based on the latest Unicode spec
Refreshes 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 sanctionned
# even the one that are not officially sanctioned
# and are implemented by, say, only one vendor
if _status == "unqualified":
shortname += "_unqualified"

View file

@ -52,6 +52,7 @@ 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 |

View file

@ -1,7 +1,54 @@
#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)*.(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)(-.)'" \
"*::archive file:_files -g '(#i)*.(${(j:|:)exts})(-.)'" \
&& return 0

View file

@ -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) unzip "$full_path" ;;
(*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl|*.vsix|*.crx) unzip "$full_path" ;;
(*.rar) unrar x -ad "$full_path" ;;
(*.rpm)
rpm2cpio "$full_path" | cpio --quiet -id ;;

View file

@ -23,7 +23,7 @@ if is-at-least 5.5; then
fi
{
# Standarized $0 handling
# Standardized $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}"

View file

@ -73,6 +73,7 @@ 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` |
@ -114,6 +115,7 @@ 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` |
@ -125,6 +127,8 @@ 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)` |
@ -154,6 +158,7 @@ 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` |

View file

@ -197,6 +197,7 @@ 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)'
@ -255,6 +256,7 @@ 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'
@ -274,6 +276,8 @@ 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() {
@ -337,6 +341,7 @@ 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'

View file

@ -295,8 +295,8 @@ _history-substring-search-begin() {
fi
#
# Escape and join query parts with wildcard character '*' as seperator
# `(j:CHAR:)` join array to string with CHAR as seperator
# Escape and join query parts with wildcard character '*' as separator
# `(j:CHAR:)` join array to string with CHAR as separator
#
local search_pattern="${(j:*:)_history_substring_search_query_parts[@]//(#m)[\][()|\\*?#<>~^]/\\$MATCH}*"

View file

@ -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 Aplha 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 Alpha Centauri.'"
- The Book getting all nostalgic.
%

View file

@ -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](http://ndjson.org/) input, which means all functions
The plugin also supports [NDJSON](https://github.com/ndjson/ndjson-spec) 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`:

View file

@ -11,122 +11,124 @@ 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 |
| 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 |
| 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 |
## Wrappers

View file

@ -39,6 +39,9 @@ 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'
@ -47,12 +50,6 @@ 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'
@ -144,6 +141,7 @@ 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'

View file

@ -0,0 +1,24 @@
# 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)

View file

@ -0,0 +1,37 @@
# 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.

After

Width:  |  Height:  |  Size: 69 KiB

View file

@ -78,7 +78,7 @@ _lpass() {
has_sync=1
;;
status)
_arguments : '(-q --quiet)'{-q,--quiet}'[Supress output to stdout]'
_arguments : '(-q --quiet)'{-q,--quiet}'[Suppress output to stdout]'
has_color=1
;;
sync)

View file

@ -17,3 +17,4 @@ 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) |

View file

@ -109,6 +109,7 @@ _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'
@ -120,7 +121,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.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.watch test.coverage xref)
_wanted tasks expl 'help' compadd $tasks
}
@ -148,6 +149,9 @@ case $state in
(test)
_files
;;
(test.watch)
_files
;;
(run)
_files
;;

View file

@ -26,9 +26,10 @@ 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`, `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`, `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:
```zsh
zstyle ':omz:plugins:nvm' lazy yes
@ -41,6 +42,8 @@ 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_

View file

@ -20,7 +20,7 @@ if [[ -z "$NVM_DIR" ]] || [[ ! -f "$NVM_DIR/nvm.sh" ]]; then
return
fi
function _omz_load_nvm_completion {
function _omz_nvm_setup_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_load_nvm_completion {
break
fi
done
unfunction _omz_load_nvm_completion
unfunction _omz_nvm_setup_completion
}
function _omz_setup_autoload {
function _omz_nvm_setup_autoload {
if ! zstyle -t ':omz:plugins:nvm' autoload; then
unfunction _omz_setup_autoload
unfunction _omz_nvm_setup_autoload
return
fi
@ -68,13 +68,13 @@ function _omz_setup_autoload {
add-zsh-hook chpwd load-nvmrc
load-nvmrc
unfunction _omz_setup_autoload
unfunction _omz_nvm_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=(nvm node npm npx pnpm yarn corepack $nvm_lazy_cmd) # default values
nvm_lazy_cmd=(_omz_nvm_load nvm node npm npx pnpm pnpx yarn corepack $nvm_lazy_cmd) # default values
eval "
function $nvm_lazy_cmd {
for func in $nvm_lazy_cmd; do
@ -84,14 +84,16 @@ 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_load_nvm_completion
_omz_setup_autoload
\"\$0\" \"\$@\"
_omz_nvm_setup_completion
_omz_nvm_setup_autoload
if [[ \"\$0\" != _omz_nvm_load ]]; then
\"\$0\" \"\$@\"
fi
}
"
unset nvm_lazy_cmd
else
source "$NVM_DIR/nvm.sh"
_omz_load_nvm_completion
_omz_setup_autoload
_omz_nvm_setup_completion
_omz_nvm_setup_autoload
fi

View file

@ -15,22 +15,23 @@ plugins=(... opentofu)
## Aliases
| 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`|
| 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` |
## Prompt functions

View file

@ -32,6 +32,7 @@ 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'

View file

@ -13,7 +13,6 @@ 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 |

View file

@ -43,9 +43,6 @@ 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"
@ -74,7 +71,7 @@ function vrun() {
}
# Create a new virtual environment using the specified name.
# If none specfied, use $PYTHON_VENV_NAME
# If none specified, use $PYTHON_VENV_NAME
function mkv() {
local name="${1:-$PYTHON_VENV_NAME}"
local venvpath="${name:P}"

View file

@ -366,10 +366,10 @@ _rails_generate() {
;|
(controller|job|model|resource|scaffold)
opts+=(
'--parent=[The parent class for the generated controler]:parent class'
'--parent=[The parent class for the generated controller]:parent class'
)
;|
(controler|mailer|resource|scaffold|scaffold_controller)
(controller|mailer|resource|scaffold|scaffold_controller)
opts+=(
'(-e --template-engine)'{-e,--template-engine=}'[Template engine to be invoked]:engine:(erb)'
)

View file

@ -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} |
/usr/bin/sort -grk1 )"}
command sort -grk1 )"}
)
dmatching=( ${dmatching#*[[:blank:]]} )

View file

@ -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 identity; do
for id in id_rsa id_dsa id_ecdsa id_ed25519 id_ed25519_sk identity; do
# check if file exists
[[ -f "$HOME/.ssh/$id" ]] && identities+=($id)
done

View file

@ -4,15 +4,21 @@
if [[ "$OSTYPE" == linux* ]]; then
local _sublime_linux_paths
_sublime_linux_paths=(
"$HOME/bin/sublime_merge"
"/opt/sublime_merge/sublime_merge"
"/usr/bin/sublime_merge"
"/usr/local/bin/sublime_merge"
"/usr/bin/sublime_merge"
"/usr/local/bin/smerge"
"/usr/bin/smerge"
if [[ "$(uname -r)" = *icrosoft* ]]; then
_sublime_linux_paths=(
"$(wslpath -u 'C:\Program Files\Sublime Merge\sublime_merge.exe' 2>/dev/null)"
)
else
_sublime_linux_paths=(
"$HOME/bin/sublime_merge"
"/opt/sublime_merge/sublime_merge"
"/usr/bin/sublime_merge"
"/usr/local/bin/sublime_merge"
"/usr/bin/sublime_merge"
"/usr/local/bin/smerge"
"/usr/bin/smerge"
)
fi
for _sublime_merge_path in $_sublime_linux_paths; do
if [[ -a $_sublime_merge_path ]]; then
sm_run() { $_sublime_merge_path "$@" >/dev/null 2>&1 &| }

View file

@ -634,7 +634,7 @@ _swift_package_unedit() {
integer ret=1
local -a args
args+=(
'--force[Unedit the package even if it has uncommited and unpushed changes]'
'--force[Unedit the package even if it has uncommitted and unpushed changes]'
':package-name:'
'--version[Show the version.]'
'(-help -h --help)'{-help,-h,--help}'[Show help information.]'

View file

@ -0,0 +1,11 @@
# 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)

View file

@ -0,0 +1,13 @@
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" &|

View file

@ -15,21 +15,23 @@ plugins=(... terraform)
## Aliases
| 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` |
| 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` |
## Prompt function

View file

@ -17,9 +17,11 @@ 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'

View file

@ -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 (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](https://iterm2.com/documentation-tmux-integration.html) (default: `false`) |
| `ZSH_TMUX_UNICODE` | Set `tmux -u` option to support unicode |

View file

@ -115,9 +115,11 @@ wd() {
3. Install manpage (optional):
Move manpage into an appropriate directory, then trigger `mandb` to discover it
```zsh
sudo cp ~/.local/wd/wd.1 /usr/share/man/man1/wd.1
sudo chmod 644 /usr/share/man/man1/wd.1
sudo install -m 644 ~/.local/wd/wd.1 /usr/share/man/man1/wd.1
sudo mandb /usr/share/man/man1
```
**Note:** when pulling and updating `wd`, you'll need to repeat step 3 should the manpage change
@ -139,10 +141,11 @@ rm -f ~/.zcompdump; compinit
## Browse
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`:
`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`:
```zsh
bindkey ${FZF_WD_BINDKEY:-'^B'} fuzzy_wd_widget
# ctrl-b to open the fzf browser
bindkey ${FZF_WD_BINDKEY:-'^B'} wd_browse_widget
```
## Usage
@ -255,12 +258,6 @@ 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

View file

@ -1,4 +1,4 @@
#!/bin/zsh
#!/usr/bin/env zsh
# WARP DIRECTORY
# ==============
@ -18,4 +18,3 @@ 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

View file

@ -1,4 +1,4 @@
#!/bin/zsh
#!/usr/bin/env zsh
# WARP DIRECTORY
# ==============
@ -8,7 +8,7 @@
# @github.com/mfaerevaag/wd
# version
readonly WD_VERSION=0.7.0
readonly WD_VERSION=0.9.0
# colors
readonly WD_BLUE="\033[96m"
@ -90,7 +90,6 @@ 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)
@ -426,7 +425,6 @@ 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
@ -436,7 +434,6 @@ 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 ]]
@ -583,9 +580,4 @@ unset args
unset points
unset val &> /dev/null # fixes issue #1
if [[ -n $wd_debug_mode ]]
then
exit $WD_EXIT_CODE
else
unset wd_debug_mode
fi
return $WD_EXIT_CODE

View file

@ -50,16 +50,18 @@ 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

View file

@ -31,6 +31,8 @@ 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
@ -83,6 +85,8 @@ 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'

View file

@ -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 quitted via `q`
equals `-1` it means that no selection have been made (user quit via `q`
key).
To set up entries that can be jumped to with `[`,`]` keys add their indices to

View file

@ -170,7 +170,7 @@ while (( 1 )); do
elif [ -n "$keypad" ]; then
final_key="$keypad"
else
_vpreview_status_msg "Inproper input detected"
_vpreview_status_msg "Improper input detected"
zcurses refresh status
fi

View file

@ -85,7 +85,7 @@ source $ZSH/oh-my-zsh.sh
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# export EDITOR='nvim'
# fi
# Compilation flags

View file

@ -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%}"

View file

@ -30,8 +30,9 @@ 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="╭─${user_host} ${current_dir} \$(ruby_prompt_info) ${git_branch}
PROMPT="╭─${venv_prompt}${user_host} ${current_dir} \$(ruby_prompt_info) ${git_branch}
╰─$PR_PROMPT "
RPROMPT="${return_code}"
@ -39,5 +40,7 @@ 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 "
}