Merge branch 'ohmyzsh:master' into adamsir/git-checkout-interactive

This commit is contained in:
Adam Šír 2025-06-26 11:19:23 +02:00 committed by GitHub
commit a4a8968be1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
268 changed files with 6113 additions and 4175 deletions

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

@ -1,8 +0,0 @@
# adb autocomplete plugin
* Adds autocomplete options for all adb commands.
* Add autocomplete for `adb -s`
## Requirements
In order to make this work, you will need to have the Android adb tools set up in your path.

View file

@ -1,67 +0,0 @@
#compdef adb
#autoload
# in order to make this work, you will need to have the android adb tools
# adb zsh completion, based on homebrew completion
local -a _1st_arguments
_1st_arguments=(
'bugreport:return all information from the device that should be included in a bug report.'
'connect:connect to a device via TCP/IP Port 5555 is default.'
'devices:list all connected devices'
'disconnect:disconnect from a TCP/IP device. Port 5555 is default.'
'emu:run emulator console command'
'forward:forward socket connections'
'get-devpath:print the device path'
'get-serialno:print the serial number of the device'
'get-state:print the current state of the device: offline | bootloader | device'
'help:show the help message'
'install:push this package file to the device and install it'
'jdwp:list PIDs of processes hosting a JDWP transport'
'keygen:generate adb public/private key'
'kill-server:kill the server if it is running'
'logcat:view device log'
'pull:copy file/dir from device'
'push:copy file/dir to device'
'reboot:reboots the device, optionally into the bootloader or recovery program'
'reboot-bootloader:reboots the device into the bootloader'
'remount:remounts the partitions on the device read-write'
'root:restarts the adbd daemon with root permissions'
'sideload:push a ZIP to device and install it'
'shell:run remote shell interactively'
'sync:copy host->device only if changed (-l means list but dont copy)'
'start-server:ensure that there is a server running'
'tcpip:restart host adb in tcpip mode'
'uninstall:remove this app package from the device'
'usb:restart the adbd daemon listing on USB'
'version:show version num'
'wait-for-device:block until device is online'
)
local expl
local -a pkgs installed_pkgs
_arguments \
'-s[devices]:specify device:->specify_device' \
'*:: :->subcmds' && return 0
case "$state" in
specify_device)
_values -C 'devices' ${$(adb devices -l|awk 'NR>1&& $1 \
{sub(/ +/," ",$0); \
gsub(":","\\:",$1); \
for(i=1;i<=NF;i++) {
if($i ~ /model:/) { split($i,m,":") } \
else if($i ~ /product:/) { split($i,p,":") } } \
printf "%s[%s(%s)] ",$1, p[2], m[2]}'):-""}
return
;;
esac
if (( CURRENT == 1 )); then
_describe -t commands "adb subcommand" _1st_arguments
return
fi
_files

View file

@ -1,13 +0,0 @@
# The Silver Searcher
This plugin provides completion support for [`ag`](https://github.com/ggreer/the_silver_searcher).
To use it, add ag to the plugins array in your zshrc file.
```zsh
plugins=(... ag)
```
## INSTALLATION NOTES
Besides oh-my-zsh, `ag` needs to be installed by following these steps: https://github.com/ggreer/the_silver_searcher#installing.

View file

@ -1,66 +0,0 @@
#compdef ag
#autoload
typeset -A opt_args
# Took the liberty of not listing every option… specially aliases and -D
_ag () {
local -a _1st_arguments
_1st_arguments=(
'--ackmate:Print results in AckMate-parseable format'
{'-A','--after'}':[LINES] Print lines after match (Default: 2)'
{'-B','--before'}':[LINES] Print lines before match (Default: 2)'
'--break:Print newlines between matches in different files'
'--nobreak:Do not print newlines between matches in different files'
{'-c','--count'}':Only print the number of matches in each file'
'--color:Print color codes in results (Default: On)'
'--nocolor:Do not print color codes in results'
'--color-line-number:Color codes for line numbers (Default: 1;33)'
'--color-match:Color codes for result match numbers (Default: 30;43)'
'--color-path:Color codes for path names (Default: 1;32)'
'--column:Print column numbers in results'
{'-H','--heading'}':Print file names (On unless searching a single file)'
'--noheading:Do not print file names (On unless searching a single file)'
'--line-numbers:Print line numbers even for streams'
{'-C','--context'}':[LINES] Print lines before and after matches (Default: 2)'
'-g:[PATTERN] Print filenames matching PATTERN'
{'-l','--files-with-matches'}':Only print filenames that contain matches'
{'-L','--files-without-matches'}':Only print filenames that do not contain matches'
'--no-numbers:Do not print line numbers'
{'-o','--only-matching'}':Prints only the matching part of the lines'
'--print-long-lines:Print matches on very long lines (Default: 2k characters)'
'--passthrough:When searching a stream, print all lines even if they do not match'
'--silent:Suppress all log messages, including errors'
'--stats:Print stats (files scanned, time taken, etc.)'
'--vimgrep:Print results like vim :vimgrep /pattern/g would'
{'-0','--null'}':Separate filenames with null (for "xargs -0")'
{'-a','--all-types'}':Search all files (does not include hidden files / .gitignore)'
'--depth:[NUM] Search up to NUM directories deep (Default: 25)'
{'-f','--follow'}':Follow symlinks'
{'-G','--file-search-regex'}':[PATTERN] Limit search to filenames matching PATTERN'
'--hidden:Search hidden files (obeys .*ignore files)'
{'-i','--ignore-case'}':Match case insensitively'
'--ignore:[PATTERN] Ignore files/directories matching PATTERN'
{'-m','--max-count'}':[NUM] Skip the rest of a file after NUM matches (Default: 10k)'
{'-p','--path-to-agignore'}':[PATH] Use .agignore file at PATH'
{'-Q','--literal'}':Do not parse PATTERN as a regular expression'
{'-s','--case-sensitive'}':Match case'
{'-S','--smart-case'}':Insensitive match unless PATTERN has uppercase (Default: On)'
'--search-binary:Search binary files for matches'
{'-t','--all-text'}':Search all text files (Hidden files not included)'
{'-u','--unrestricted'}':Search all files (ignore .agignore and _all_)'
{'-U','--skip-vcs-ignores'}':Ignore VCS files (stil obey .agignore)'
{'-v','--invert-match'}':Invert match'
{'-w','--word-regexp'}':Only match whole words'
{'-z','--search-zip'}':Search contents of compressed (e.g., gzip) files'
'--list-file-types:list of supported file types'
)
if [[ $words[-1] =~ "^-" ]]; then
_describe -t commands "ag options" _1st_arguments && ret=0
else
_files && ret=0
fi
}

View file

@ -2,7 +2,7 @@
This plugin searches the defined aliases and outputs any that match the command inputted. This makes learning new aliases easier.
## Usage
## Setup
To use it, add `alias-finder` to the `plugins` array of your zshrc file:
```
@ -22,6 +22,41 @@ zstyle ':omz:plugins:alias-finder' cheaper yes # disabled by default
As you can see, options are also available with zstyle.
## Usage
When you execute a command alias finder will look at your defined aliases and suggest shorter aliases you could have used, for example:
Running the un-aliased `git status` command:
```sh
╭─tim@fox ~/repo/gitopolis main
╰─$ git status
gst='git status' # <=== shorter suggestion from alias-finder
On branch main
Your branch is up-to-date with 'origin/main'.
nothing to commit, working tree clean
```
Running a shorter `git st` alias from `.gitconfig` that it suggested :
```sh
╭─tim@fox ~/repo/gitopolis main
╰─$ git st
gs='git st' # <=== shorter suggestion from alias-finder
## main...origin/main
```
Running the shortest `gs` shell alias that it found:
```sh
╭─tim@fox ~/repo/gitopolis main
╰─$ gs
# <=== no suggestions alias-finder because this is the shortest
## main...origin/main
```
![image](https://github.com/ohmyzsh/ohmyzsh/assets/19378/39642750-fb10-4f1a-b7f9-f36789eeb01b)
### Options
> In order to clarify, let's say `alias a=abc` has source 'abc' and destination 'a'.

View file

@ -36,14 +36,18 @@ alias-finder() {
# make filter to find only shorter results than current cmd
if [[ $cheaper == true ]]; then
cmdLen=$(echo -n "$cmd" | wc -c)
filter="^'{0,1}.{0,$((cmdLen - 1))}="
if [[ $cmdLen -le 1 ]]; then
return
fi
filter="^'?.{1,$((cmdLen - 1))}'?=" # some aliases is surrounded by single quotes
fi
alias | grep -E "$filter" | grep -E "=$finder"
if [[ $exact == true ]]; then
break # because exact case is only one
elif [[ $longer = true ]]; then
elif [[ $longer == true ]]; then
break # because above grep command already found every longer aliases during first cycle
fi

View file

@ -1,7 +1,5 @@
# Aliases cheatsheet
**Maintainer:** [@hqingyi](https://github.com/hqingyi)
With lots of 3rd-party amazing aliases installed, this plugin helps list the shortcuts
that are currently available based on the plugins you have enabled.
@ -13,6 +11,8 @@ plugins=(aliases)
Requirements: Python needs to be installed.
**Maintainer:** [@hqingyi](https://github.com/hqingyi)
## Usage
- `als`: show all aliases by group

View file

@ -1,7 +1,5 @@
# ansible plugin
## Introduction
The `ansible plugin` adds several aliases for useful [ansible](https://docs.ansible.com/ansible/latest/index.html) commands and [aliases](#aliases).
To use it, add `ansible` to the plugins array of your zshrc file:

View file

@ -178,26 +178,27 @@ fi
# Check Arch Linux PGP Keyring before System Upgrade to prevent failure.
function upgrade() {
sudo pacman -Sy
echo ":: Checking Arch Linux PGP Keyring..."
local installedver="$(LANG= sudo pacman -Qi archlinux-keyring | grep -Po '(?<=Version : ).*')"
local currentver="$(LANG= sudo pacman -Si archlinux-keyring | grep -Po '(?<=Version : ).*')"
if [ $installedver != $currentver ]; then
echo " Arch Linux PGP Keyring is out of date."
echo " Updating before full system upgrade."
sudo pacman -Sy --needed --noconfirm archlinux-keyring
sudo pacman -S --needed --noconfirm archlinux-keyring
else
echo " Arch Linux PGP Keyring is up to date."
echo " Proceeding with full system upgrade."
fi
if (( $+commands[yay] )); then
yay -Syu
yay -Su
elif (( $+commands[trizen] )); then
trizen -Syu
trizen -Su
elif (( $+commands[pacaur] )); then
pacaur -Syu
pacaur -Su
elif (( $+commands[aura] )); then
sudo aura -Syu
sudo aura -Su
else
sudo pacman -Syu
sudo pacman -Su
fi
}

View file

@ -0,0 +1,9 @@
# Arduino CLI plugin
This plugin adds completion for the [arduino-cli](https://github.com/arduino/arduino-cli) tool.
To use it, add `arduino-cli` to the plugins array in your zshrc file:
```zsh
plugins=(... arduino-cli)
```

View file

@ -0,0 +1,14 @@
if (( ! $+commands[arduino-cli] )); then
return
fi
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `arduino-cli`. Otherwise, compinit will have already done that.
if [[ ! -f "$ZSH_CACHE_DIR/completions/_arduino-cli" ]]; then
typeset -g -A _comps
autoload -Uz _arduino-cli
_comps[arduino-cli]=_arduino-cli
fi
# Generate and load arduino-cli completion
arduino-cli completion zsh >! "$ZSH_CACHE_DIR/completions/_arduino-cli" &|

View file

@ -1,30 +1,48 @@
## asdf
**Maintainer:** [@RobLoach](https://github.com/RobLoach)
# asdf
Adds integration with [asdf](https://github.com/asdf-vm/asdf), the extendable version manager, with support for Ruby, Node.js, Elixir, Erlang and more.
### Installation
## Installation
1. [Download asdf](https://asdf-vm.com/guide/getting-started.html#_2-download-asdf) by running the following:
```
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
```
2. [Enable asdf](https://asdf-vm.com/guide/getting-started.html#_3-install-asdf) by adding it to your `plugins` definition in `~/.zshrc`.
```
plugins=(asdf)
```
### Usage
See the [asdf documentation](https://asdf-vm.com/guide/getting-started.html#_4-install-a-plugin) for information on how to use asdf:
1. [Install](https://asdf-vm.com/guide/getting-started.html#_1-install-asdf) asdf and ensure that's it's discoverable on `$PATH`;
2. Enable it by adding it to your `plugins` definition in `~/.zshrc`:
```sh
plugins=(asdf)
```
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
## Usage
Refer to the [asdf plugin documentation](https://asdf-vm.com/guide/getting-started.html#_4-install-a-plugin) for information on how to add a plugin and install the many runtime versions for it.
Example for installing the nodejs plugin and the many runtimes for it:
```sh
# Add plugin to asdf
asdf plugin add nodejs
# Install the latest available version
asdf install nodejs latest
asdf global nodejs latest
asdf local nodejs latest
# Uninstall the latest version
asdf uninstall nodejs latest
# Install a specific version
asdf install nodejs 16.5.0
# Set the latest version in .tool-versions of the `current directory`
asdf set nodejs latest
# Set a specific version in the `parent directory`
asdf set -p nodejs 16.5.0 # -p is shorthand for --parent
# Set a global version under `$HOME`
asdf set -u nodejs 16.5.0 # -u is shorthand for --home
```
For more commands, run `asdf help` or refer to the
[asdf CLI documentation](https://asdf-vm.com/manage/commands.html#all-commands).
## Maintainer
- [@RobLoach](https://github.com/RobLoach)

View file

@ -1,30 +1,13 @@
# Find where asdf should be installed
ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
ASDF_COMPLETIONS="$ASDF_DIR/completions"
(( ! $+commands[asdf] )) && return
if [[ ! -f "$ASDF_DIR/asdf.sh" || ! -f "$ASDF_COMPLETIONS/_asdf" ]]; then
# If not found, check for archlinux/AUR package (/opt/asdf-vm/)
if [[ -f "/opt/asdf-vm/asdf.sh" ]]; then
ASDF_DIR="/opt/asdf-vm"
ASDF_COMPLETIONS="$ASDF_DIR"
# If not found, check for Homebrew package
elif (( $+commands[brew] )); then
_ASDF_PREFIX="$(brew --prefix asdf)"
ASDF_DIR="${_ASDF_PREFIX}/libexec"
ASDF_COMPLETIONS="${_ASDF_PREFIX}/share/zsh/site-functions"
unset _ASDF_PREFIX
else
return
fi
fi
export ASDF_DATA_DIR="${ASDF_DATA_DIR:-$HOME/.asdf}"
path=("$ASDF_DATA_DIR/shims" $path)
# Load command
if [[ -f "$ASDF_DIR/asdf.sh" ]]; then
source "$ASDF_DIR/asdf.sh"
# Load completions
if [[ -f "$ASDF_COMPLETIONS/_asdf" ]]; then
fpath+=("$ASDF_COMPLETIONS")
autoload -Uz _asdf
compdef _asdf asdf # compdef is already loaded before loading plugins
fi
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `asdf`. Otherwise, compinit will have already done that.
if [[ ! -f "$ZSH_CACHE_DIR/completions/_asdf" ]]; then
typeset -g -A _comps
autoload -Uz _asdf
_comps[asdf]=_asdf
fi
asdf completion zsh >| "$ZSH_CACHE_DIR/completions/_asdf" &|

View file

@ -6,6 +6,7 @@ autojump_paths=(
/run/current-system/sw/share/autojump/autojump.zsh # NixOS installation
/etc/profiles/per-user/$USER/share/autojump/autojump.zsh # Home Manager, NixOS with user-scoped packages
/usr/share/autojump/autojump.zsh # Debian and Ubuntu package
$PREFIX/share/autojump/autojump.zsh # Termux package
/etc/profile.d/autojump.zsh # manual installation
/etc/profile.d/autojump.sh # Gentoo installation
/usr/local/share/autojump/autojump.zsh # FreeBSD installation

View file

@ -12,6 +12,13 @@ Then, add the `battery_pct_prompt` function to your custom theme. For example:
RPROMPT='$(battery_pct_prompt) ...'
```
Also, you set the `BATTERY_CHARGING` variable to your favor.
For example:
```zsh
BATTERY_CHARGING="⚡️"
```
## Requirements
- On Linux, you must have the `acpi` or `acpitool` commands installed on your operating system.

View file

@ -58,7 +58,7 @@ if [[ "$OSTYPE" = darwin* ]]; then
fi
echo "%{$fg[$color]%}[${battery_pct}%%]%{$reset_color%}"
else
echo ""
echo "${BATTERY_CHARGING-⚡️}"
fi
}

