Merge branch 'ohmyzsh:master' into recursive_dotenv

This commit is contained in:
Heitor Polidoro 2024-06-05 10:19:59 -03:00 committed by GitHub
commit 439343b76a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 196 additions and 69 deletions

View file

@ -117,7 +117,7 @@ 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"} &>/dev/null
elif (( ${+commands[growlnotify]} )); then # macOS growl
growlnotify -m "$title" "$message"
elif (( ${+commands[notify-send]} )); then

View file

@ -55,6 +55,16 @@ 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`
### `size-prefix`
```zsh

View file

@ -31,6 +31,9 @@ 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")
fi
zstyle -s ':omz:plugins:eza' 'time-style' _val
if [[ $_val ]]; then
_EZA_TAIL+=("--time-style='$_val'")

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

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'

23
plugins/kitty/README.md Normal file
View file

@ -0,0 +1,23 @@
# Kitty plugin
This plugin adds a few aliases and functions that are useful for users of the [Kitty](https://sw.kovidgoyal.net/kitty/) terminal.
To use it, add _kitty_ to the plugins array of your zshrc file:
```
plugins=(... kitty)
```
## Plugin commands
* `kssh`
Runs a kitten ssh session that ensures your terminfo settings are copied
correctly to the remote hose.
* `kssh-slow`
A slower form of `kssh` that should always work. Use this if `kssh` fails
to set terminfo correctly for you on the remote host.
* `kitty-theme`
Browse and change the theme of your Kitty terminal.
## Contributors
- [Ian Chesal](https://github.com/ianchesal)

View file

@ -0,0 +1,16 @@
#####################################################
# Kitty plugin for oh-my-zsh #
#####################################################
if [[ "$TERM" == 'xterm-kitty' ]]; then
## kssh
# Use this when your terminfo isn't recognized on remote hosts.
# See: https://sw.kovidgoyal.net/kitty/faq/#i-get-errors-about-the-terminal-being-unknown-or-opening-the-terminal-failing-when-sshing-into-a-different-computer
alias kssh="kitty +kitten ssh"
compdef kssh='ssh'
# Use this if kssh fails
alias kssh-slow="infocmp -a xterm-kitty | ssh myserver tic -x -o \~/.terminfo /dev/stdin"
# Change the colour theme
alias kitty-theme="kitty +kitten themes"
fi

View file

@ -180,13 +180,11 @@ alias kej='kubectl edit job'
alias kdj='kubectl describe job'
alias kdelj='kubectl delete job'
# Only run if the user actually has kubectl installed
if (( ${+_comps[kubectl]} )); then
function kj() { kubectl "$@" -o json | jq; }
function kjx() { kubectl "$@" -o json | fx; }
function ky() { kubectl "$@" -o yaml | yh; }
compdef kj=kubectl
compdef kjx=kubectl
compdef ky=kubectl
function kj() { kubectl "$@" -o json | jq; }
function kjx() { kubectl "$@" -o json | fx; }
function ky() { kubectl "$@" -o yaml | yh; }
if (( ${+functions[compdef]} )); then
compdef _kubectl kj
compdef _kubectl kjx
compdef _kubectl ky
fi

View file

@ -8,7 +8,11 @@ To start using it, add the `macos` plugin to your plugins array in `~/.zshrc`:
plugins=(... macos)
```
Original author: [Sorin Ionescu](https://github.com/sorin-ionescu)
## Supported Terminals
- [iTerm](https://iterm.sourceforge.net/)
- [iTerm2](https://iterm2.com/)
- [Hyper](https://hyper.is/)
- [Tabby](https://tabby.sh/)
## Commands
@ -37,7 +41,9 @@ Original author: [Sorin Ionescu](https://github.com/sorin-ionescu)
## Acknowledgements
This application makes use of the following third party scripts:
Original author: [Sorin Ionescu](https://github.com/sorin-ionescu)
This application makes use of the following third-party scripts:
[shpotify](https://github.com/hnarayanan/shpotify)

View file

@ -79,6 +79,13 @@ EOF
key code 36 #(presses enter)
end tell
EOF
elif [[ "$the_app" == 'Tabby' ]]; then
osascript >/dev/null <<EOF
tell application "System Events"
tell process "Tabby" to keystroke "t" using command down
end tell
EOF
else
echo "$0: unsupported terminal app: $the_app" >&2
return 1
@ -126,6 +133,12 @@ EOF
delay 1
keystroke "${command} \n"
end tell
EOF
elif [[ "$the_app" == 'Tabby' ]]; then
osascript >/dev/null <<EOF
tell application "System Events"
tell process "Tabby" to keystroke "D" using command down
end tell
EOF
else
echo "$0: unsupported terminal app: $the_app" >&2
@ -175,6 +188,12 @@ EOF
delay 1
keystroke "${command} \n"
end tell
EOF
elif [[ "$the_app" == 'Tabby' ]]; then
osascript >/dev/null <<EOF
tell application "System Events"
tell process "Tabby" to keystroke "d" using command down
end tell
EOF
else
echo "$0: unsupported terminal app: $the_app" >&2

View file

@ -20,6 +20,8 @@
_pass () {
local cmd
local rootcontext
rootcontext=$curcontext
if (( CURRENT > 2)); then
cmd=${words[2]}
# Set the context for the subcommand.
@ -123,8 +125,9 @@ _pass_cmd_show () {
_pass_complete_entries_helper () {
local IFS=$'\n'
local prefix
zstyle -s ":completion:${curcontext}:" prefix prefix || prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
_values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' -e 's#\\#\\\\#g' -e 's#:#\\:#g' | sort):-""}
zstyle -s ":completion:${rootcontext}:" prefix prefix ||
prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
_values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' -e 's#\\#\\\\#g' -e 's#:#\\:#g' | sort):-""}
}
_pass_complete_entries_with_subdirs () {

View file

@ -1,4 +1,4 @@
# Struoe
# Stripe
This plugin provides completion for the [Stripe CLI](https://stripe.com/docs/stripe-cli).

View file

@ -57,6 +57,19 @@ function _build_tmux_alias {
tmux $2 $3 \"\$@\"
fi
}"
local f s
f="_omz_tmux_alias_${1}"
s=(${(z)2})
eval "function ${f}() {
shift words;
words=(tmux ${@:2} \$words);
((CURRENT+=${#s[@]}+1))
_tmux
}"
compdef "$f" "$1"
}
alias tksv='tmux kill-server'

View file

@ -1,7 +1,7 @@
# Yarn plugin
This plugin adds completion for the [Yarn package manager](https://yarnpkg.com/en/),
as well as some aliases for common Yarn commands.
This plugin adds completion for the [Yarn package manager](https://yarnpkg.com/en/), as well as some aliases
for common Yarn commands.
To use it, add `yarn` to the plugins array in your zshrc file:
@ -11,48 +11,64 @@ plugins=(... yarn)
## Global scripts directory
It also adds `yarn` global scripts dir (commonly `~/.yarn/bin`) to the `$PATH`.
To disable this feature, set the following style in your `.zshrc`:
It also adds `yarn` global scripts dir (commonly `~/.yarn/bin`) to the `$PATH`. To disable this feature, set
the following style in your `.zshrc`:
```zsh
zstyle ':omz:plugins:yarn' global-path no
```
## Yarn Berry
If you are using Yarn berry (a.k.a. Yarn version 2 or higher) as your global Yarn version you should configure
this plugin to configure its aliases accordingly, set the following style in your `.zshrc`:
```zsh
zstyle ':omz:plugins:yarn' berry yes
```
## Aliases
| Alias | Command | Description |
| ----- | ----------------------------------------- | ----------------------------------------------------------------------------- |
| y | `yarn` | The Yarn command |
| ya | `yarn add` | Install a package in dependencies (`package.json`) |
| yad | `yarn add --dev` | Install a package in devDependencies (`package.json`) |
| yap | `yarn add --peer` | Install a package in peerDependencies (`package.json`) |
| yb | `yarn build` | Run the build script defined in `package.json` |
| ycc | `yarn cache clean` | Clean yarn's global cache of packages |
| yd | `yarn dev` | Run the dev script defined in `package.json` |
| yf | `yarn format` | Run the dev script defined in `package.json` |
| yga | `yarn global add` | Install packages globally on your operating system |
| ygls | `yarn global list` | Lists global installed packages |
| ygrm | `yarn global remove` | Remove global installed packages from your OS |
| ygu | `yarn global upgrade` | Upgrade packages installed globally to their latest version |
| yh | `yarn help` | Show help for a yarn command |
| yi | `yarn init` | Interactively creates or updates a package.json file |
| yin | `yarn install` | Install dependencies defined in `package.json` |
| yln | `yarn lint` | Run the lint script defined in `package.json` |
| ylnf | `yarn lint --fix` | Run the lint script defined in `package.json`to automatically fix problems |
| yls | `yarn list` | List installed packages |
| yout | `yarn outdated` | Check for outdated package dependencies |
| yp | `yarn pack` | Create a compressed gzip archive of package dependencies |
| yrm | `yarn remove` | Remove installed packages |
| yrun | `yarn run` | Run a defined package script |
| ys | `yarn serve` | Start the dev server |
| yst | `yarn start` | Run the start script defined in `package.json` |
| yt | `yarn test` | Run the test script defined in `package.json` |
| ytc | `yarn test --coverage` | Run the test script defined in `package.json` with coverage |
| yuc | `yarn global upgrade && yarn cache clean` | Upgrade global packages and clean yarn's global cache |
| yui | `yarn upgrade-interactive` | Prompt for which outdated packages to upgrade |
| yuil | `yarn upgrade-interactive --latest` | Prompt for which outdated packages to upgrade to the latest available version |
| yup | `yarn upgrade` | Upgrade packages to their latest version |
| yv | `yarn version` | Update the version of your package |
| yw | `yarn workspace` | Run a command within a single workspace. |
| yws | `yarn workspaces` | Run a command within all defined workspaces. |
| yy | `yarn why` | Show why a package has been installed, detailing which other packages depend on it |
- Aliases marked with <sup>`*`</sup> are only available when using Yarn v1 (non-berry)
- Aliases marked with <sup>`b`</sup> are only available when using Yarn berry
| Alias | Command | Description |
| ------------------ | ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| y | `yarn` | The Yarn command |
| ya | `yarn add` | Install a package in dependencies (`package.json`) |
| yad | `yarn add --dev` | Install a package in devDependencies (`package.json`) |
| yap | `yarn add --peer` | Install a package in peerDependencies (`package.json`) |
| yb | `yarn build` | Run the build script defined in `package.json` |
| ycc | `yarn cache clean` | Clean yarn's global cache of packages |
| yd | `yarn dev` | Run the dev script defined in `package.json` |
| yf | `yarn format` | Run the dev script defined in `package.json` |
| yh | `yarn help` | Show help for a yarn command |
| yi | `yarn init` | Interactively creates or updates a package.json file |
| yin | `yarn install` | Install dependencies defined in `package.json` |
| yln | `yarn lint` | Run the lint script defined in `package.json` |
| ylnf | `yarn lint --fix` | Run the lint script defined in `package.json`to automatically fix problems |
| yp | `yarn pack` | Create a compressed gzip archive of package dependencies |
| yrm | `yarn remove` | Remove installed packages |
| yrun | `yarn run` | Run a defined package script |
| ys | `yarn serve` | Start the dev server |
| yst | `yarn start` | Run the start script defined in `package.json` |
| yt | `yarn test` | Run the test script defined in `package.json` |
| ytc | `yarn test --coverage` | Run the test script defined in `package.json` with coverage |
| yui | `yarn upgrade-interactive` | Prompt for which outdated packages to upgrade |
| yuil | `yarn upgrade-interactive --latest` (or see `yui` when using [yarn berry](#yarn-berry)) | Prompt for which outdated packages to upgrade to the latest available version |
| yii | `yarn install --frozen-lockfile` (or `yarn install --immutable` when using [yarn berry](#yarn-berry)) | Install dependencies and abort if the lockfile was to be modified |
| yifl | `yii` | Install dependencies and abort if the lockfile was to be modified |
| yup | `yarn upgrade` | Upgrade packages to their latest version |
| yv | `yarn version` | Update the version of your package |
| yw | `yarn workspace` | Run a command within a single workspace. |
| yws | `yarn workspaces` | Run a command within all defined workspaces. |
| yy | `yarn why` | Show why a package has been installed, detailing which other packages depend on it |
| yga<sup>`*`</sup> | `yarn global add` | Install packages globally on your operating system |
| ygls<sup>`*`</sup> | `yarn global list` | Lists global installed packages |
| ygrm<sup>`*`</sup> | `yarn global remove` | Remove global installed packages from your OS |
| ygu<sup>`*`</sup> | `yarn global upgrade` | Upgrade packages installed globally to their latest version |
| yls<sup>`*`</sup> | `yarn list` | List installed packages |
| yout<sup>`*`</sup> | `yarn outdated` | Check for outdated package dependencies |
| yuca<sup>`*`</sup> | `yarn global upgrade && yarn cache clean` | Upgrade global packages and clean yarn's global cache |
| ydlx<sup>`b`</sup> | `yarn dlx` | Run a package in a temporary environment. |
| yn<sup>`b`</sup> | `yarn node` | Run node with the hook already setup. |

View file

@ -18,17 +18,11 @@ alias yb="yarn build"
alias ycc="yarn cache clean"
alias yd="yarn dev"
alias yf="yarn format"
alias yga="yarn global add"
alias ygls="yarn global list"
alias ygrm="yarn global remove"
alias ygu="yarn global upgrade"
alias yh="yarn help"
alias yi="yarn init"
alias yin="yarn install"
alias yln="yarn lint"
alias ylnf="yarn lint --fix"
alias yls="yarn list"
alias yout="yarn outdated"
alias yp="yarn pack"
alias yrm="yarn remove"
alias yrun="yarn run"
@ -36,11 +30,35 @@ alias ys="yarn serve"
alias yst="yarn start"
alias yt="yarn test"
alias ytc="yarn test --coverage"
alias yuc="yarn global upgrade && yarn cache clean"
alias yui="yarn upgrade-interactive"
alias yuil="yarn upgrade-interactive --latest"
alias yup="yarn upgrade"
alias yv="yarn version"
alias yw="yarn workspace"
alias yws="yarn workspaces"
alias yy="yarn why"
# Commands that are specific to the yarn version being used
if zstyle -t ':omz:plugins:yarn' berry; then
# aliases that differ
alias yuil='yui' # --latest flag was removed in yarn berry
alias yii='yarn install --immutable'
alias yifl='yarn install --immutable'
# unique aliases
alias ydlx="yarn dlx"
alias yn="yarn node"
else
# aliases that differ
alias yuil='yarn upgrade-interactive --latest'
alias yii='yarn install --frozen-lockfile'
alias yifl='yarn install --frozen-lockfile'
# unique aliases
alias yga="yarn global add"
alias ygls="yarn global list"
alias ygrm="yarn global remove"
alias ygu="yarn global upgrade"
alias yls="yarn list"
alias yout="yarn outdated"
alias yuca="yarn global upgrade && yarn cache clean"
fi