Skip to content

Commit

Permalink
Merge branch 'ohmyzsh:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Jizong's Fox authored Jan 27, 2023
2 parents 0d3f68a + b0bffca commit d40761e
Show file tree
Hide file tree
Showing 68 changed files with 1,080 additions and 479 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Plugin owners
plugins/archlinux/ @ratijas
plugins/aws/ @maksyms
plugins/genpass/ @atoponce
plugins/git-lfs/ @hellovietduc
plugins/gitfast/ @felipec
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches:
- master
push:
branches:
branches:
- master

concurrency:
Expand All @@ -27,7 +27,7 @@ jobs:
os: [ubuntu-latest, macos-latest]
steps:
- name: Set up git repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install zsh
if: runner.os == 'Linux'
run: sudo apt-get update; sudo apt-get install zsh
Expand Down
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"printWidth": 110,
"proseWrap": "always"
}
6 changes: 3 additions & 3 deletions lib/clipboard.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ function detect-clipboard() {
elif [[ "${OSTYPE}" == (cygwin|msys)* ]]; then
function clipcopy() { cat "${1:-/dev/stdin}" > /dev/clipboard; }
function clippaste() { cat /dev/clipboard; }
elif (( $+commands[clip.exe] )) && (( $+commands[powershell.exe] )); then
function clipcopy() { cat "${1:-/dev/stdin}" | clip.exe; }
function clippaste() { powershell.exe -noprofile -command Get-Clipboard; }
elif [ -n "${WAYLAND_DISPLAY:-}" ] && (( ${+commands[wl-copy]} )) && (( ${+commands[wl-paste]} )); then
function clipcopy() { cat "${1:-/dev/stdin}" | wl-copy &>/dev/null &|; }
function clippaste() { wl-paste; }
Expand All @@ -81,9 +84,6 @@ function detect-clipboard() {
elif [ -n "${TMUX:-}" ] && (( ${+commands[tmux]} )); then
function clipcopy() { tmux load-buffer "${1:--}"; }
function clippaste() { tmux save-buffer -; }
elif [[ $(uname -r) = *icrosoft* ]]; then
function clipcopy() { cat "${1:-/dev/stdin}" | clip.exe; }
function clippaste() { powershell.exe -noprofile -command Get-Clipboard; }
else
function _retry_clipboard_detection_or_fail() {
local clipcmd="${1}"; shift
Expand Down
2 changes: 1 addition & 1 deletion lib/functions.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function takegit() {
}

function take() {
if [[ $1 =~ ^(https?|ftp).*\.tar\.(gz|bz2|xz)$ ]]; then
if [[ $1 =~ ^(https?|ftp).*\.(tar\.(gz|bz2|xz)|tgz)$ ]]; then
takeurl "$1"
elif [[ $1 =~ ^([A-Za-z0-9]\+@|https?|git|ssh|ftps?|rsync).*\.git/?$ ]]; then
takegit "$1"
Expand Down
6 changes: 5 additions & 1 deletion lib/theme-and-appearance.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ fi

# enable diff color if possible.
if command diff --color /dev/null /dev/null &>/dev/null; then
alias diff='diff --color'
function color-diff {
diff --color $@
}
alias diff="color-diff"
compdef _diff color-diff # compdef is already loaded by this point
fi

setopt auto_cd
Expand Down
4 changes: 1 addition & 3 deletions oh-my-zsh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ mkdir -p "$ZSH_CACHE_DIR/completions"
(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath)

# Check for updates on initial load...
if [[ "$DISABLE_AUTO_UPDATE" != true ]]; then
source "$ZSH/tools/check_for_upgrade.sh"
fi
source "$ZSH/tools/check_for_upgrade.sh"

# Initializes Oh My Zsh

Expand Down
26 changes: 13 additions & 13 deletions plugins/autojump/autojump.plugin.zsh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
declare -a autojump_paths
autojump_paths=(
$HOME/.autojump/etc/profile.d/autojump.zsh # manual installation
$HOME/.autojump/share/autojump/autojump.zsh # manual installation
$HOME/.nix-profile/etc/profile.d/autojump.sh # NixOS installation
/run/current-system/sw/share/autojump/autojump.zsh # NixOS installation
/usr/share/autojump/autojump.zsh # Debian and Ubuntu package
/etc/profile.d/autojump.zsh # manual installation
/etc/profile.d/autojump.sh # Gentoo installation
/usr/local/share/autojump/autojump.zsh # FreeBSD installation
/usr/pkg/share/autojump/autojump.zsh # NetBSD installation
/opt/local/etc/profile.d/autojump.sh # macOS with MacPorts
/usr/local/etc/profile.d/autojump.sh # macOS with Homebrew (default)
/opt/homebrew/etc/profile.d/autojump.sh # macOS with Homebrew (default on M1 macs)
/etc/profiles/per-user/$USER/bin/autojump # macOS Nix, Home Manager and flakes
$HOME/.autojump/etc/profile.d/autojump.zsh # manual installation
$HOME/.autojump/share/autojump/autojump.zsh # manual installation
$HOME/.nix-profile/etc/profile.d/autojump.sh # NixOS installation
/run/current-system/sw/share/autojump/autojump.zsh # NixOS installation
/usr/share/autojump/autojump.zsh # Debian and Ubuntu package
/etc/profile.d/autojump.zsh # manual installation
/etc/profile.d/autojump.sh # Gentoo installation
/usr/local/share/autojump/autojump.zsh # FreeBSD installation
/usr/pkg/share/autojump/autojump.zsh # NetBSD installation
/opt/local/etc/profile.d/autojump.sh # macOS with MacPorts
/usr/local/etc/profile.d/autojump.sh # macOS with Homebrew (default)
/opt/homebrew/etc/profile.d/autojump.sh # macOS with Homebrew (default on M1 macs)
/etc/profiles/per-user/$USER/etc/profile.d/autojump.sh # macOS Nix, Home Manager and flakes
)

for file in $autojump_paths; do
Expand Down
1 change: 1 addition & 0 deletions plugins/aws/aws.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ function aws_change_access_key() {
}

function aws_profiles() {
aws --no-cli-pager configure list-profiles 2> /dev/null && return
[[ -r "${AWS_CONFIG_FILE:-$HOME/.aws/config}" ]] || return 1
grep --color=never -Eo '\[.*\]' "${AWS_CONFIG_FILE:-$HOME/.aws/config}" | sed -E 's/^[[:space:]]*\[(profile)?[[:space:]]*([^[:space:]]+)\][[:space:]]*$/\2/g'
}
Expand Down
25 changes: 14 additions & 11 deletions plugins/brew/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,20 @@ defined for convenience.

## 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. |
| `bubo` | `brew update && brew outdated` | Update Homebrew data, then list outdated formulae and casks. |
| `bubu` | `bubo && bubc` | Do the last two operations above. |
| `buf` | `brew upgrade --formula` | Upgrade only formulas (not casks). |
| 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. |
| `bcubc` | `brew upgrade --cask && brew cleanup` | Update outdated casks, then run cleanup. |
| `brewp` | `brew pin` | Pin a specified formula so that it's not upgraded. |
| `brews` | `brew list -1` | List installed formulae or the installed files for a given formula. |
| `brewsp` | `brew list --pinned` | List pinned formulae, or show the version of a given formula. |
| `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. |

## Completion

Expand Down
6 changes: 5 additions & 1 deletion plugins/brew/brew.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ fi

alias bcubc='brew upgrade --cask && brew cleanup'
alias bcubo='brew update && brew outdated --cask'
alias bcubc='brew upgrade --cask && brew cleanup'
alias brewp='brew pin'
alias brewsp='brew list --pinned'
alias bubc='brew upgrade && brew cleanup'
alias bugbc='brew upgrade --greedy && brew cleanup'
alias bubo='brew update && brew outdated'
alias bubu='bubo && bubc'
alias buf='brew upgrade --formula'
alias bubug='bubo && bugbc'
alias bfu='brew upgrade --formula'
alias buz='brew uninstall --zap'

function brews() {
local formulae="$(brew leaves | xargs brew deps --installed --for-each)"
Expand Down
26 changes: 26 additions & 0 deletions plugins/bridgetown/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Bridgetown plugin

This plugin adds some aliases and autocompletion for common [Bridgetown](https://bridgetownrb.com/) commands.

To use it, add `bridgetown` to the plugins array in your zshrc file:

```zsh
plugins=(... bridgetown)
```

## Aliases

| Alias | Command |
|-------|----------------------------|
| br | `bridgetown` |
| bra | `bin/bridgetown apply` |
| brb | `bin/bridgetown build` |
| brc | `bin/bridgetown console` |
| brclean | `bin/bridgetown clean` |
| brd | `bin/bridgetown deploy` |
| brdoc | `bin/bridgetown doctor` |
| brh | `bin/bridgetown help` |
| brn | `bridgetown new` |
| brp | `bridgetown plugins` |
| brpl | `bridgetown plugins list` |
| brs | `bin/bridgetown start` |
12 changes: 12 additions & 0 deletions plugins/bridgetown/bridgetown.plugin.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
alias br='bridgetown'
alias bra='bin/bridgetown apply'
alias brb='bin/bridgetown build'
alias brc='bin/bridgetown console'
alias brclean='bin/bridgetown clean'
alias brd='bin/bridgetown deploy'
alias brdoc='bin/bridgetown doctor'
alias brh='bin/bridgetown help'
alias brn='bridgetown new'
alias brp='bridgetown plugins'
alias brpl='bridgetown plugins list'
alias brs='bin/bridgetown start'
39 changes: 20 additions & 19 deletions plugins/docker-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,23 @@ plugins=(... docker-compose)

## Aliases

| Alias | Command | Description |
|-----------|--------------------------------|------------------------------------------------------------------|
| dco | `docker-compose` | Docker-compose main command |
| dcb | `docker-compose build` | Build containers |
| dce | `docker-compose exec` | Execute command inside a container |
| dcps | `docker-compose ps` | List containers |
| dcrestart | `docker-compose restart` | Restart container |
| dcrm | `docker-compose rm` | Remove container |
| dcr | `docker-compose run` | Run a command in container |
| dcstop | `docker-compose stop` | Stop a container |
| dcup | `docker-compose up` | Build, (re)create, start, and attach to containers for a service |
| dcupb | `docker-compose up --build` | Same as `dcup`, but build images before starting containers |
| dcupd | `docker-compose up -d` | Same as `dcup`, but starts as daemon |
| dcdn | `docker-compose down` | Stop and remove containers |
| dcl | `docker-compose logs` | Show logs of container |
| dclf | `docker-compose logs -f` | Show logs and follow output |
| dcpull | `docker-compose pull` | Pull image of a service |
| dcstart | `docker-compose start` | Start a container |
| dck | `docker-compose kill` | Kills containers |
| Alias | Command | Description |
|-----------|--------------------------------|----------------------------------------------------------------------------------|
| dco | `docker-compose` | Docker-compose main command |
| dcb | `docker-compose build` | Build containers |
| dce | `docker-compose exec` | Execute command inside a container |
| dcps | `docker-compose ps` | List containers |
| dcrestart | `docker-compose restart` | Restart container |
| dcrm | `docker-compose rm` | Remove container |
| dcr | `docker-compose run` | Run a command in container |
| dcstop | `docker-compose stop` | Stop a container |
| dcup | `docker-compose up` | Build, (re)create, start, and attach to containers for a service |
| dcupb | `docker-compose up --build` | Same as `dcup`, but build images before starting containers |
| dcupd | `docker-compose up -d` | Same as `dcup`, but starts as daemon |
| dcupdb | `docker-compose up -d --build` | Same as `dcup`, but build images before starting containers and starts as daemon |
| dcdn | `docker-compose down` | Stop and remove containers |
| dcl | `docker-compose logs` | Show logs of container |
| dclf | `docker-compose logs -f` | Show logs and follow output |
| dcpull | `docker-compose pull` | Pull image of a service |
| dcstart | `docker-compose start` | Start a container |
| dck | `docker-compose kill` | Kills containers |
1 change: 1 addition & 0 deletions plugins/docker-compose/docker-compose.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ alias dcstop="$dccmd stop"
alias dcup="$dccmd up"
alias dcupb="$dccmd up --build"
alias dcupd="$dccmd up -d"
alias dcupdb="$dccmd up -d --build"
alias dcdn="$dccmd down"
alias dcl="$dccmd logs"
alias dclf="$dccmd logs -f"
Expand Down
Loading

0 comments on commit d40761e

Please sign in to comment.