View file

@ -1,6 +1,7 @@
# Bazel plugin
This plugin adds completion and aliases for [bazel](https://bazel.build), an open-source build and test tool that scalably supports multi-language and multi-platform projects.
This plugin adds completion and aliases for [bazel](https://bazel.build), an open-source build and test tool
that scalably supports multi-language and multi-platform projects.
To use it, add `bazel` to the plugins array in your zshrc file:
@ -14,9 +15,15 @@ The plugin has a copy of [the completion script from the git repository][1].
## Aliases
| Alias | Command | Description |
| ------- | -------------------------------------- | ------------------------------------------------------ |
| bzb | `bazel build` | The `bazel build` command |
| bzt | `bazel test` | The `bazel test` command |
| bzr | `bazel run` | The `bazel run` command |
| bzq | `bazel query` | The `bazel query` command |
| Alias | Command | Description |
| ----- | ------------- | ------------------------- |
| bzb | `bazel build` | The `bazel build` command |
| bzt | `bazel test` | The `bazel test` command |
| bzr | `bazel run` | The `bazel run` command |
| bzq | `bazel query` | The `bazel query` command |
## Functions
| Function | Description |
| -------- | -------------------------------- |
| sri-hash | Generate SRI hash used by bzlmod |

View file

@ -3,3 +3,7 @@ alias bzb='bazel build'
alias bzt='bazel test'
alias bzr='bazel run'
alias bzq='bazel query'
sri-hash() {
openssl dgst -sha256 -binary $1 | openssl base64 -A | sed 's/^/sha256-/'
}

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

@ -62,7 +62,7 @@ function bgnotify_formatted {
function bgnotify_appid {
if (( ${+commands[osascript]} )); then
osascript -e "tell application id \"$(bgnotify_programid)\" to get the {id, frontmost, id of front window, visible of front window}" 2>/dev/null
elif [[ -n $WAYLAND_DISPLAY ]] && (( ${+commands[swaymsg]} )); then # wayland+sway
elif [[ -n $WAYLAND_DISPLAY ]] && ([[ -n $SWAYSOCK ]] || [[ -n $I3SOCK ]]) && (( ${+commands[swaymsg]} )); then # wayland+sway
local app_id=$(bgnotify_find_sway_appid)
[[ -n "$app_id" ]] && echo "$app_id" || echo $EPOCHSECONDS
elif [[ -z $WAYLAND_DISPLAY ]] && [[ -n $DISPLAY ]] && (( ${+commands[xprop]} )); then
@ -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" -sender "$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

@ -8,7 +8,7 @@ function branch_prompt_info() {
while [[ "$dir" != '/' ]]; do
# Found .git directory
if [[ -d "${dir}/.git" ]]; then
branch="${"$(<"${dir}/.git/HEAD")"##*/}"
branch="${"$(<"${dir}/.git/HEAD")"##ref: refs/heads/}"
echo '±' "${branch:gs/%/%%}"
return
fi

View file

@ -19,19 +19,38 @@ the `brew` binary before sourcing `oh-my-zsh.sh` and it'll set up the environmen
## Aliases
| Alias | Command | Description |
| -------- | --------------------------------------- | ------------------------------------------------------------------- |
| `bcubc` | `brew upgrade --cask && brew cleanup` | Update outdated casks, then run cleanup. |
| `bcubo` | `brew update && brew outdated --cask` | Update Homebrew data, then list outdated casks. |
| `brewp` | `brew pin` | Pin a specified formula so that it's not upgraded. |
| `brews` | `brew list -1` | List installed formulae or the installed files for a given formula. |
| `brewsp` | `brew list --pinned` | List pinned formulae, or show the version of a given formula. |
| `bubc` | `brew upgrade && brew cleanup` | Upgrade outdated formulae and casks, then run cleanup. |
| `bugbc` | `brew upgrade --greedy && brew cleanup` | Upgrade outdated formulae and casks (greedy), then run cleanup. |
| `bubo` | `brew update && brew outdated` | Update Homebrew data, then list outdated formulae and casks. |
| `bubu` | `bubo && bubc` | Do the last two operations above. |
| `bfu` | `brew upgrade --formula` | Upgrade only formulas (not casks). |
| `buz` | `brew uninstall --zap` | Remove all files associated with a cask. |
| Alias | Command | Description |
| -------- | --------------------------------------- | --------------------------------------------------------------------- |
| `ba` | `brew autoremove` | Uninstall unnecessary formulae. |
| `bci` | `brew info --cask` | Display information about the given cask. |
| `bcin` | `brew install --cask` | Install the given cask. |
| `bcl` | `brew list --cask` | List installed casks. |
| `bcn` | `brew cleanup` | Run cleanup. |
| `bco` | `brew outdated --cask` | Report all outdated casks. |
| `bcrin` | `brew reinstall --cask` | Reinstall the given cask. |
| `bcubc` | `brew upgrade --cask && brew cleanup` | Upgrade outdated casks, then run cleanup. |
| `bcubo` | `brew update && brew outdated --cask` | Update Homebrew data, then list outdated casks. |
| `bcup` | `brew upgrade --cask` | Upgrade all outdated casks. |
| `bfu` | `brew upgrade --formula` | Upgrade only formulae (not casks). |
| `bi` | `brew install` | Install a formula. |
| `bl` | `brew list` | List all installed formulae. |
| `bo` | `brew outdated` | List installed formulae that have an updated version available. |
| `brewp` | `brew pin` | Pin a specified formula so that it's not upgraded. |
| `brews` | `brew list -1` | List installed formulae or the installed files for a given formula. |
| `brewsp` | `brew list --pinned` | List pinned formulae, or show the version of a given formula. |
| `bsl` | `brew services list` | List all running services. |
| `bsoff` | `brew services stop` | Stop the service and unregister it from launching at login (or boot). |
| `bsoffa` | `bsoff --all` | Stop all started services. |
| `bson` | `brew services start` | Start the service and register it to launch at login (or boot). |
| `bsona` | `bson --all` | Start all stopped services. |
| `bsr` | `brew services run` | Run the service without registering to launch at login (or boot). |
| `bsra` | `bsr --all` | Run all stopped services. |
| `bu` | `brew update` | Update brew and all installed formulae. |
| `bubo` | `brew update && brew outdated` | Update Homebrew data, then list outdated formulae and casks. |
| `bubu` | `bubo && bup` | Do the last two operations above. |
| `bugbc` | `brew upgrade --greedy && brew cleanup` | Upgrade outdated formulae and casks (greedy), then run cleanup. |
| `bup` | `brew upgrade` | Upgrade outdated, unpinned brews. |
| `buz` | `brew uninstall --zap` | Remove all files associated with a cask. |
## Completion

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)"
@ -34,16 +34,35 @@ if [[ -d "$HOMEBREW_PREFIX/share/zsh/site-functions" ]]; then
fpath+=("$HOMEBREW_PREFIX/share/zsh/site-functions")
fi
alias ba='brew autoremove'
alias bci='brew info --cask'
alias bcin='brew install --cask'
alias bcl='brew list --cask'
alias bcn='brew cleanup'
alias bco='brew outdated --cask'
alias bcrin='brew reinstall --cask'
alias bcubc='brew upgrade --cask && brew cleanup'
alias bcubo='brew update && brew outdated --cask'
alias bcup='brew upgrade --cask'
alias bfu='brew upgrade --formula'
alias bi='brew install'
alias bl='brew list'
alias bo='brew outdated'
alias brewp='brew pin'
alias brewsp='brew list --pinned'
alias bubc='brew upgrade && brew cleanup'
alias bugbc='brew upgrade --greedy && brew cleanup'
alias bsl='brew services list'
alias bsoff='brew services stop'
alias bsoffa='bsoff --all'
alias bson='brew services start'
alias bsona='bson --all'
alias bsr='brew services run'
alias bsra='bsr --all'
alias bu='brew update'
alias bubo='brew update && brew outdated'
alias bubu='bubo && bubc'
alias bubu='bubo && bup'
alias bubug='bubo && bugbc'
alias bfu='brew upgrade --formula'
alias bugbc='brew upgrade --greedy && brew cleanup'
alias bup='brew upgrade'
alias buz='brew uninstall --zap'
function brews() {

9
plugins/buf/README.md Normal file
View file

@ -0,0 +1,9 @@
# Buf plugin
This plugin adds completion for [Buf CLI](https://github.com/bufbuild/buf), a tool working with Protocol Buffers.
To use it, add `buf` to the plugins array in your zshrc file:
```zsh
plugins=(... buf)
```

View file

@ -0,0 +1,14 @@
# Autocompletion for the Buf CLI (buf).
if (( !$+commands[buf] )); then
return
fi
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `buf`. Otherwise, compinit will have already done that.
if [[ ! -f "$ZSH_CACHE_DIR/completions/_buf" ]]; then
typeset -g -A _comps
autoload -Uz _buf
_comps[buf]=_buf
fi
# Generate and load buf completion
buf completion zsh >! "$ZSH_CACHE_DIR/completions/_buf" &|

View file

@ -11,4 +11,4 @@ if [[ ! -f "$ZSH_CACHE_DIR/completions/_bun" ]]; then
_comps[bun]=_bun
fi
bun completions >| "$ZSH_CACHE_DIR/completions/_bun" &|
SHELL=zsh bun completions >| "$ZSH_CACHE_DIR/completions/_bun" &|

View file

@ -1,4 +1,4 @@
#compdef bundle
#compdef bundle bundler
local curcontext="$curcontext" state line _gems _opts ret=1

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

11
plugins/chezmoi/README.md Normal file
View file

@ -0,0 +1,11 @@
# chezmoi Plugin
## Introduction
This `chezmoi` plugin sets up completion for [chezmoi](https://chezmoi.io).
To use it, add `chezmoi` to the plugins array of your zshrc file:
```bash
plugins=(... chezmoi)
```

View file

@ -0,0 +1,14 @@
# COMPLETION FUNCTION
if (( ! $+commands[chezmoi] )); then
return
fi
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `chezmoi`. Otherwise, compinit will have already done that.
if [[ ! -f "$ZSH_CACHE_DIR/completions/_chezmoi" ]]; then
typeset -g -A _comps
autoload -Uz _chezmoi
_comps[chezmoi]=_chezmoi
fi
chezmoi completion zsh >| "$ZSH_CACHE_DIR/completions/_chezmoi" &|

View file

@ -22,6 +22,8 @@ _source-from-homebrew() {
# check default brew prefix
if [[ -h /usr/local/opt/chruby ]];then
_brew_prefix="/usr/local/opt/chruby"
elif [[ -h /opt/homebrew/opt/chruby ]]; then
_brew_prefix="/opt/homebrew/opt/chruby"
else
# ok , it is not default prefix
# this call to brew is expensive ( about 400 ms ), so at least let's make it only once

View file

@ -1,6 +1,6 @@
# chucknorris
Chuck Norris fortunes plugin for Oh My Zsh. Perfectly suitable as MOTD.
Fortunes plugin for Chuck Norris for Oh My Zsh. Perfectly suitable as MOTD.
To use it add `chucknorris` to the plugins array in you zshrc file.
@ -36,3 +36,10 @@ Last login: Fri Jan 30 23:12:26 on ttys001
- `cowsay` if using `chuck_cow`
Available via homebrew, apt, ...
> [!NOTE]
> In addition to installing `fortune`, it may be necessary to run:
>
> `strfile $ZSH/plugins/chucknorris/fortunes/chucknorris\n`
>
> (include the "\n" literally) to write the fortune data to the proper directory.

View file

@ -42,12 +42,12 @@ colorize_cat() {
ZSH_COLORIZE_STYLE="emacs"
fi
# Use stdin if no arguments have been passed.
if [ $# -eq 0 ]; then
# Use stdin if stdin is not attached to a terminal.
if [ ! -t 0 ]; then
if [[ "$ZSH_COLORIZE_TOOL" == "pygmentize" ]]; then
pygmentize -O style="$ZSH_COLORIZE_STYLE" -g
else
chroma --style="$ZSH_COLORIZE_STYLE" --formatter="${ZSH_COLORIZE_CHROMA_FORMATTER:-terminal}"
chroma --style="$ZSH_COLORIZE_STYLE" --formatter="${ZSH_COLORIZE_CHROMA_FORMATTER:-terminal}" "$@"
fi
return $?
fi

View file

@ -30,5 +30,6 @@ It works out of the box with the command-not-found packages for:
- [NixOS](https://github.com/NixOS/nixpkgs/tree/master/nixos/modules/programs/command-not-found)
- [Termux](https://github.com/termux/command-not-found)
- [SUSE](https://www.unix.com/man-page/suse/1/command-not-found/)
- [Gentoo](https://github.com/AndrewAmmerlaan/command-not-found-gentoo/tree/main)
You can add support for other platforms by submitting a Pull Request.

View file

@ -0,0 +1,44 @@
# conda-env
The plugin displays information of the created virtual container of conda and allows background theming.
To use it, add `conda-env` to the plugins array of your zshrc file:
```
plugins=(... conda-env)
```
The plugin creates a `conda_prompt_info` function that you can use in your theme, which displays the
basename of the current `$CONDA_DEFAULT_ENV`.
You can use this prompt function in your themes, by adding it to the `PROMPT` or `RPROMPT` variables. See [Example](#example) for more information.
## Settings
It uses two variables to control how the information is shown:
- `ZSH_THEME_CONDA_PREFIX`: sets the prefix of the CONDA_DEFAULT_ENV.
Defaults to `[`.
- `ZSH_THEME_CONDA_SUFFIX`: sets the suffix of the CONDA_DEFAULT_ENV.
Defaults to `]`.
## Example
```sh
ZSH_THEME_CONDA_PREFIX='conda:%F{green}'
ZSH_THEME_CONDA_SUFFIX='%f'
RPROMPT='$(conda_prompt_info)'
```
## `CONDA_CHANGEPS1`
This plugin also automatically sets the `CONDA_CHANGEPS1` variable to `false` to avoid conda changing the prompt
automatically. This has the same effect as running `conda config --set changeps1 false`.
You can override this behavior by adding `unset CONDA_CHANGEPS1` in your `.zshrc` file, after Oh My Zsh has been
sourced.
References:
- https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#determining-your-current-environment
- https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#precedence

View file

@ -0,0 +1,9 @@
function conda_prompt_info(){
[[ -n ${CONDA_DEFAULT_ENV} ]] || return
echo "${ZSH_THEME_CONDA_PREFIX=[}${CONDA_DEFAULT_ENV:t:gs/%/%%}${ZSH_THEME_CONDA_SUFFIX=]}"
}
# Has the same effect as `conda config --set changeps1 false`
# - https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#determining-your-current-environment
# - https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#precedence
export CONDA_CHANGEPS1=false

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

@ -1,5 +1,5 @@
# Usage: dash [keyword:]query
dash() { open -a Dash.app dash://"$*" }
dash() { open -a Dash.app "dash://$(omz_urlencode -r $*)" }
compdef _dash dash
_dash() {

View file

@ -1,13 +1,11 @@
# dbt plugin
## Introduction
The `dbt plugin` adds several aliases for useful [dbt](https://docs.getdbt.com/) commands and
[aliases](#aliases).
To use it, add `dbt` to the plugins array of your zshrc file:
```
```zsh
plugins=(... dbt)
```
@ -26,4 +24,4 @@ plugins=(... dbt)
## Maintainer
### [msempere](https://github.com/msempere)
- [msempere](https://github.com/msempere)

View file

@ -83,9 +83,9 @@ else
}
alias ac="su -ls '$apt_pref clean' root"
alias ad="su -lc '$apt_pref update' root"
alias adg="su -lc '$apt_pref update && aptitude $apt_upgr' root"
alias adu="su -lc '$apt_pref update && aptitude dist-upgrade' root"
alias afu="su -lc '$apt-file update'"
alias adg="su -lc '$apt_pref update && $apt_pref $apt_upgr' root"
alias adu="su -lc '$apt_pref update && $apt_pref dist-upgrade' root"
alias afu="su -lc 'apt-file update'"
alias au="su -lc '$apt_pref $apt_upgr' root"
function ai() {
cmd="su -lc '$apt_pref install $@' root"

View file

@ -37,13 +37,13 @@ Say you opened these directories on the terminal:
3 ~
```
By pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd>, the current working directory or `$CWD` will be from `oh-my-zsh` to `Hacktoberfest`. Press it again and it will be at `Projects`.
By pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd>, the current working directory or `$PWD` will be from `oh-my-zsh` to `Hacktoberfest`. Press it again and it will be at `Projects`.
And by pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd>, the `$CWD` will be from `Projects` to `Hacktoberfest`. Press it again and it will be at `oh-my-zsh`.
And by pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd>, the `$PWD` will be from `Projects` to `Hacktoberfest`. Press it again and it will be at `oh-my-zsh`.
Here's a example history table with the same accessed directories like above:
| Current `$CWD` | Key press | New `$CWD` |
| Current `$PWD` | Key press | New `$PWD` |
| --------------- | ----------------------------------------------------- | --------------- |
| `oh-my-zsh` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> | `Hacktoberfest` |
| `Hacktoberfest` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> | `Projects` |
@ -53,7 +53,7 @@ Here's a example history table with the same accessed directories like above:
| `Hacktoberfest` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> | `oh-my-zsh` |
| `oh-my-zsh` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> | `~` |
Note the last traversal, when pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> on a last known `$CWD`, it will change back to the first known `$CWD`, which in the example is `~`.
Note the last traversal, when pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> on a last known `$PWD`, it will change back to the first known `$PWD`, which in the example is `~`.
Here's an asciinema cast demonstrating the example above:
@ -61,18 +61,22 @@ Here's an asciinema cast demonstrating the example above:
## Functions
| Function | Description |
| -------------------- | --------------------------------------------------------------------------------------------------------- |
| `insert-cycledleft` | Change `$CWD` to the previous known stack, binded on <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> |
| `insert-cycledright` | Change `$CWD` to the next known stack, binded on <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> |
| Function | Description |
| -------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `insert-cycledleft` | Change `$PWD` to the previous known stack, bound to <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> |
| `insert-cycledright` | Change `$PWD` to the next known stack, bound to <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> |
| `insert-cycledup` | Change `$PWD` to the parent folder, bound to <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Up</kbd> |
| `insert-cycleddown` | Change `$PWD` to the first alphabetical child folder, bound to <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Down</kbd> |
## Rebinding keys
You can bind these functions to other key sequences, as long as you know the bindkey sequence. For example, these commands bind to <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> / <kbd>Right</kbd> in `xterm-256color`:
You can bind these functions to other key sequences, as long as you know the bindkey sequence. For example, these commands bind to <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>key</kbd> in `xterm-256color`:
```zsh
bindkey '^[[1;4D' insert-cycledleft
bindkey '^[[1;4C' insert-cycledright
bindkey "\e[1;4A" insert-cycledup
bindkey "\e[1;4B" insert-cycleddown
```
You can get the bindkey sequence by pressing <kbd>Ctrl</kbd> + <kbd>V</kbd>, then pressing the keyboard shortcut you want to use.

View file

@ -8,7 +8,16 @@
# pushd +N: start counting from left of `dirs' output
# pushd -N: start counting from right of `dirs' output
# Either switch to a directory from dirstack, using +N or -N syntax
# or switch to a directory by path, using `switch-to-dir -- <path>`
switch-to-dir () {
# If $1 is --, then treat $2 as a directory path
if [[ $1 == -- ]]; then
# We use `-q` because we don't want chpwd to run, we'll do it manually
[[ -d "$2" ]] && builtin pushd -q "$2" &>/dev/null
return $?
fi
setopt localoptions nopushdminus
[[ ${#dirstack} -eq 0 ]] && return 1
@ -22,10 +31,10 @@ switch-to-dir () {
}
insert-cycledleft () {
switch-to-dir +1 || return
switch-to-dir +1 || return $?
local fn
for fn (chpwd $chpwd_functions precmd $precmd_functions); do
for fn in chpwd $chpwd_functions precmd $precmd_functions; do
(( $+functions[$fn] )) && $fn
done
zle reset-prompt
@ -33,22 +42,46 @@ insert-cycledleft () {
zle -N insert-cycledleft
insert-cycledright () {
switch-to-dir -0 || return
switch-to-dir -0 || return $?
local fn
for fn (chpwd $chpwd_functions precmd $precmd_functions); do
for fn in chpwd $chpwd_functions precmd $precmd_functions; do
(( $+functions[$fn] )) && $fn
done
zle reset-prompt
}
zle -N insert-cycledright
insert-cycledup () {
switch-to-dir -- .. || return $?
local fn
for fn in chpwd $chpwd_functions precmd $precmd_functions; do
(( $+functions[$fn] )) && $fn
done
zle reset-prompt
}
zle -N insert-cycledup
insert-cycleddown () {
switch-to-dir -- "$(find . -mindepth 1 -maxdepth 1 -type d | sort -n | head -n 1)" || return $?
local fn
for fn in chpwd $chpwd_functions precmd $precmd_functions; do
(( $+functions[$fn] )) && $fn
done
zle reset-prompt
}
zle -N insert-cycleddown
# These sequences work for xterm, Apple Terminal.app, and probably others.
# Not for rxvt-unicode, but it doesn't seem differentiate Ctrl-Shift-Arrow
# from plain Shift-Arrow, at least by default.
#
# iTerm2 does not have these key combinations defined by default; you will need
# to add them under "Keys" in your profile if you want to use this. You can do
# this conveniently by loading the "xterm with Numeric Keypad" preset.
bindkey "\e[1;6D" insert-cycledleft
bindkey "\e[1;6C" insert-cycledright
bindkey "\e[1;6D" insert-cycledleft # Ctrl+Shift+Left
bindkey "\e[1;6C" insert-cycledright # Ctrl+Shift+Right
bindkey "\e[1;6A" insert-cycledup # Ctrl+Shift+Up
bindkey "\e[1;6B" insert-cycleddown # Ctrl+Shift+Down

View file

@ -1,5 +1,8 @@
# Don't continue if direnv is not found
command -v direnv &>/dev/null || return
# If direnv is not found, don't continue and print a warning
if (( ! $+commands[direnv] )); then
echo "Warning: direnv not found. Please install direnv and ensure it's in your PATH before using this plugin."
return
fi
_direnv_hook() {
trap -- '' SIGINT;

View file

@ -60,3 +60,46 @@ to `/usr` again.
After that, <kbd>Alt</kbd> + <kbd>Down</kbd> will probably go to `/usr/bin` if `bin` is the first directory in alphabetical
order (depends on your `/usr` folder structure). <kbd>Alt</kbd> + <kbd>Up</kbd> will return to `/usr`, and once more will get
you to the root folder (`/`).
### cde
This plugin also provides a `cde` alias that allows you to change to a directory without clearing the next directory stack.
This changes the default behavior of `dirhistory`, which is to clear the next directory stack when changing directories.
For example, if the shell was started, and the following commands were entered:
```shell
cd ~
cd /usr
cd share
cd doc
# <Alt + Left>
# <Alt + Left>
```
The directory stack would look like this:
```sh
➜ /usr typeset -pm dirhistory_\*
typeset -ax dirhistory_past=( /home/user /usr )
typeset -ax dirhistory_future=( /usr/share/doc /usr/share )
```
This means that pressing <kbd>Alt</kbd> + <kbd>Right</kbd>, you'd go to `/usr/share` and `/usr/share/doc` (the "future" directories).
If you run `cd /usr/bin`, the "future" directories will be removed, and you won't be able to access them with <kbd>Alt</kbd> + <kbd>Right</kbd>:
```sh
➜ /u/bin typeset -pm dirhistory_\*
typeset -ax dirhistory_past=( /home/user /usr )
typeset -ax dirhistory_future=( /usr/bin )
```
If you instead run `cde /usr/bin`, the "future" directories will be preserved:
```sh
➜ /u/bin typeset -pm dirhistory_\*
typeset -ax dirhistory_past=( /home/user /usr /usr/bin )
typeset -ax dirhistory_future=( /usr/share/doc /usr/share )
```

View file

@ -11,9 +11,10 @@ dirhistory_past=($PWD)
dirhistory_future=()
export dirhistory_past
export dirhistory_future
export DIRHISTORY_SIZE=30
alias cde='dirhistory_cd'
# Pop the last element of dirhistory_past.
# Pass the name of the variable to return the result in.
# Returns the element if the array was not empty,
@ -136,7 +137,11 @@ for keymap in emacs vicmd viins; do
case "$TERM_PROGRAM" in
Apple_Terminal) bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back ;; # Terminal.app
iTerm.app) bindkey -M $keymap "^[^[[D" dirhistory_zle_dirhistory_back ;; # iTerm2
ghostty) bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back ;; # ghostty
iTerm.app)
bindkey -M $keymap "^[^[[D" dirhistory_zle_dirhistory_back
bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back
;;
esac
if (( ${+terminfo[kcub1]} )); then
@ -151,7 +156,11 @@ for keymap in emacs vicmd viins; do
case "$TERM_PROGRAM" in
Apple_Terminal) bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future ;; # Terminal.app
iTerm.app) bindkey -M $keymap "^[^[[C" dirhistory_zle_dirhistory_future ;; # iTerm2
ghostty) bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future ;; # ghostty
iTerm.app)
bindkey -M $keymap "^[^[[C" dirhistory_zle_dirhistory_future
bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future
;;
esac
if (( ${+terminfo[kcuf1]} )); then
@ -200,6 +209,7 @@ for keymap in emacs vicmd viins; do
case "$TERM_PROGRAM" in
Apple_Terminal) bindkey -M $keymap "^[[A" dirhistory_zle_dirhistory_up ;; # Terminal.app
iTerm.app) bindkey -M $keymap "^[^[[A" dirhistory_zle_dirhistory_up ;; # iTerm2
ghostty) bindkey -M $keymap "^[[1;3A" dirhistory_zle_dirhistory_up ;; # ghostty
esac
if (( ${+terminfo[kcuu1]} )); then
@ -215,6 +225,7 @@ for keymap in emacs vicmd viins; do
case "$TERM_PROGRAM" in
Apple_Terminal) bindkey -M $keymap "^[[B" dirhistory_zle_dirhistory_down ;; # Terminal.app
iTerm.app) bindkey -M $keymap "^[^[[B" dirhistory_zle_dirhistory_down ;; # iTerm2
ghostty) bindkey -M $keymap "^[[1;3B" dirhistory_zle_dirhistory_down ;; # ghostty
esac
if (( ${+terminfo[kcud1]} )); then

570
plugins/dnf/_dnf5 Normal file
View file

@ -0,0 +1,570 @@
#compdef dnf5
# based on dnf-5.2.6.2
# utility functions
_dnf5_helper() {
_call_program specs $service "${(q-)@}" "${(q-)PREFIX}\*" \
-qC --assumeno --nogpgcheck 2>/dev/null </dev/null
}
_dnf5_repositories() {
# required option: -T (all|disabled|enabled)
local selected expl
zparseopts -D -E - T:=selected
selected=$selected[2]
_wanted $selected-repositories expl "$selected repository" \
compadd "$@" - "${(@)${(f)$(_dnf5_helper repo list --$selected)}[2,-1]%% *}"
}
_dnf5_packages() {
# required option: -T (all|available|installed|upgradable)
local selected opt expl
zparseopts -D -E - T:=selected
selected=$selected[2]
case $selected in
all) opt='' ;; # option --all does not exist
upgradable) opt='--upgrades' ;;
*) opt="--$selected" ;;
esac
_wanted $selected-packages expl "$selected package" \
compadd "$@" - $(_dnf5_helper repoquery $opt --qf='%{name} ')
}
_dnf5_rpm_files() {
local expl
_wanted rpm-files expl 'rpm file' _files -g '(#i)*.rpm(-.)'
}
_dnf5_packages_or_rpms() {
if [[ "$words[CURRENT]" = (*/*|\~*) ]]; then # if looks like a path name
_dnf5_rpm_files
else
_dnf5_packages "$@"
fi
}
_dnf5_groups() {
# optional option: -T (available|installed)
local update_policy selected line pat groups
zparseopts -D -E - T:=selected
selected=$selected[2]
if [[ -z $selected ]]; then
selected=all
opt= # option --all does not exist
else
opt=--$selected
fi
# XXX hidden groups are not included
for line in ${${(f)"$(_dnf5_helper group list $opt)"}[2,-1]}; do
line=( ${(z)line} )
groups+=( "$line[1]:$line[2,-2]" )
done
_describe -t $selected-groups "$selected group" groups
}
_dnf5_environments() {
local line envs
for line in ${${(f)"$(_dnf5_helper environment list)"}[2,-1]}; do
line=( ${(z)line} )
envs+=( "$line[1]:$line[2,-2]" )
done
_describe -t environments 'environment' envs
}
# completers for (several) dnf commands
_dnf5-advisory () {
_arguments : \
$advisory_opts \
'--contains-pkgs=[only show advisories containing specified packages]: : _sequence _dnf5_packages -T installed' \
+ '(with)' \
'--with-cve[show only advisories referencing CVE ticket]' \
'--with-bz[show only advisories referencing Bugzilla ticket]' \
+ '(type)' \
'--all[show all advisories]' \
'--available[show advisories containing newer versions of installed packages (default)]' \
'--installed[show advisories containing equal and older version of installed packages]' \
'--updates[show advisories containing upgradable packages]' \
+ args \
':subcommand:(list info summary)' '*:advisory spec:'
}
_dnf5-group() {
local -a tmp
if (( CURRENT == 2 )); then
tmp=(
'list:list all matching groups'
'info:print detailed information about groups'
'install:install packages from specified groups'
'remove:remove removable packages in specified groups'
'upgrade:upgrade specified groups and packages in them'
)
_describe -t subcommands 'subcommand' tmp
else
case $words[2] in
list|info)
tmp=(
'(--installed)--available[show only available groups]'
'(--available)--installed[show only installed groups]'
'--hidden[show also hidden groups]'
'--contains-pkgs=[show only groups containing specified packages]: : _sequence _dnf5_packages -T all'
'*: : _dnf5_groups'
)
;;
install)
tmp=( $common_opts
'--with-optional[include optional packages from the groups]'
'*: : _dnf5_groups -T available' )
;|
upgrade)
tmp=( ${common_opts:#--skip-broken*}
'*: : _dnf5_groups -T installed' )
;|
remove)
tmp=( $offline_opts
'*: : _dnf5_groups -T installed' )
;|
install|remove)
tmp+=( '--no-packages[operate on groups only, not manipulate any packages]' )
;|
install|upgrade)
tmp+=( $downgrade_opts )
;;
esac
_arguments : $tmp
fi
}
_dnf5-history() {
local -a tmp
if (( CURRENT == 2 )); then
tmp=(
'list:list info about recorded transactions'
'info:print detailed about specific transactions'
'undo:revert all actions from the specified transaction'
'redo:repeat the specified transaction'
'rollback:undo all transactions performed after the specified transaction'
'store:store the transaction into a directory'
)
_describe -t subcommands 'subcommand' tmp
else
case $words[2] in
list|info)
tmp=( '--reverse[reverse the order of transactions in output]' )
;;
undo|rollback|redo)
tmp=( '--skip-unavailable[allow skipping impossible actions]' )
;|
undo|rollback)
tmp+=( $replay_opts )
;;
store)
tmp=( {-o,--output=}'[directory for storing the transaction (default ./transaction)]: : _directories')
esac
_arguments : $tmp '2:transaction:( )'
fi
}
_dnf5-mark() {
local -a tmp
if (( CURRENT == 2 )); then
tmp=(
'user:mark the package as user-installed'
'dependency:mark the package as a dependency'
'weak:mark the package as a weak dependency'
'group:mark the package as installed by the specified group'
)
_describe -t subcommands 'subcommand' tmp
else
tmp=(
'--skip-unavailable[skip packages not installed on the system]'
'--store=[store the transaction in specified directory]: : _directories'
)
if [[ $words[2] = group ]]; then
tmp+=( '2:group-id: _dnf5_groups -T installed' )
fi
_arguments : $tmp '*: : _dnf5_packages -T installed'
fi
}
_dnf5-module() {
local -a tmp
if (( CURRENT == 2 )); then
tmp=(
'list:list module streams'
'info:print details about module streams'
'enable:enable module streams'
'disable:disable modules including all their streams'
"reset:reset module state so it's no longer enabled or disabled"
)
_describe -t subcommands 'subcommand' tmp
elif (( CURRENT == 3 )) && [[ $cur = -* ]]; then
case $words[2] in
list|info) tmp=( --enabled --disabled ) ;;
enable) tmp=( --skip-broken --skip-unavailable ) ;;
*) tmp=( --skip-unavailable ) ;;
esac
_wanted options expl 'option' compadd -a tmp
else
_message 'module spec'
fi
}
_dnf5-offline() { # also used by the 'system-upgrade' command
local -a tmp
if (( CURRENT == 2 )); then
tmp=(
'clean:remove any stored offline transactions and cached packages'
'log:list boots during which offline transaction was attempted'
'reboot:prepare the system for offline transaction and reboot'
)
if [[ $cmd = offline ]]; then
tmp+=( 'status:show status of the current offline transaction' )
else
tmp+=( 'download:download all packages needed for upgrade' )
fi
_describe -t subcommands 'subcommand' tmp && ret=0
else
case $words[2] in
download)
_arguments : \
'--releasever=[the version to upgrade to]:version number:' \
'--no-downgrade:do not install packages older than currently installed' '*: :' && ret=0
;;
log)
_arguments : \
'--number=[show log of transaction specified by number]:transaction number:' '*: :' && ret=0
;;
reboot)
_wanted options expl 'option' compadd -- --poweroff && ret=0
;;
esac
fi
}
_dnf5-repoquery() {
local v
local -a opts=(
$advisory_opts
'--arch=[limit results to specified architectures]:list of archs: '
'--available[limit results to available packages]'
'--disable-modular-filtering[include packages of inactive module streams]'
'--duplicates[limit to installed duplicate packages]'
'--exactdeps[limit to packages that require capability specified by ==what{requires,depends}]'
'--extras[limit to installed packages that are not present in any available repository]'
'--file=[limit results to packages which own specified file]:list of files: _sequence _files'
'--installed[query installed packages]'
'--installonly[limit to installed installonly packages]'
'--latest-limit=[limit to latest packages of specified number]:number:'
'--leaves[limit to groups of installed packages not required by other installed packages]'
'--providers-of=[select packages that provide specified attribute]:attribute:(conflicts depends enhances obsoletes provides recommends requires requires_pre suggests supplement)'
'--recent[limit to only recently changed packages]'
'--recursive[make --whatrequires/--providers-of work recursively]'
'--security[limit to packages in security advisories]'
'--srpm[use the corresponding source RPM]'
'--unneeded[limit to unneeded installed packages]'
'--upgrades[limit to available packages that provide upgrade for installed packages]'
'--userinstalled[limit to packages that are not installed as dependencies]'
'--whatdepends=[limit to packages that require, enhance, recommend, suggest of supplement specified capability]:list of capability:'
'--whatconflicts=[limit to packages that conflicts with specified capabilities]:list of capability: '
)
for v in enhance obsolete provide recommend require suggest supplement; do
opts+=( "--what${v}s=[limit to packages that $v specified capabilities]:list of capability: ")
done
# mutually exclusive formating options
opts+=(
+ '(format)'
'--conflicts[display capabilities that the package conflicts with]'
'--depends[display capabilities that the package depends on, enables, recommends, suggests or supplements]'
'--files[show files in the package]'
'--requires-pre[display capabilities required to run pre/post scripts of the package]'
'--sourcerpm[display source RPM of the package]'
'--location[display location of the package]'
'--info[show detailed information about the package]'
'--changelogs[print the package changelogs]'
'(- *)--querytags[list tags recognized by --queryformat]'
'--queryformat=[specify output format]:format:'
)
for v in enhance obsolete provide recommend require suggest supplement; do
opts+=( "--${v}s[display capabilities ${v}ed by the package]" )
done
_arguments : '*: : _dnf5_packages -T all' $opts
}
# dnf commands
_dnf5_commands() {
local -a dnf_cmds=(
'advisory:manage advisories'
'autoremove:remove unneeded packages'
'check:check for problems in package database'
'check-upgrade:check for available package upgrades'
'clean:remove or invalidate cached data'
'distro-sync:up/downgrade installed packages to the latest available'
'downgrade:downgrade packages'
'download:download packages'
'environment:manage comps environments'
'group:manage comps groups'
'history:manage transaction history'
'info:provide detailed information about packages'
'install:install packages'
'leaves:list groups of leaf packages'
'list:list installed or available packages'
'makecache:generate the metadata cache'
'mark:change the reason of an installed package'
'module:manage modules'
'offline:manage offline transactions'
'provides:find what package provides the given value'
'reinstall:reinstall packages'
'remove:remove packages'
'replay:replay stored transactions'
'repo:manage repositories'
'repoquery:search for packages in repositories'
'search:search for packages using keywords'
'swap:remove software and install another in the single transaction'
'system-upgrade:upgrade the system to a new major release'
'upgrade:upgrade packages'
'versionlock:protect packages from updates to newer versions'
)
_describe -t dnf-commands 'dnf command' dnf_cmds
}
# subcommands and options
_dnf5_subcmds_opts() {
local cur=$words[CURRENT] cmd=$words[1] expl ret=1
local -a tmp
# common options
local -a offline_opts=(
'(--store)--offline[store the transaction to be performed offline]'
'(--offline)--store=[store the transaction in specified directory]: : _directories'
)
local -a common_opts=(
$offline_opts
'--allowerasing[allow erasing of installed packages]'
'--skip-broken[resolve dependency problems by skipping problematic packages]'
"--skip-unavailable[skip packages that can't be synchronized]"
'--downloadonly[download packages without executing transaction]'
)
local -a advisory_opts=(
'--advisories=[consider only specified advisories]:list of advisories:'
'--advisory-severities=[limit to advisories with specified severity]:severity:_sequence compadd - critical important moderate low none'
'--bzs=[limit to advisories that fix specified Bugzilla ID]:list of Bugzilla ID:'
'--cves=[limit to advisories that fix specified CVE ID]:list of CVD ID]:'
'--security[limit to security advisories]'
'--bugfix[limit to bugfix advisories]'
'--enhancement[limit to enhancement advisories]'
'--newpackage[limit to newpackage advisories]'
)
local -a downgrade_opts=(
'(--no-allow-downgrade)--allow-downgrade[enable downgrade of dependencies]'
'(--allow-downgrade)--no-allow-downgrade[disable downgrade of dependencies]'
)
local -a replay_opts=(
'--ignore-extras[not consider extra packages]'
'--ignore-installed[mismatches between installed and stored transaction are not errors]'
)
# Deal with some aliases (not comprehensive)
case $cmd in
check-updgrade) cmd=check-update;;
dg) cmd=downgrade;;
dsync) cmd=distro-sync;;
grp) cmd=group;;
if) cmd=info;;
in) cmd=install;;
ls) cmd=list;;
mc) cmd=makecache;;
rei) cmd=reinstall;;
rm) cmd=remove ;;
rq) cmd=repoquery;;
se) cmd=search;;
update|up) cmd=upgrade;;
esac
local curcontext="${curcontext%:*:*}:dnf-${cmd}:"
case $cmd in
advisory|group|history|mark|module|offline|repoquery)
_dnf5-$cmd && ret=0
;;
system-upgrade)
_dnf5-offline && ret=0
;;
autoremove)
_arguments : $offline_opts && ret=0
;;
check)
_arguments : \
'--dependencies[show missing dependencies and conflicts]' \
'--duplicates[show duplicated packages]' \
'--obsoleted[show obsoleted packages]' && ret=0
;;
check-upgrade)
_arguments : \
$advisory_opts \
'--changelogs[print package changelogs]' \
'--minimal[reports the lowest versions of packages that fix advisories]' \
'*: : _dnf5_packages -T installed' && ret=0
;;
clean)
tmp=(
'dbcache:remove cache files generated from the repository metadata'
'expire-cache:mark the repository metadata expired'
'metadata:remove the repository metadata'
'packages:remove any cached packages'
'all:clean all'
)
_describe -t cache-types 'cache type' tmp && ret=0
;;
distro-sync)
_arguments : $common_opts '*: : _dnf5_packages -T installed' && ret=0
;;
downgrade)
_arguments : \
$common_opts $downgrade_opts \
'*: : _dnf5_packages -T installed' && ret=0
;;
download)
_arguments : \
'--arch=[limit to packages of specified architecture]:list of architectures:' \
'--resolve[resolve and download needed dependencies]' \
'--alldeps[with --resolve, also download already installed dependencies]' \
'--destdir=[download to the specified directory]: : _directories' \
'--srpm[download the source rpm]' \
'--url[print the list of URLs where the rpms can be downloaded]' \
'*--urlprotocol=[with --url, limit to specified protocols]:protocol:_sequence compadd - http https ftp file' \
'*: : _dnf5_packages -T all' && ret=0
;;
environment)
_arguments : \
'--available[show only available environments]' \
'--installed[show only installed environments]' \
':subcommand:(list info)' \
'*: : _dnf5_environments' && ret=0
;;
info|list)
_arguments : \
'--showduplicates[show all versions of the packages]' \
'*: : _dnf5_packages -T all' \
+ '(type)' \
'--installed[list only installed packages]:*: : _dnf5_packages -T installed' \
'--available[list only available packages]:*: : _dnf5_packages -T available' \
'--extras[list only extras]' \
'--obsoletes[list only installed but obsoleted packages]:*: : _dnf5_packages -T installed' \
'--recent[list only recently added packages]' \
'--upgrades[list only available upgrades of installed packages]:*: : _dnf5_packages -T upgradable' \
'--autoremove[list only packages that will be autoremoved]:*: : _dnf5_packages -T installed' &&ret=0
;;
install)
_arguments : \
$common_opts $downgrade_opts $advisory_opts \
'*: : _dnf5_packages_or_rpms -T available' && ret=0
;;
leaves|makecache)
# nothing to complete
;;
provides)
_files && ret=0
;;
reinstall)
_arguments : \
$common_opts $downgrade_opts \
'*: : _dnf5_packages_or_rpms -T installed' && ret=0
;;
remove)
_arguments : \
$offline_opts \
'--no-autoremove[not remove dependencies that are no longer used]' \
'*: : _dnf5_packages -T installed' && ret=0
;;
replay)
_arguments : \
$replay_opts \
':transaction path:_directories' && ret=0
;;
repo)
_arguments : \
'--all[show info about all repositories]' \
'--enabled[show info only about enabled repositories]' \
'--disabled[show info only about disabled repositories]' \
':subcommand:(list info)' && ret=0
;;
search)
_arguments : \
'--all[search patterns also inside description and URL fields]' \
'--showduplicates[show all versions of packages, not only the latest ones]' \
'*:search pattern:' && ret=0
;;
swap)
_arguments : \
$offline_opts \
'--allowerasing[allow erasing of installed packages]' \
': : _dnf5_packages -T installed' \
': : _dnf5_packages -T available' && ret=0
;;
upgrade)
_arguments : \
${common_opts:#--skip-broken*} $downgrade_opts $advisory_opts \
'--minimal[upgrade only to the lowest available versions that fix advisories]' \
'--destdir=[specify directory into which downloading packages]: : _directories' \
'*: : _dnf5_packages_or_rpms -T upgradable' && ret=0
;;
versionlock)
_arguments : \
':subcommand:(add exclude clear delete list)' \
'*: : _dnf5_packages -T all' && ret=0
;;
esac
return ret
}
# main completer
_dnf5() {
local curcontext="$curcontext" state state_descr line ret=1
typeset -A opt_args
local -a opts=(
'(-y --assumeyes)--assumeno[answer no for all questions]'
'--best[try the best available package version]'
'(-C --cacheonly)'{-C,--cacheonly}"[run entirely from system cache, don't update cache]"
'--comment=[add comment to transaction history]:comment:'
'(-c --config)'{-c+,--config=}'[specify configuration file]:config file:_files'
'--debugsolver[dump detailed solving results in file ./debugdata]'
'*--disable-plugin=[disable specified plugins]:list of plugin names:'
'(--repo)*--disable-repo=[disable specified repos]: : _sequence _dnf5_repositories -T enabled'
'--dump-main-config[print main configuration values to stdout]'
'*--dump-repo-config=[print repository configuration values to stdout]:repi id'
'--dump-variables[print variable values to stdout]'
'*--enable-plugin=[enable specified plugins]:list of plugin names:'
'*--enable-repo=[enable additional repos]: : _sequence _dnf5_repositories -T disabled'
'--forcearch=[force the use of the specified arch]:arch:'
'(-)'{-h,--help}'[show the help message]'
'--installroot=[set install root]: : _directories'
'--no-best[do not limit transactions to best candidates]'
'--no-docs[do not install documentation]'
'--no-gpgcheck[skip checking GPG signatures on packages]'
'--no-plugins[disable all plugins]'
'(-q --quiet)'{-q,--quiet}'[show just the relevant content]'
'--refresh[force refreshing metadata before running the command]'
'--releasever=[override distribution release in config files]:release ver:'
'(--disablerepo)*--repo=[enable just the specified repo]: : _sequence _dnf5_repositories -T all'
'*--repofrompath=[specify additional repos]:repository_label,path_or_url: '
'*--setopt=[override option in config file]:repoid.option=value:'
'*--setvar=[override DNF5 variable value]'
'--show-new-leaves[show newly installed leaf packages]'
'--use-host-config[use config files and variables from host system]'
'(- *)--version[show dnf version]'
'(-y --assumeyes --assumeno)'{-y,--assumeyes}'[answer yes for all questions]'
'*'{-x+,--exclude=}'[exclude specified packages from transaction]: : _sequence _dnf5_packages -T all'
)
_arguments -C -s : $opts ': :->command' '*:: :->cmd_args' && ret=0
case $state in
command) _dnf5_commands && ret=0 ;;
cmd_args) _dnf5_subcmds_opts && ret=0 ;;
esac
return ret
}
_dnf5 "$@"

View file

@ -1,5 +1,8 @@
# support Compose v2 as docker CLI plugin
(( ${+commands[docker-compose]} )) && dccmd='docker-compose' || dccmd='docker compose'
# Support Compose v2 as docker CLI plugin
#
# This tests that the (old) docker-compose command is in $PATH and that
# it resolves to an existing executable file if it's a symlink.
[[ -x "${commands[docker-compose]:A}" ]] && dccmd='docker-compose' || dccmd='docker compose'
alias dco="$dccmd"
alias dcb="$dccmd build"

View file

@ -1,19 +0,0 @@
# docker-machine plugin for oh my zsh
### Usage
#### docker-vm
Will create a docker-machine with the name "dev" (required only once)
To create a second machine call "docker-vm foobar" or pass any other name
#### docker-up
This will start your "dev" docker-machine (if necessary) and set it as the active one
To start a named machine use "docker-up foobar"
#### docker-switch dev
Use this to activate a running docker-machine (or to switch between multiple machines)
You need to call either this or docker-up when opening a new terminal
#### docker-stop
This will stop your "dev" docker-machine
To stop a named machine use "docker-stop foobar"

View file

@ -1,359 +0,0 @@
#compdef docker-machine
# Description
# -----------
# zsh completion for docker-machine
# https://github.com/leonhartX/docker-machine-zsh-completion
# -------------------------------------------------------------------------
# Version
# -------
# 0.1.1
# -------------------------------------------------------------------------
# Authors
# -------
# * Ke Xu <leonhartx.k@gmail.com>
# -------------------------------------------------------------------------
# Inspiration
# -----------
# * @sdurrheimer docker-compose-zsh-completion https://github.com/sdurrheimer/docker-compose-zsh-completion
# * @ilkka _docker-machine
__docker-machine_get_hosts() {
[[ $PREFIX = -* ]] && return 1
local state
declare -a hosts
state=$1; shift
if [[ $state != all ]]; then
hosts=(${(f)"$(_call_program commands docker-machine ls -q --filter state=$state)"})
else
hosts=(${(f)"$(_call_program commands docker-machine ls -q)"})
fi
_describe 'host' hosts "$@" && ret=0
return ret
}
__docker-machine_hosts_with_state() {
declare -a hosts
hosts=(${(f)"$(_call_program commands docker-machine ls -f '{{.Name}}\:{{.DriverName}}\({{.State}}\)\ {{.URL}}')"})
_describe 'host' hosts
}
__docker-machine_hosts_all() {
__docker-machine_get_hosts all "$@"
}
__docker-machine_hosts_running() {
__docker-machine_get_hosts Running "$@"
}
__docker-machine_get_swarm() {
declare -a swarms
swarms=(${(f)"$(_call_program commands docker-machine ls -f {{.Swarm}} | awk '{print $1}')"})
_describe 'swarm' swarms
}
__docker-machine_hosts_and_files() {
_alternative "hosts:host:__docker-machine_hosts_all -qS ':'" 'files:files:_path_files'
}
__docker-machine_filters() {
[[ $PREFIX = -* ]] && return 1
integer ret=1
if compset -P '*='; then
case "${${words[-1]%=*}#*=}" in
(driver)
_describe -t driver-filter-opts "driver filter" opts_driver && ret=0
;;
(swarm)
__docker-machine_get_swarm && ret=0
;;
(state)
opts_state=('Running' 'Paused' 'Saved' 'Stopped' 'Stopping' 'Starting' 'Error')
_describe -t state-filter-opts "state filter" opts_state && ret=0
;;
(name)
__docker-machine_hosts_all && ret=0
;;
(label)
_message 'label' && ret=0
;;
*)
_message 'value' && ret=0
;;
esac
else
opts=('driver' 'swarm' 'state' 'name' 'label')
_describe -t filter-opts "filter" opts -qS "=" && ret=0
fi
return ret
}
__get_swarm_discovery() {
declare -a masters services
local service
services=()
masters=($(docker-machine ls -f {{.Swarm}} |grep '(master)' |awk '{print $1}'))
for master in $masters; do
service=${${${(f)"$(_call_program commands docker-machine inspect -f '{{.HostOptions.SwarmOptions.Discovery}}:{{.Name}}' $master)"}/:/\\:}}
services=($services $service)
done
_describe -t services "swarm service" services && ret=0
return ret
}
__get_create_argument() {
typeset -g docker_machine_driver
if [[ CURRENT -le 2 ]]; then
docker_machine_driver="none"
elif [[ CURRENT > 2 && $words[CURRENT-2] = '-d' || $words[CURRENT-2] = '--driver' ]]; then
docker_machine_driver=$words[CURRENT-1]
elif [[ $words[CURRENT-1] =~ '^(-d|--driver)=' ]]; then
docker_machine_driver=${${words[CURRENT-1]}/*=/}
fi
local driver_opt_cmd
local -a opts_provider opts_common opts_read_argument
opts_read_argument=(
": :->argument"
)
opts_common=(
$opts_help \
'(--driver -d)'{--driver=,-d=}'[Driver to create machine with]:dirver:->driver-option' \
'--engine-install-url=[Custom URL to use for engine installation]:url' \
'*--engine-opt=[Specify arbitrary flags to include with the created engine in the form flag=value]:flag' \
'*--engine-insecure-registry=[Specify insecure registries to allow with the created engine]:registry' \
'*--engine-registry-mirror=[Specify registry mirrors to use]:mirror' \
'*--engine-label=[Specify labels for the created engine]:label' \
'--engine-storage-driver=[Specify a storage driver to use with the engine]:storage-driver:->storage-driver-option' \
'*--engine-env=[Specify environment variables to set in the engine]:environment' \
'--swarm[Configure Machine with Swarm]' \
'--swarm-image=[Specify Docker image to use for Swarm]:image' \
'--swarm-master[Configure Machine to be a Swarm master]' \
'--swarm-discovery=[Discovery service to use with Swarm]:service:->swarm-service' \
'--swarm-strategy=[Define a default scheduling strategy for Swarm]:strategy:(spread binpack random)' \
'*--swarm-opt=[Define arbitrary flags for swarm]:flag' \
'*--swarm-join-opt=[Define arbitrary flags for Swarm join]:flag' \
'--swarm-host=[ip/socket to listen on for Swarm master]:host' \
'--swarm-addr=[addr to advertise for Swarm (default: detect and use the machine IP)]:address' \
'--swarm-experimental[Enable Swarm experimental features]' \
'*--tls-san=[Support extra SANs for TLS certs]:option'
)
driver_opt_cmd="docker-machine create -d $docker_machine_driver | grep $docker_machine_driver | sed -e 's/\(--.*\)\ *\[\1[^]]*\]/*\1/g' -e 's/\(\[[^]]*\)/\\\\\\1\\\\/g' -e 's/\".*\"\(.*\)/\1/g' | awk '{printf \"%s[\", \$1; for(i=2;i<=NF;i++) {printf \"%s \", \$i}; print \"]\"}'"
if [[ $docker_machine_driver != "none" ]]; then
opts_provider=(${(f)"$(_call_program commands $driver_opt_cmd)"})
_arguments \
$opts_provider \
$opts_read_argument \
$opts_common && ret=0
else
_arguments $opts_common && ret=0
fi
case $state in
(driver-option)
_describe -t driver-option "driver" opts_driver && ret=0
;;
(storage-driver-option)
_describe -t storage-driver-option "storage driver" opts_storage_driver && ret=0
;;
(swarm-service)
__get_swarm_discovery && ret=0
;;
(argument)
ret=0
;;
esac
return ret
}
__docker-machine_subcommand() {
local -a opts_help
opts_help=("(- :)--help[Print usage]")
local -a opts_only_host opts_driver opts_storage_driver opts_state
opts_only_host=(
"$opts_help"
"*:host:__docker-machine_hosts_all"
)
opts_driver=('amazonec2' 'azure' 'digitalocean' 'exoscale' 'generic' 'google' 'hyperv' 'none' 'openstack' 'rackspace' 'softlayer' 'virtualbox' 'vmwarefusion' 'vmwarevcloudair' 'vmwarevsphere')
opts_storage_driver=('overlay' 'aufs' 'btrfs' 'devicemapper' 'vfs' 'zfs')
integer ret=1
case "$words[1]" in
(active)
_arguments \
$opts_help \
'(--timeout -t)'{--timeout=,-t=}'[Timeout in seconds, default to 10s]:seconds' && ret=0
;;
(config)
_arguments \
$opts_help \
'--swarm[Display the Swarm config instead of the Docker daemon]' \
"*:host:__docker-machine_hosts_all" && ret=0
;;
(create)
__get_create_argument
;;
(env)
_arguments \
$opts_help \
'--swarm[Display the Swarm config instead of the Docker daemon]' \
'--shell=[Force environment to be configured for a specified shell: \[fish, cmd, powershell\], default is auto-detect]:shell' \
'(--unset -u)'{--unset,-u}'[Unset variables instead of setting them]' \
'--no-proxy[Add machine IP to NO_PROXY environment variable]' \
'*:host:__docker-machine_hosts_running' && ret=0
;;
(help)
_arguments ':subcommand:__docker-machine_commands' && ret=0
;;
(inspect)
_arguments \
$opts_help \
'(--format -f)'{--format=,-f=}'[Format the output using the given go template]:template' \
'*:host:__docker-machine_hosts_all' && ret=0
;;
(ip)
_arguments \
$opts_help \
'*:host:__docker-machine_hosts_running' && ret=0
;;
(kill)
_arguments \
$opts_help \
'*:host:__docker-machine_hosts_with_state' && ret=0
;;
(ls)
_arguments \
$opts_help \
'(--quiet -q)'{--quiet,-q}'[Enable quiet mode]' \
'*--filter=[Filter output based on conditions provided]:filter:->filter-options' \
'(--timeout -t)'{--timeout=,-t=}'[Timeout in seconds, default to 10s]:seconds' \
'(--format -f)'{--format=,-f=}'[Pretty-print machines using a Go template]:template' && ret=0
case $state in
(filter-options)
__docker-machine_filters && ret=0
;;
esac
;;
(provision)
_arguments $opts_only_host && ret=0
;;
(regenerate-certs)
_arguments \
$opts_help \
'(--force -f)'{--force,-f}'[Force rebuild and do not prompt]' \
'*:host:__docker-machine_hosts_all' && ret=0
;;
(restart)
_arguments \
$opts_help \
'*:host:__docker-machine_hosts_with_state' && ret=0
;;
(rm)
_arguments \
$opts_help \
'(--force -f)'{--force,-f}'[Remove local configuration even if machine cannot be removed, also implies an automatic yes (`-y`)]' \
'-y[Assumes automatic yes to proceed with remove, without prompting further user confirmation]' \
'*:host:__docker-machine_hosts_with_state' && ret=0
;;
(scp)
_arguments \
$opts_help \
'(--recursive -r)'{--recursive,-r}'[Copy files recursively (required to copy directories))]' \
'*:files:__docker-machine_hosts_and_files' && ret=0
;;
(ssh)
_arguments \
$opts_help \
'*:host:__docker-machine_hosts_running' && ret=0
;;
(start)
_arguments \
$opts_help \
'*:host:__docker-machine_hosts_with_state' && ret=0
;;
(status)
_arguments $opts_only_host && ret=0
;;
(stop)
_arguments \
$opts_help \
'*:host:__docker-machine_hosts_with_state' && ret=0
;;
(upgrade)
_arguments $opts_only_host && ret=0
;;
(url)
_arguments \
$opts_help \
'*:host:__docker-machine_hosts_running' && ret=0
;;
esac
return ret
}
__docker-machine_commands() {
local cache_policy
zstyle -s ":completion:${curcontext}:" cache-policy cache_policy
if [[ -z "$cache_policy" ]]; then
zstyle ":completion:${curcontext}:" cache-policy __docker-machine_caching_policy
fi
if ( [[ ${+_docker_machine_subcommands} -eq 0 ]] || _cache_invalid docker_machine_subcommands) \
&& ! _retrieve_cache docker_machine_subcommands;
then
local -a lines
lines=(${(f)"$(_call_program commands docker-machine 2>&1)"})
_docker_machine_subcommands=(${${${lines[$((${lines[(i)Commands:]} + 1)),${lines[(I) *]}]}## #}/$'\t'##/:})
(( $#_docker_machine_subcommands > 0 )) && _store_cache docker_machine_subcommands _docker_machine_subcommands
fi
_describe -t docker-machine-commands "docker-machine command" _docker_machine_subcommands
}
__docker-machine_caching_policy() {
oldp=( "$1"(Nmh+1) )
(( $#oldp ))
}
_docker-machine() {
if [[ $service != docker-machine ]]; then
_call_function - _$service
return
fi
local curcontext="$curcontext" state line
integer ret=1
typeset -A opt_args
_arguments -C \
"(- :)"{-h,--help}"[Show help]" \
"(-D --debug)"{-D,--debug}"[Enable debug mode]" \
'(-s --storage-path)'{-s,--storage-path}'[Configures storage path]:file:_files' \
'--tls-ca-cert[CA to verify remotes against]:file:_files' \
'--tls-ca-key[Private key to generate certificates]:file:_files' \
'--tls-client-cert[Client cert to use for TLS]:file:_files' \
'--tls-client-key[Private key used in client TLS auth]:file:_files' \
'--github-api-token[Token to use for requests to the GitHub API]' \
'--native-ssh[Use the native (Go-based) SSH implementation.]' \
'--bugsnag-api-token[Bugsnag API token for crash reporting]' \
'(- :)'{-v,--version}'[Print the version]' \
"(-): :->command" \
"(-)*:: :->option-or-argument" && ret=0
case $state in
(command)
__docker-machine_commands && ret=0
;;
(option-or-argument)
curcontext=${curcontext%:*:*}:docker-machine-$words[1]:
__docker-machine_subcommand && ret=0
ret=0
;;
esac
return ret
}
_docker-machine "$@"

View file

@ -1,33 +0,0 @@
DEFAULT_MACHINE="default"
docker-up() {
if [ -z "$1" ]
then
docker-machine start "${DEFAULT_MACHINE}"
eval $(docker-machine env "${DEFAULT_MACHINE}")
else
docker-machine start $1
eval $(docker-machine env $1)
fi
echo $DOCKER_HOST
}
docker-stop() {
if [ -z "$1" ]
then
docker-machine stop "${DEFAULT_MACHINE}"
else
docker-machine stop $1
fi
}
docker-switch() {
eval $(docker-machine env $1)
echo $DOCKER_HOST
}
docker-vm() {
if [ -z "$1" ]
then
docker-machine create -d virtualbox --virtualbox-disk-size 20000 --virtualbox-memory 4096 --virtualbox-cpu-count 2 "${DEFAULT_MACHINE}"
else
docker-machine create -d virtualbox --virtualbox-disk-size 20000 --virtualbox-memory 4096 --virtualbox-cpu-count 2 $1
fi
}

View file

@ -39,6 +39,10 @@ following setting. See https://github.com/ohmyzsh/ohmyzsh/issues/11789 for more
zstyle ':omz:plugins:docker' legacy-completion yes
```
### For Podman's Docker wrapper users
If you use Podman's Docker wrapper, you need to enable legacy completion. See above section.
## Aliases
| Alias | Command | Description |
@ -51,6 +55,7 @@ zstyle ':omz:plugins:docker' legacy-completion yes
| dii | `docker image inspect` | Display detailed information on one or more images |
| dils | `docker image ls` | List docker images |
| dipu | `docker image push` | Push an image or repository to a remote registry |
| dipru | `docker image prune -a` | Remove all images not referenced by any container |
| dirm | `docker image rm` | Remove one or more images |
| dit | `docker image tag` | Add a name and tag to a particular image |
| dlo | `docker container logs` | Fetch the logs of a docker container |
@ -61,6 +66,8 @@ zstyle ':omz:plugins:docker' legacy-completion yes
| dnls | `docker network ls` | List all networks the engine daemon knows about, including those spanning multiple hosts |
| dnrm | `docker network rm` | Remove one or more networks |
| dpo | `docker container port` | List port mappings or a specific mapping for the container |
| dps | `docker ps` | List all the running docker containers |
| dpsa | `docker ps -a` | List all running and stopped containers |
| dpu | `docker pull` | Pull an image or a repository from a registry |
| dr | `docker container run` | Create a new container and start it using the specified command |
| drit | `docker container run -it` | Create a new container and start it in an interactive shell |
@ -70,6 +77,7 @@ zstyle ':omz:plugins:docker' legacy-completion yes
| drs | `docker container restart` | Restart one or more containers |
| dsta | `docker stop $(docker ps -q)` | Stop all running containers |
| dstp | `docker container stop` | Stop one or more running containers |
| dsts | `docker stats` | Display real-time streaming statistics for containers |
| dtop | `docker top` | Display the running processes of a container |
| dvi | `docker volume inspect` | Display detailed information about one or more volumes |
| dvls | `docker volume ls` | List all the volumes known to docker |

View file

@ -6,6 +6,7 @@ alias dib='docker image build'
alias dii='docker image inspect'
alias dils='docker image ls'
alias dipu='docker image push'
alias dipru='docker image prune -a'
alias dirm='docker image rm'
alias dit='docker image tag'
alias dlo='docker container logs'
@ -16,6 +17,8 @@ alias dni='docker network inspect'
alias dnls='docker network ls'
alias dnrm='docker network rm'
alias dpo='docker container port'
alias dps='docker ps'
alias dpsa='docker ps -a'
alias dpu='docker pull'
alias dr='docker container run'
alias drit='docker container run -it'
@ -25,6 +28,7 @@ alias dst='docker container start'
alias drs='docker container restart'
alias dsta='docker stop $(docker ps -q)'
alias dstp='docker container stop'
alias dsts='docker stats'
alias dtop='docker top'
alias dvi='docker volume inspect'
alias dvls='docker volume ls'
@ -36,7 +40,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

@ -23,3 +23,4 @@ plugins=(... dotnet)
| dp | dotnet pack | Create a NuGet package. |
| dng | dotnet nuget | Provides additional NuGet commands. |
| db | dotnet build | Build a .NET project |
| dres | dotnet restore | Restore dependencies and project-specific tools for a project. |

View file

@ -24,3 +24,4 @@ alias da='dotnet add'
alias dp='dotnet pack'
alias dng='dotnet nuget'
alias db='dotnet build'
alias dres='dotnet restore'

View file

@ -35,7 +35,7 @@ alias eeval="$EMACS_PLUGIN_LAUNCHER --eval"
alias eframe='emacsclient --alternate-editor="" --create-frame'
# Emacs ANSI Term tracking
if [[ -n "$INSIDE_EMACS" ]]; then
if [[ -n "$INSIDE_EMACS" ]] && [[ "$INSIDE_EMACS" != "vterm" ]]; then
chpwd_emacs() { print -P "\033AnSiTc %d"; }
print -P "\033AnSiTc %d" # Track current working directory
print -P "\033AnSiTu %n" # Track username

View file

@ -29,5 +29,5 @@ plugins=(... ember-cli)
- [BilalBudhani](https://github.com/BilalBudhani)
- [eubenesa](https://github.com/eubenesa)
- [scottkidder](https://github.com/scottkidder]
- [scottkidder](https://github.com/scottkidder)
- [t-sauer](https://www.github.com/t-sauer)

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

@ -10,7 +10,7 @@ encodefile64() {
if [[ $# -eq 0 ]]; then
echo "You must provide a filename"
else
base64 -i $1 -o $1.txt
base64 $1 > $1.txt
echo "${1}'s content encoded in base64 and saved as ${1}.txt"
fi
}

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,11 +76,11 @@ 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 ;;
(*.7z) 7za x "$full_path" ;;
(*.7z | *.7z.[0-9]*) 7za x "$full_path" ;;
(*.deb)
command mkdir -p "control" "data"
ar vx "$full_path" > /dev/null

View file

@ -55,6 +55,39 @@ If `yes` (default), always add `-g` flag to show the group ownership.
Default: `yes`
### `icons`
```zsh
zstyle ':omz:plugins:eza' 'icons' yes|no
```
If `yes`, sets the `--icons` option of `eza`, adding icons for files and folders.
Default: `no`
### `color-scale`
```zsh
zstyle ':omz:plugins:eza' 'color-scale' all|age|size
```
Highlight levels of field(s) distinctly. Use comma(,) separated list of `all`, `age`, `size`
Default: `none`
### `color-scale-mode`
```zsh
zstyle ':omz:plugins:eza' 'color-scale-mode' gradient|fixed
```
Choose the mode for highlighting:
- `gradient` (default) -- gradient coloring
- `fixed` -- fixed coloring
Default: `gradient`
### `size-prefix`
```zsh
@ -80,6 +113,16 @@ Sets the `--time-style` option of `eza`. (See `man eza` for the options)
Default: Not set, which means the default behavior of `eza` will take place.
### `hyperlink`
```zsh
zstyle ':omz:plugins:eza' 'hyperlink' yes|no
```
If `yes`, always add `--hyperlink` flag to create hyperlink with escape codes.
Default: `no`
## Aliases
**Notes:**

View file

@ -31,10 +31,24 @@ function _configure_eza() {
if zstyle -t ':omz:plugins:eza' 'git-status'; then
_EZA_TAIL+=("--git")
fi
if zstyle -t ':omz:plugins:eza' 'icons'; then
_EZA_TAIL+=("--icons=auto")
fi
zstyle -s ':omz:plugins:eza' 'color-scale' _val
if [[ $_val ]]; then
_EZA_TAIL+=("--color-scale=$_val")
fi
zstyle -s ':omz:plugins:eza' 'color-scale-mode' _val
if [[ $_val == (gradient|fixed) ]]; then
_EZA_TAIL+=("--color-scale-mode=$_val")
fi
zstyle -s ':omz:plugins:eza' 'time-style' _val
if [[ $_val ]]; then
_EZA_TAIL+=("--time-style='$_val'")
fi
if zstyle -t ":omz:plugins:eza" "hyperlink"; then
_EZA_TAIL+=("--hyperlink")
fi
}
_configure_eza

View file

@ -1,4 +1,14 @@
# Use Ctrl-Z to switch back to Vim
# fancy-ctrl-z
Allows pressing Ctrl-Z again to switch back to a background job.
To use it, add `fancy-ctrl-z` to the plugins array in your zshrc file:
```zsh
plugins=(... fancy-ctrl-z)
```
## Motivation
I frequently need to execute random commands in my shell. To achieve it I pause
Vim by pressing Ctrl-z, type command and press fg<Enter> to switch back to Vim.

View file

@ -5,8 +5,8 @@
# If they are not set yet, they will be
# overwritten with their default values
default fastfile_dir "${HOME}/.fastfile"
default fastfile_var_prefix "
fastfile_dir="${fastfile_dir:-${HOME}/.fastfile}"
fastfile_var_prefix="${fastfile_var_prefix:-§}"
###########################
# Impl

View file

@ -1,9 +0,0 @@
# fd
This plugin adds completion for the file search tool [`fd`](https://github.com/sharkdp/fd), also known as `fd-find`.
To use it, add `fd` to the plugins array in your zshrc file:
```zsh
plugins=(... fd)
```

View file

@ -1,273 +0,0 @@
#compdef fd
##
# zsh completion function for fd
#
# Based on ripgrep completion function.
# Originally based on code from the zsh-users project — see copyright notice
# below.
autoload -U is-at-least
_fd() {
local curcontext="$curcontext" no='!' ret=1
local -a context line state state_descr _arguments_options fd_types fd_args
local -A opt_args
if is-at-least 5.2; then
_arguments_options=( -s -S )
else
_arguments_options=( -s )
fi
fd_types=(
{f,file}'\:"regular files"'
{d,directory}'\:"directories"'
{l,symlink}'\:"symbolic links"'
{e,empty}'\:"empty files or directories"'
{x,executable}'\:"executable (files)"'
{s,socket}'\:"sockets"'
{p,pipe}'\:"named pipes (FIFOs)"'
)
# Do not complete rare options unless either the current prefix
# matches one of those options or the user has the `complete-all`
# style set. Note that this prefix check has to be updated manually to account
# for all of the potential negation options listed below!
if
# (--[bpsu]* => match all options marked with '$no')
[[ $PREFIX$SUFFIX == --[bopsu]* ]] ||
zstyle -t ":complete:$curcontext:*" complete-all
then
no=
fi
# We make heavy use of argument groups here to prevent the option specs from
# growing unwieldy. These aren't supported in zsh <5.4, though, so we'll strip
# them out below if necessary. This makes the exclusions inaccurate on those
# older versions, but oh well — it's not that big a deal
fd_args=(
+ '(hidden)' # hidden files
{-H,--hidden}'[search hidden files/directories]'
+ '(no-ignore-full)' # all ignore files
'(no-ignore-partial)'{-I,--no-ignore}"[don't respect .(git|fd)ignore and global ignore files]"
$no'(no-ignore-partial)*'{-u,--unrestricted}'[alias for --no-ignore, when repeated also alias for --hidden]'
+ no-ignore-partial # some ignore files
"(no-ignore-full --no-ignore-vcs)--no-ignore-vcs[don't respect .gitignore files]"
"!(no-ignore-full --no-global-ignore-file)--no-global-ignore-file[don't respect the global ignore file]"
$no'(no-ignore-full --no-ignore-parent)--no-ignore-parent[]'
+ '(case)' # case-sensitivity
{-s,--case-sensitive}'[perform a case-sensitive search]'
{-i,--ignore-case}'[perform a case-insensitive search]'
+ '(regex-pattern)' # regex-based search pattern
'(no-regex-pattern)--regex[perform a regex-based search (default)]'
+ '(no-regex-pattern)' # non-regex-based search pattern
{-g,--glob}'[perform a glob-based search]'
{-F,--fixed-strings}'[treat pattern as literal string instead of a regex]'
+ '(match-full)' # match against full path
{-p,--full-path}'[match the pattern against the full path instead of the basename]'
+ '(follow)' # follow symlinks
{-L,--follow}'[follow symbolic links to directories]'
+ '(abs-path)' # show absolute paths
'(long-listing)'{-a,--absolute-path}'[show absolute paths instead of relative paths]'
+ '(null-sep)' # use null separator for output
'(long-listing)'{-0,--print0}'[separate search results by the null character]'
+ '(long-listing)' # long-listing output
'(abs-path null-sep max-results exec-cmds)'{-l,--list-details}'[use a long listing format with file metadata]'
+ '(max-results)' # max number of results
'(long-listing exec-cmds)--max-results=[limit number of search results to given count and quit]:count'
'(long-listing exec-cmds)-1[limit to a single search result and quit]'
+ '(fs-errors)' # file-system errors
$no'--show-errors[enable the display of filesystem errors]'
+ '(fs-traversal)' # file-system traversal
$no"--one-file-system[don't descend into directories on other file systems]"
'!--mount'
'!--xdev'
+ dir-depth # directory depth
'(--exact-depth -d --max-depth)'{-d+,--max-depth=}'[set max directory depth to descend when searching]:depth'
'!(--exact-depth -d --max-depth)--maxdepth:depth'
'(--exact-depth --min-depth)--min-depth=[set directory depth to descend before start searching]:depth'
'(--exact-depth -d --max-depth --maxdepth --min-depth)--exact-depth=[only search at the exact given directory depth]:depth'
+ prune # pruning
"--prune[don't traverse into matching directories]"
+ filter-misc # filter search
'*'{-t+,--type=}"[filter search by type]:type:(($fd_types))"
'*'{-e+,--extension=}'[filter search by file extension]:extension'
'*'{-E+,--exclude=}'[exclude files/directories that match the given glob pattern]:glob pattern'
'*'{-S+,--size=}'[limit search by file size]:size limit:->size'
'(-o --owner)'{-o+,--owner=}'[filter by owning user and/or group]:owner and/or group:->owner'
+ ignore-file # extra ignore files
'*--ignore-file=[add a custom, low-precedence ignore-file with .gitignore format]: :_files'
+ '(filter-mtime-newer)' # filter by files modified after than
'--changed-within=[limit search to files/directories modified within the given date/duration]:date or duration'
'!--change-newer-than=:date/duration'
'!--newer=:date/duration'
+ '(filter-mtime-older)' # filter by files modified before than
'--changed-before=[limit search to files/directories modified before the given date/duration]:date or duration'
'!--change-older-than=:date/duration'
'!--older=:date/duration'
+ '(color)' # colorize output
{-c+,--color=}'[declare when to colorize search results]:when to colorize:((
auto\:"show colors if the output goes to an interactive console (default)"
never\:"do not use colorized output"
always\:"always use colorized output"
))'
+ '(threads)'
{-j+,--threads=}'[set the number of threads for searching and executing]:number of threads'
+ '(exec-cmds)' # execute command
'(long-listing max-results)'{-x+,--exec=}'[execute command for each search result]:command: _command_names -e:*\;::program arguments: _normal'
'(long-listing max-results)'{-X+,--exec-batch=}'[execute command for all search results at once]:command: _command_names -e:*\;::program arguments: _normal'
'(long-listing max-results)--batch-size=[max number of args for each -X call]:size'
+ other
'!(--max-buffer-time)--max-buffer-time=[set amount of time to buffer before showing output]:time (ms)'
+ '(about)' # about flags
'(: * -)'{-h,--help}'[display help message]'
'(: * -)'{-v,--version}'[display version information]'
+ path-sep # set path separator for output
$no'(--path-separator)--path-separator=[set the path separator to use when printing file paths]:path separator'
+ search-path
$no'(--base-directory)--base-directory=[change the current working directory to the given path]:directory:_files -/'
$no'(*)*--search-path=[set search path (instead of positional <path> arguments)]:directory:_files -/'
+ strip-cwd-prefix
$no'(strip-cwd-prefix exec-cmds)--strip-cwd-prefix[Strip ./ prefix when output is redirected]'
+ args # positional arguments
'1: :_guard "^-*" pattern'
'(--search-path)*:directory:_files -/'
)
# Strip out argument groups where unsupported (see above)
is-at-least 5.4 ||
fd_args=( ${(@)args:#(#i)(+|[a-z0-9][a-z0-9_-]#|\([a-z0-9][a-z0-9_-]#\))} )
_arguments $_arguments_options : $fd_args && ret=0
case ${state} in
owner)
compset -P '(\\|)\!'
if compset -P '*:'; then
_groups && ret=0
else
if
compset -S ':*' ||
# Do not add the colon suffix when completing "!user<TAB>
# (with a starting double-quote) otherwise pressing tab again
# after the inserted colon "!user:<TAB> will complete history modifiers
[[ $IPREFIX == (\\|\!)* && ($QIPREFIX == \"* && -z $QISUFFIX) ]]
then
_users && ret=0
else
local q
# Since quotes are needed when using the negation prefix !,
# automatically remove the colon suffix also when closing the quote
if [[ $QIPREFIX == [\'\"]* ]]; then
q=${QIPREFIX:0:1}
fi
_users -r ": \t\n\-$q" -S : && ret=0
fi
fi
;;
size)
if compset -P '[-+][0-9]##'; then
local -a suff=(
'B:bytes'
'K:kilobytes (10^3 = 1000 bytes)'
'M:megabytes (10^6 = 1000^2 bytes)'
'G:gigabytes (10^9 = 1000^3 bytes)'
'T:terabytes (10^12 = 1000^4 bytes)'
'Ki:kibibytes ( 2^10 = 1024 bytes)'
'Mi:mebibytes ( 2^20 = 1024^2 bytes)'
'Gi:gigibytes ( 2^30 = 1024^3 bytes)'
'Ti:tebibytes ( 2^40 = 1024^4 bytes)'
)
_describe -t units 'size limit units' suff -V 'units'
elif compset -P '[-+]'; then
_message -e 'size limit number (full format: <+-><number><unit>)'
else
_values 'size limit prefix (full format: <prefix><number><unit>)' \
'\+[file size must be greater or equal to]'\
'-[file size must be less than or equal to]' && ret=0
fi
;;
esac
return ret
}
_fd "$@"
# ------------------------------------------------------------------------------
# Copyright (c) 2011 GitHub zsh-users - http://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for fd
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * smancill (https://github.com/smancill)
#
# ------------------------------------------------------------------------------
# Local Variables:
# mode: shell-script
# coding: utf-8-unix
# indent-tabs-mode: nil
# sh-indentation: 2
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et

35
plugins/foot/README.md Normal file
View file

@ -0,0 +1,35 @@
# foot
This plugin adds shell integration for [foot, a fast, lightweight and
minimalistic Wayland terminal emulator](https://codeberg.org/dnkl/foot).
To use, add `foot` to the list of plugins in your `.zshrc` file:
```zsh
plugins=(... foot)
```
## Spawning new terminal instances in the current working directory
When spawning a new terminal instance (with `ctrl+shift+n` by default), the new
instance will start in the current working directory.
## Jumping between prompts
Foot can move the current viewport to focus prompts of already executed
commands (bound to ctrl+shift+z/x by default).
## Piping last command's output
The key binding `pipe-command-output` can pipe the last command's output to an
application of your choice (similar to the other `pipe-*` key bindings):
```
[key-bindings]
pipe-command-output=[sh -c "f=$(mktemp); cat - > $f; footclient emacsclient -nw $f; rm $f"] Control+Shift+g
```
When pressing ctrl+shift+g, the last command's output is written to a
temporary file, then an emacsclient is started in a new footclient instance.
The temporary file is removed after the footclient instance has closed.

View file

@ -0,0 +1,10 @@
function precmd {
print -Pn "\e]133;A\e\\"
if ! builtin zle; then
print -n "\e]133;D\e\\"
fi
}
function preexec {
print -n "\e]133;C\e\\"
}

View file

@ -2,6 +2,7 @@
# Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de
# Updated to support ForkLift 2 and ForkLift 3 by Johan Kaving
# Updated to support ForkLift from Setapp by Paul Rudkin
# Updated to support ForkLift 4 by Michal Szymanski (misiektoja)
#
# Usage:
# fl [<folder>]
@ -110,6 +111,11 @@ function fl {
tell pop over of list of group of splitter group of splitter group of topWindow
set value of text field 1 to "$PWD"
end tell
else if forkLiftVersion starts with "4" then
tell pop over of list of group of splitter group of splitter group of topWindow
keystroke "$PWD"
delay 0.1
end tell
else
tell sheet 1 of topWindow
set value of text field 1 to "$PWD"

View file

@ -4,6 +4,8 @@ function fzf_setup_using_fzf() {
# we remove "fzf " prefix, this fixes really old fzf versions behaviour
# see https://github.com/ohmyzsh/ohmyzsh/issues/12387
local fzf_ver=${"$(fzf --version)"#fzf }
autoload -Uz is-at-least
is-at-least 0.48.0 ${${(s: :)fzf_ver}[1]} || return 1
eval "$(fzf --zsh)"
@ -146,6 +148,27 @@ function fzf_setup_using_opensuse() {
return 0
}
function fzf_setup_using_fedora() {
(( $+commands[fzf] )) || return 1
local completions="/usr/share/zsh/site-functions/fzf"
local key_bindings="/usr/share/fzf/shell/key-bindings.zsh"
if [[ ! -f "$completions" || ! -f "$key_bindings" ]]; then
return 1
fi
if [[ -o interactive && "$DISABLE_FZF_AUTO_COMPLETION" != "true" ]]; then
source "$completions" 2>/dev/null
fi
if [[ "$DISABLE_FZF_KEY_BINDINGS" != "true" ]]; then
source "$key_bindings" 2>/dev/null
fi
return 0
}
function fzf_setup_using_openbsd() {
# openBSD installs fzf in /usr/local/bin/fzf
if [[ "$OSTYPE" != openbsd* ]] || (( ! $+commands[fzf] )); then
@ -232,6 +255,7 @@ fzf_setup_using_fzf \
|| fzf_setup_using_openbsd \
|| fzf_setup_using_debian \
|| fzf_setup_using_opensuse \
|| fzf_setup_using_fedora \
|| fzf_setup_using_cygwin \
|| fzf_setup_using_macports \
|| fzf_setup_using_base_dir \

View file

@ -1,6 +1,6 @@
# gatsby autocomplete plugin
* Adds autocomplete options for all gatsby commands.
Adds autocomplete options for all gatsby commands.
## Requirements

View file

@ -4,4 +4,29 @@ alias gemp="gem push *.gem"
# gemy GEM 0.0.0 = gem yank GEM -v 0.0.0
function gemy {
gem yank $1 -v $2
}
}
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `gem`. Otherwise, compinit will have already done that.
if [[ ! -f "$ZSH_CACHE_DIR/completions/_gem" ]]; then
typeset -g -A _comps
autoload -Uz _gem
_comps[gem]=_gem
fi
# zsh 5.5 already provides completion for `_gem`. With this we ensure that
# our provided completion (which is not optimal but is enough in most cases)
# is used for older versions
autoload -Uz is-at-least
if is-at-least 5.5; then
return 0
fi
{
# 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}"
command cp -f "${0:h}/completions/_gem" "$ZSH_CACHE_DIR/completions/_gem"
} &|

View file

@ -18,7 +18,7 @@ You can change the fetch interval in your .zshrc:
GIT_AUTO_FETCH_INTERVAL=1200 # in seconds
```
A log of `git fetch --all` will be saved in `.git/FETCH_LOG`.
A log of `git-fetch-all` will be saved in `.git/FETCH_LOG`.
## Toggle auto-fetch per folder

View file

@ -23,9 +23,10 @@ def get_tagname_or_hash():
return hash_
return None
# Re-use method from https://github.com/magicmonty/bash-git-prompt to get stashs count
# Re-use method from https://github.com/magicmonty/bash-git-prompt to get stash count
# Use `--git-common-dir` to avoid problems with git worktrees, which don't have individual stashes
def get_stash():
cmd = Popen(['git', 'rev-parse', '--git-dir'], stdout=PIPE, stderr=PIPE)
cmd = Popen(['git', 'rev-parse', '--git-common-dir'], stdout=PIPE, stderr=PIPE)
so, se = cmd.communicate()
stash_file = '%s%s' % (so.decode('utf-8').rstrip(), '/logs/refs/stash')
@ -35,7 +36,6 @@ def get_stash():
except IOError:
return 0
# `git status --porcelain --branch` can collect all information
# branch, remote_branch, untracked, staged, changed, conflicts, ahead, behind
po = Popen(['git', 'status', '--porcelain', '--branch'], env=dict(os.environ, LANG="C"), stdout=PIPE, stderr=PIPE)

View file

@ -41,8 +41,8 @@ plugins=(... git)
| `gba` | `git branch --all` |
| `gbd` | `git branch --delete` |
| `gbD` | `git branch --delete --force` |
| `gbgd` | `LANG=C git branch --no-color -vv \| grep ": gone\]" \| awk '"'"'{print $1}'"'"' \| xargs git branch -d` |
| `gbgD` | `LANG=C git branch --no-color -vv \| grep ": gone\]" \| awk '"'"'{print $1}'"'"' \| xargs git branch -D` |
| `gbgd` | `LANG=C git branch --no-color -vv \| grep ": gone\]" \| cut -c 3- \| awk '"'"'{print $1}'"'"' \| xargs git branch -d` |
| `gbgD` | `LANG=C git branch --no-color -vv \| grep ": gone\]" \| cut -c 3- \| awk '"'"'{print $1}'"'"' \| xargs git branch -D` |
| `gbm` | `git branch --move` |
| `gbnm` | `git branch --no-merged` |
| `gbr` | `git branch --remote` |
@ -59,6 +59,7 @@ plugins=(... git)
| `gcpc` | `git cherry-pick --continue` |
| `gclean` | `git clean --interactive -d` |
| `gcl` | `git clone --recurse-submodules` |
| `gclf` | `git clone --recursive --shallow-submodules --filter=blob:none --also-filter-submodules` |
| `gccd` | `git clone --recurse-submodules "$@" && cd "$(basename $\_ .git)"` |
| `gcam` | `git commit --all --message` |
| `gcas` | `git commit --all --signoff` |
@ -72,11 +73,13 @@ 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` |
| `gcssm` | `git commit -S -s -m` |
| `gcf` | `git config --list` |
| `gcfu` | `git commit --fixup` |
| `gdct` | `git describe --tags $(git rev-list --tags --max-count=1)` |
| `gd` | `git diff` |
| `gdca` | `git diff --cached` |
@ -88,7 +91,7 @@ plugins=(... git)
| `gdnolock` | `git diff $@ ":(exclude)package-lock.json" ":(exclude)\*.lock"` |
| `gdt` | `git diff-tree --no-commit-id --name-only -r` |
| `gf` | `git fetch` |
| `gfa` | `git fetch --all --prune` |
| `gfa` | `git fetch --all --tags --prune` |
| `gfo` | `git fetch origin` |
| `gg` | `git gui citool` |
| `gga` | `git gui citool --amend` |
@ -111,8 +114,9 @@ plugins=(... git)
| `gfg` | `git ls-files \| grep` |
| `gm` | `git merge` |
| `gma` | `git merge --abort` |
| `gmc` | `git merge --continue` |
| `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` |
@ -124,6 +128,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)` |
@ -153,6 +159,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

@ -35,7 +35,7 @@ function git_develop_branch() {
function git_main_branch() {
command git rev-parse --git-dir &>/dev/null || return
local ref
for ref in refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default,master}; do
for ref in refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default,stable,master}; do
if command git show-ref -q --verify $ref; then
echo ${ref:t}
return 0
@ -147,8 +147,8 @@ function gbds() {
done
}
alias gbgd='LANG=C git branch --no-color -vv | grep ": gone\]" | awk '"'"'{print $1}'"'"' | xargs git branch -d'
alias gbgD='LANG=C git branch --no-color -vv | grep ": gone\]" | awk '"'"'{print $1}'"'"' | xargs git branch -D'
alias gbgd='LANG=C git branch --no-color -vv | grep ": gone\]" | cut -c 3- | awk '"'"'{print $1}'"'"' | xargs git branch -d'
alias gbgD='LANG=C git branch --no-color -vv | grep ": gone\]" | cut -c 3- | awk '"'"'{print $1}'"'"' | xargs git branch -D'
alias gbm='git branch --move'
alias gbnm='git branch --no-merged'
alias gbr='git branch --remote'
@ -165,6 +165,7 @@ alias gcpa='git cherry-pick --abort'
alias gcpc='git cherry-pick --continue'
alias gclean='git clean --interactive -d'
alias gcl='git clone --recurse-submodules'
alias gclf='git clone --recursive --shallow-submodules --filter=blob:none --also-filter-submodules'
function gccd() {
setopt localoptions extendedglob
@ -196,8 +197,10 @@ 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 gcfu='git commit --fixup'
alias gdct='git describe --tags $(git rev-list --tags --max-count=1)'
alias gd='git diff'
alias gdca='git diff --cached'
@ -219,8 +222,8 @@ alias gdt='git diff-tree --no-commit-id --name-only -r'
alias gf='git fetch'
# --jobs=<n> was added in git 2.8
is-at-least 2.8 "$git_version" \
&& alias gfa='git fetch --all --prune --jobs=10' \
|| alias gfa='git fetch --all --prune'
&& alias gfa='git fetch --all --tags --prune --jobs=10' \
|| alias gfa='git fetch --all --tags --prune'
alias gfo='git fetch origin'
alias gg='git gui citool'
alias gga='git gui citool --amend'
@ -254,6 +257,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'
@ -273,6 +277,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() {
@ -336,6 +342,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

@ -0,0 +1,40 @@
This project is a friendly fork of the official Git completion
(`contrib/completion`) and prompt scripts for Bash, Zsh, and possibly other
shells.
Most Git developers use the Bash shell, for which the completion scripts work
rather well, however, Zsh is typically neglected. I've sent many patches to fix
the issues, many have been merged, but many have been ignored, thus the need for
a canonical location of a good, working Zsh completion.
There are advantages for Bash users too. Currently the scripts under `contrib` are tied to the
specific Git version, for example the completion scripts of version v2.40
(https://git.kernel.org/pub/scm/git/git.git/plain/contrib/completion/git-completion.bash?h=v2.40.0[git-completion.bash])
have issues with older versions of Git (e.g. v2.33); the ones in
this project don't.
With `git-completion` you can be sure you are using the latest completion that
works in both shells, and any Git version.
This is a sister project of the
https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/gitfast[Oh My Zsh
gitfast] plugin (that I also maintain), which has similar needs.
== Installation ==
* https://github.com/felipec/git-completion/wiki/Bash[Bash instructions]
* https://github.com/felipec/git-completion/wiki/Zsh[Zsh instructions]
== Improvements from upstream ==
This is a short list of the benefits you get:
* Easier installation
* Tons of bug fixes
* Works with older versions of git
* Zsh: much more options
* Zsh: quoting works properly
* Zsh: automatic suffix removal
For a full list of all the patches on top of upstream git check
https://github.com/felipec/git-completion/wiki/Patches[Patches].

View file

@ -2,23 +2,11 @@
# zsh completion wrapper for git
#
# Copyright (c) 2012-2020 Felipe Contreras <felipe.contreras@gmail.com>
# Copyright (c) 2012-2024 Felipe Contreras <felipe.contreras@gmail.com>
#
# The recommended way to install this script is to make a copy of it as a
# file named '_git' inside any directory in your fpath.
# The recommended way to use this script is to prepend its location to your $fpath:
#
# For example, create a directory '~/.zsh/', copy this file to '~/.zsh/_git',
# and then add the following to your ~/.zshrc file:
#
# fpath=(~/.zsh $fpath)
#
# You need git's bash completion script installed. By default bash-completion's
# location will be used (e.g. pkg-config --variable=completionsdir bash-completion).
#
# If your bash completion script is somewhere else, you can specify the
# location in your ~/.zshrc:
#
# zstyle ':completion:*:*:git:*' script ~/.git-completion.bash
# fpath=($git_completion_srcdir $fpath)
#
zstyle -T ':completion:*:*:git:*' tag-order && \

View file

@ -1,6 +1,8 @@
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Copyright (c) 2012-2024 Felipe Contreras <felipe.contreras@gmail.com>
#
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#

View file

@ -25,6 +25,7 @@ plugins=(... golang)
| goi | `go install` | Compiles and installs packages to $GOPATH |
| gol | `go list` | Lists Go packages |
| gom | `go mod` | Access to operations on modules |
| gomt | `go mod tidy` | Tidies up the go.mod file |
| gopa | `cd $GOPATH` | Takes you to `$GOPATH` |
| gopb | `cd $GOPATH/bin` | Takes you to `$GOPATH/bin` |
| gops | `cd $GOPATH/src` | Takes you to `$GOPATH/src` |

View file

@ -22,6 +22,7 @@ alias goga='go get ./...'
alias goi='go install'
alias gol='go list'
alias gom='go mod'
alias gomt='go mod tidy'
alias gopa='cd $GOPATH'
alias gopb='cd $GOPATH/bin'
alias gops='cd $GOPATH/src'

View file

@ -5,6 +5,7 @@ files=(
/etc/grc.zsh # default
/usr/local/etc/grc.zsh # homebrew darwin-x64
/opt/homebrew/etc/grc.zsh # homebrew darwin-arm64
/home/linuxbrew/.linuxbrew/etc/grc.zsh # linuxbrew
/usr/share/grc/grc.zsh # Gentoo Linux (app-misc/grc)
)

View file

@ -1,127 +1,140 @@
# heroku-alias
🧬 Full alias for heroku cli
|🚀 last maj|📡 source|
|---|---|
|02/06/2020|[heroku cli doc](https://devcenter.heroku.com/articles/heroku-cli-commands)|
Full alias list for Heroku CLI.
# Alias list
To use it, add `heroku-alias` to the plugins array in your zshrc file:
## general
| Alias | Command |
| ------------- | ------------- |
| h | heroku |
| hauto | heroku autocomplete $(echo $SHELL) |
| hl | heroku local |
## config
| Alias | Command |
| ------------- | ------------- |
| hc | heroku config |
| hca | heroku config -a |
| hcr | heroku config -r |
| hcs | heroku config:set |
| hcu | heroku config:unset |
| hcfile | function hcfile bellow |
```sh
hcfile() {
echo " Which platform [-r/a name] ? "
read platform
echo " Which file ? "
read file
while read line;
do heroku config:set "$platform" "$line";
done < "$file"
}
```zsh
plugins=(... heroku-alias)
```
## apps and favorites
| Alias | Command |
| ------------- | ------------- |
| ha | heroku apps |
| hpop | heroku create |
| hkill | heroku apps:destroy |
| hlog | heroku apps:errors |
| hfav | heroku apps:favorites |
| hfava | heroku apps:favorites:add |
| hfavr | heroku apps:favorites:remove |
| hai | heroku apps:info |
| hair | heroku apps:info -r |
| haia | heroku apps:info -a |
## Requirements
# auth
| Alias | Command |
| ------------- | ------------- |
| h2fa | heroku auth:2fa |
- [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli)
| 🚀 last maj | 📡 source |
| ---------- | --------------------------------------------------------------------------- |
| 02/06/2020 | [heroku cli doc](https://devcenter.heroku.com/articles/heroku-cli-commands) |
## Aliases
### general
| Alias | Command |
| ----- | ---------------------------------- |
| h | heroku |
| hauto | heroku autocomplete $(echo $SHELL) |
| hl | heroku local |
### config
| Alias | Command |
| ------ | ---------------------- |
| hc | heroku config |
| hca | heroku config -a |
| hcr | heroku config -r |
| hcs | heroku config:set |
| hcu | heroku config:unset |
Also, you can use the `hcfile` function to set multiple config variables from a file,
which asks you for a platform and a config file to read the configuration from.
### apps and favorites
| Alias | Command |
| ----- | ---------------------------- |
| ha | heroku apps |
| hpop | heroku create |
| hkill | heroku apps:destroy |
| hlog | heroku apps:errors |
| hfav | heroku apps:favorites |
| hfava | heroku apps:favorites:add |
| hfavr | heroku apps:favorites:remove |
| hai | heroku apps:info |
| hair | heroku apps:info -r |
| haia | heroku apps:info -a |
## auth
| Alias | Command |
| ----- | ----------------------- |
| h2fa | heroku auth:2fa |
| h2far | heroku auth:2fa:disable |
# access
| Alias | Command |
| ------------- | ------------- |
| hac | heroku access |
| hacr | heroku access -r |
| haca | heroku access -a |
| hadd | heroku access:add |
| hdel | heroku access:remove |
| hup | heroku access:update |
## access
## addons
| Alias | Command |
| ------------- | ------------- |
| hads | heroku addons -A |
| hada | heroku addons -a |
| hadr | heroku addons -r |
| hadat | heroku addons:attach |
| hadc | heroku addons:create |
| Alias | Command |
| ----- | -------------------- |
| hac | heroku access |
| hacr | heroku access -r |
| haca | heroku access -a |
| hadd | heroku access:add |
| hdel | heroku access:remove |
| hup | heroku access:update |
### addons
| Alias | Command |
| ----- | --------------------- |
| hads | heroku addons -A |
| hada | heroku addons -a |
| hadr | heroku addons -r |
| hadat | heroku addons:attach |
| hadc | heroku addons:create |
| hadel | heroku addons:destroy |
| hadde | heroku addons:detach |
| hadoc | heroku addons:docs |
| hadde | heroku addons:detach |
| hadoc | heroku addons:docs |
## login
| Alias | Command |
| ------------- | ------------- |
| hin | heroku login |
| hout | heroku logout |
| hi | heroku login -i |
| hwho | heroku auth:whoami |
### login
## authorizations
| Alias | Command |
| ------------- | ------------- |
| hth | heroku authorizations |
| Alias | Command |
| ----- | ------------------ |
| hin | heroku login |
| hout | heroku logout |
| hi | heroku login -i |
| hwho | heroku auth:whoami |
### authorizations
| Alias | Command |
| ------ | ---------------------------- |
| hth | heroku authorizations |
| hthadd | heroku authorizations:create |
| hthif | heroku authorizations:info |
| hthif | heroku authorizations:info |
| hthdel | heroku authorizations:revoke |
| hthrot | heroku authorizations:rotate |
| hthup | heroku authorizations:update |
| hthup | heroku authorizations:update |
## plugins
| Alias | Command |
| ------------- | ------------- |
| hp | heroku plugins |
### plugins
# log
| Alias | Command |
| ------------- | ------------- |
|hg | heroku logs|
| hgt | heroku log tail |
| Alias | Command |
| ----- | -------------- |
| hp | heroku plugins |
# database
| Alias | Command |
| ------------- | ------------- |
| hpg | heroku pg |
| hpsql | heroku pg:psql |
| hpb | heroku pg:backups |
| hpbc | heroku pg:backups:capture |
| hpbd | heroku pg:backups:download |
| hpbr | heroku pg:backups:restore |
### log
# certs
| Alias | Command |
| ------------- | ------------- |
| hssl | heroku certs |
| hssli | heroku certs:info |
| hssla | heroku certs:add |
| Alias | Command |
| ----- | --------------- |
| hg | heroku logs |
| hgt | heroku log tail |
### database
| Alias | Command |
| ----- | -------------------------- |
| hpg | heroku pg |
| hpsql | heroku pg:psql |
| hpb | heroku pg:backups |
| hpbc | heroku pg:backups:capture |
| hpbd | heroku pg:backups:download |
| hpbr | heroku pg:backups:restore |
### certs
| Alias | Command |
| ----- | ------------------- |
| hssl | heroku certs |
| hssli | heroku certs:info |
| hssla | heroku certs:add |
| hsslu | heroku certs:update |
| hsslr | heroku certs:remove |

View file

@ -57,13 +57,13 @@ Using [antigen](https://github.com/zsh-users/antigen):
1. Add the `antigen bundle` command just before `antigen apply`, like this:
```
```
antigen bundle zsh-users/zsh-history-substring-search
antigen apply
```
2. Then, **after** `antigen apply`, add the key binding configurations, like this:
```
# zsh-history-substring-search configuration
bindkey '^[[A' history-substring-search-up # or '\eOA'
@ -120,7 +120,7 @@ Usage
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
Users have also observed that `[OA` and `[OB` are correct values,
Users have also observed that `[OA` and `[OB` are correct values,
_even if_ these were not the observed values. If you are having trouble
with the observed values, give these a try.

View file

@ -16,4 +16,3 @@ if [[ -n "$terminfo[kcud1]" ]]; then
bindkey -M emacs "$terminfo[kcud1]" history-substring-search-down
bindkey -M viins "$terminfo[kcud1]" history-substring-search-down
fi

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}*"
@ -406,7 +406,7 @@ _history-substring-search-end() {
# For debugging purposes:
# zle -R "mn: "$_history_substring_search_match_index" m#: "${#_history_substring_search_matches}
# read -k -t 200 && zle -U $REPLY
# read -k -t 200 && zle -U -- "$REPLY"
#
# When this function returns, z-sy-h runs its line-pre-redraw hook. It has no
@ -421,7 +421,7 @@ _history-substring-search-end() {
# before removing search highlight and exiting. This ensures no highlights
# are left lingering after search is finished.
#
read -k -t ${HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_TIMEOUT:-1} && zle -U $REPLY
read -k -t ${HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_TIMEOUT:-1} && zle -U -- "$REPLY"
region_highlight=( "${(@)region_highlight:#*${highlight_memo}*}" )
fi

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

@ -1,7 +1,5 @@
# Isodate plugin
**Maintainer:** [@Frani](https://github.com/frani)
This plugin adds completion for the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601),
as well as some aliases for common Date commands.
@ -11,6 +9,8 @@ To use it, add `isodate` to the plugins array in your zshrc file:
plugins=(... isodate)
```
**Maintainer:** [@Frani](https://github.com/frani)
## Aliases
| Alias | Command | Description |

View file

@ -1,16 +1,18 @@
# Jira plugin #
CLI support for JIRA interaction
## Description ##
# Jira plugin
This plugin provides command line tools for interacting with Atlassian's [JIRA](https://www.atlassian.com/software/jira) bug tracking software.
To use it, add `jira` to the plugins array in your zshrc file:
```zsh
plugins=(... jira)
```
The interaction is all done through the web. No local installation of JIRA is necessary.
In this document, "JIRA" refers to the JIRA issue tracking server, and `jira` refers to the command this plugin supplies.
## Usage ##
## Usage
This plugin supplies one command, `jira`, through which all its features are exposed. Most forms of this command open a JIRA page in your web browser.
@ -18,19 +20,20 @@ This plugin supplies one command, `jira`, through which all its features are exp
`jira help` or `jira usage` will print the below usage instructions
| Command | Description |
| :------------ | :-------------------------------------------------------- |
| `jira` | Performs the default action |
| `jira new` | Opens a new Jira issue dialogue |
| `jira ABC-123` | Opens an existing issue |
| `jira ABC-123 m` | Opens an existing issue for adding a comment |
| `jira dashboard [rapid_view]` | Opens your JIRA dashboard |
| `jira mine` | Queries for your own issues |
| `jira tempo` | Opens your JIRA Tempo |
| `jira reported [username]` | Queries for issues reported by a user |
| `jira assigned [username]` | Queries for issues assigned to a user |
| `jira branch` | Opens an existing issue matching the current branch name |
| `jira help` | Prints usage instructions |
| Command | Description |
| :---------------------------- | :------------------------------------------------------- |
| `jira` | Performs the default action |
| `jira new` | Opens a new Jira issue dialogue |
| `jira ABC-123` | Opens an existing issue |
| `jira ABC-123 m` | Opens an existing issue for adding a comment |
| `jira project ABC` | Opens JIRA project summary |
| `jira dashboard [rapid_view]` | Opens your JIRA dashboard |
| `jira mine` | Queries for your own issues |
| `jira tempo` | Opens your JIRA Tempo |
| `jira reported [username]` | Queries for issues reported by a user |
| `jira assigned [username]` | Queries for issues assigned to a user |
| `jira branch` | Opens an existing issue matching the current branch name |
| `jira help` | Prints usage instructions |
### Jira Branch usage notes
@ -41,9 +44,25 @@ starting with "_": "MP-1234_fix_dashboard". In both these cases, the issue opene
This is also checks if the prefix is in the name, and adds it if not, so: "MP-1234" opens the issue "MP-1234",
"mp-1234" opens the issue "mp-1234", and "1234" opens the issue "MP-1234".
If your branch naming convention deviates, you can overwrite the jira_branch function to determine and echo the Jira issue key yourself.
Define a function `jira_branch` after sourcing `oh-my-zsh.sh` in your `.zshrc`.
Example:
```zsh
# Determine branch name from naming convention 'type/KEY-123/description'.
function jira_branch() {
# Get name of the branch
issue_arg=$(git rev-parse --abbrev-ref HEAD)
# Strip prefixes like feature/ or bugfix/
issue_arg=${issue_arg#*/}
# Strip suffixes like /some-branch-description
issue_arg=${issue_arg%%/*}
# Return the value
echo $issue_arg
}
```
#### Debugging usage ####
#### Debugging usage
These calling forms are for developers' use, and may change at any time.
@ -51,7 +70,7 @@ These calling forms are for developers' use, and may change at any time.
jira dumpconfig # displays the effective configuration
```
## Setup ##
## Setup
The URL for your JIRA instance is set by `$JIRA_URL` or a `.jira_url` file.
@ -68,7 +87,7 @@ echo "https://jira.atlassian.com" >> .jira-url
(Note: The current implementation only looks in the current directory for `.jira-url` and `.jira-prefix`, not up the path, so if you are in a subdirectory of your project, it will fall back to your default JIRA URL. This will probably change in the future though.)
### Variables ###
### Variables
* `$JIRA_URL` - Your JIRA instance's URL
* `$JIRA_NAME` - Your JIRA username; used as the default user for `assigned`/`reported` searches
@ -79,6 +98,6 @@ echo "https://jira.atlassian.com" >> .jira-url
* `$JIRA_TEMPO_PATH` - Your JIRA tempo url path; defaults to "/secure/Tempo.jspa"
### Browser ###
### Browser
Your default web browser, as determined by how `open_command` handles `http://` URLs, is used for interacting with the JIRA instance. If you change your system's URL handler associations, it will change the browser that `jira` uses.

View file

@ -5,6 +5,7 @@ local -a _1st_arguments
_1st_arguments=(
'new:create a new issue'
'mine:open my issues'
'project:open the project'
'dashboard:open the dashboard'
'tempo:open the tempo'
'reported:search for issues reported by a user'

View file

@ -8,6 +8,7 @@ jira Performs the default action
jira new Opens a new Jira issue dialogue
jira ABC-123 Opens an existing issue
jira ABC-123 m Opens an existing issue for adding a comment
jira project ABC Opens JIRA project summary
jira dashboard [rapid_view] Opens your JIRA dashboard
jira mine Queries for your own issues
jira tempo Opens your JIRA Tempo
@ -17,6 +18,30 @@ jira branch Opens an existing issue matching the current bra
EOF
}
# If your branch naming convention deviates, you can partially override this plugin function
# to determine the jira issue key based on your formatting.
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#partially-overriding-an-existing-plugin
function jira_branch() {
# Get name of the branch
issue_arg=$(git rev-parse --abbrev-ref HEAD)
# Strip prefixes like feature/ or bugfix/
issue_arg=${issue_arg##*/}
# Strip suffixes starting with _
issue_arg=(${(s:_:)issue_arg})
# If there is only one part, it means that there is a different delimiter. Try with -
if [[ ${#issue_arg[@]} = 1 && ${issue_arg} == *-* ]]; then
issue_arg=(${(s:-:)issue_arg})
issue_arg="${issue_arg[1]}-${issue_arg[2]}"
else
issue_arg=${issue_arg[1]}
fi
if [[ "${issue_arg:l}" = ${jira_prefix:l}* ]]; then
echo "${issue_arg}"
else
echo "${jira_prefix}${issue_arg}"
fi
}
function jira() {
emulate -L zsh
local action jira_url jira_prefix
@ -64,6 +89,9 @@ function jira() {
elif [[ "$action" == "mine" ]]; then
echo "Opening my issues"
open_command "${jira_url}/issues/?filter=-1"
elif [[ "$action" == "project" ]]; then
echo "Opening project"
open_command "${jira_url}/jira/software/c/projects/${2}/summary"
elif [[ "$action" == "dashboard" ]]; then
echo "Opening dashboard"
if [[ "$JIRA_RAPID_BOARD" == "true" ]]; then
@ -91,24 +119,7 @@ function jira() {
# but `branch` is a special case that will parse the current git branch
local issue_arg issue
if [[ "$action" == "branch" ]]; then
# Get name of the branch
issue_arg=$(git rev-parse --abbrev-ref HEAD)
# Strip prefixes like feature/ or bugfix/
issue_arg=${issue_arg##*/}
# Strip suffixes starting with _
issue_arg=(${(s:_:)issue_arg})
# If there is only one part, it means that there is a different delimiter. Try with -
if [[ ${#issue_arg[@]} = 1 && ${issue_arg} == *-* ]]; then
issue_arg=(${(s:-:)issue_arg})
issue_arg="${issue_arg[1]}-${issue_arg[2]}"
else
issue_arg=${issue_arg[1]}
fi
if [[ "${issue_arg:l}" = ${jira_prefix:l}* ]]; then
issue="${issue_arg}"
else
issue="${jira_prefix}${issue_arg}"
fi
issue=$(jira_branch)
else
issue_arg=${(U)action}
issue="${jira_prefix}${issue_arg}"

Some files were not shown because too many files have changed in this diff Show more