1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-26 01:57:26 +08:00

Compare commits

..

No commits in common. "93cc3964e2d265ab0571298d69d2eed0a65d13f2" and "604f1ef9cd8c1e3b1b53c394e28d21f39609a317" have entirely different histories.

14 changed files with 100 additions and 47 deletions

View File

@ -3,27 +3,19 @@
The plugin adds several aliases for common [brew](https://brew.sh) commands. The plugin adds several aliases for common [brew](https://brew.sh) commands.
To use it, add `brew` to the plugins array of your zshrc file: To use it, add `brew` to the plugins array of your zshrc file:
```
```zsh
plugins=(... brew) plugins=(... brew)
``` ```
## Aliases ## Aliases
| Alias | Command | Description | | Alias | Command | Description |
|----------|-------------------------------------------------------------|---------------------------------------------------------------------| |--------|----------------------|---------------|
| `brewp` | `brew pin` | Pin a specified formula so that it's not upgraded. | | brewp | `brew pin` | Pin a specified formulae, preventing them from being upgraded when issuing the brew upgrade <formulae> command. |
| `brews` | `brew list -1` | List installed formulae or the installed files for a given formula. | | brews | `brew list -1` | List installed formulae, one entry per line, or the installed files for a given formulae. |
| `brewsp` | `brew list --pinned` | List pinned formulae, or show the version of a given formula. | | brewsp | `brew list --pinned` | Show the versions of pinned formulae, or only the specified (pinned) formulae if formulae are given. |
| `bubo` | `brew update && brew outdated` | Update Homebrew and all formulae, then list outdated formulae. | | bubo | `brew update && brew outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated formulae. |
| `bubc` | `brew upgrade && brew cleanup` | Upgrade outdated formulae, then run cleanup. | | bubc | `brew upgrade && brew cleanup` | Upgrade outdated, unpinned brews (with existing install options), then removes stale lock files and outdated downloads for formulae and casks, and removes old versions of installed formulae. |
| `bubu` | `bubo && bubc` | Do the last two operations above. | | bubu | `bubo && bubc` | Updates Homebrew, lists outdated formulae, upgrades oudated and unpinned formulae, and removes stale and outdated downloads and versions. |
| `bcubo` | `brew update && brew cask outdated` | Update Homebrew and alll formulae, then list outdated casks. | | bcubo | `brew update && brew cask outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated casks. |
| `bcubc` | `brew cask reinstall $(brew cask outdated) && brew cleanup` | Update outdated casks, then run cleanup. | | bcubc | `brew cask reinstall $(brew cask outdated) && brew cleanup` | Updates outdated casks, then runs cleanup. |
## Completion
With the release of Homebrew 1.0, they decided to bundle the zsh completion as part of the
brew installation, so we no longer ship it with the brew plugin; now it only has brew
aliases. If you find that brew completion no longer works, make sure you have your Homebrew
installation fully up to date.

View File

@ -6,3 +6,19 @@ alias bubc='brew upgrade && brew cleanup'
alias bubu='bubo && bubc' alias bubu='bubo && bubc'
alias bcubo='brew update && brew cask outdated' alias bcubo='brew update && brew cask outdated'
alias bcubc='brew cask reinstall $(brew cask outdated) && brew cleanup' alias bcubc='brew cask reinstall $(brew cask outdated) && brew cleanup'
if command mkdir "$ZSH_CACHE_DIR/.brew-completion-message" 2>/dev/null; then
print -P '%F{yellow}'Oh My Zsh brew plugin:
cat <<-'EOF'
With the advent of their 1.0 release, Homebrew has decided to bundle
the zsh completion as part of the brew installation, so we no longer
ship it with the brew plugin; now it only has brew aliases.
If you find that brew completion no longer works, make sure you have
your Homebrew installation fully up to date.
You will only see this message once.
EOF
print -P '%f'
fi

View File

@ -5,7 +5,7 @@
# If they are not set yet, they will be # If they are not set yet, they will be
# overwritten with their default values # overwritten with their default values
default fastfile_dir "${HOME}/.fastfile" default fastfile_dir "${HOME}/.fastfile/"
default fastfile_var_prefix "§" default fastfile_var_prefix "§"
########################### ###########################
@ -104,7 +104,7 @@ function fastfile_rm() {
# Generate the aliases for the shortcuts # Generate the aliases for the shortcuts
# #
function fastfile_sync() { function fastfile_sync() {
for f in "${fastfile_dir}"/*(N); do for f in "${fastfile_dir}"/*; do
file=`basename "$f"` # To enable simpler handeling of spaces in file names file=`basename "$f"` # To enable simpler handeling of spaces in file names
varkey=`echo "$file" | tr " " "_"` varkey=`echo "$file" | tr " " "_"`

View File

@ -1,3 +0,0 @@
print -P "%F{yellow}The 'fedora' plugin is deprecated. Use the '%Udnf%u' plugin instead.%f"
source "$ZSH/plugins/dnf/dnf.plugin.zsh"

View File

@ -0,0 +1 @@
../dnf/dnf.plugin.zsh

View File

@ -0,0 +1,15 @@
# git-remote-branch plugin
This plugin adds completion for [`grb`](https://github.com/webmat/git_remote_branch),
or `git_remote_branch`.
To use it, add `git-remote-branch` to the plugins array of your zshrc file:
```zsh
plugins=(... git-remote-branch)
```
## Deprecation
[git_remote_branch was archived in 2018](https://github.com/webmat/git_remote_branch#archived),
meaning it's not actively maintained anymore. Use at your own risk.

View File

@ -0,0 +1,19 @@
_git_remote_branch() {
ref=$(git symbolic-ref HEAD 2> /dev/null)
if [[ -n $ref ]]; then
if (( CURRENT == 2 )); then
# first arg: operation
compadd create publish rename delete track
elif (( CURRENT == 3 )); then
# second arg: remote branch name
remotes=`git remote | tr '\n' '|' | sed "s/\|$//g"`
compadd `git branch -r | grep -v HEAD | sed "s/$remotes\///" | sed "s/ //g"`
elif (( CURRENT == 4 )); then
# third arg: remote name
compadd `git remote`
fi
else;
_files
fi
}
compdef _git_remote_branch grb

View File

@ -1,3 +0,0 @@
print -P "%F{yellow}The 'go' plugin is deprecated. Use the '%Ugolang%u' plugin instead.%f"
source "$ZSH/plugins/golang/golang.plugin.zsh"

1
plugins/go/go.plugin.zsh Symbolic link
View File

@ -0,0 +1 @@
../golang/golang.plugin.zsh

View File

@ -1,4 +1,4 @@
jenvdirs=("$HOME/.jenv" "/usr/local/bin/jenv" "/usr/local/jenv" "/opt/jenv") jenvdirs=("$HOME/.jenv" "/usr/local" "/usr/local/jenv" "/opt/jenv")
FOUND_JENV=0 FOUND_JENV=0
for jenvdir in $jenvdirs; do for jenvdir in $jenvdirs; do

View File

@ -1,9 +1,7 @@
(( $+commands[keychain] )) || return
# Define SHORT_HOST if not defined (%m = host name up to first .) # Define SHORT_HOST if not defined (%m = host name up to first .)
SHORT_HOST=${SHORT_HOST:-${(%):-%m}} SHORT_HOST=${SHORT_HOST:-${(%):-%m}}
function { function _start_agent() {
local agents local agents
local -a identities local -a identities
local -a options local -a options
@ -30,3 +28,8 @@ function {
[ -f "$_keychain_env_sh" ] && . "$_keychain_env_sh" [ -f "$_keychain_env_sh" ] && . "$_keychain_env_sh"
[ -f "$_keychain_env_sh_gpg" ] && . "$_keychain_env_sh_gpg" [ -f "$_keychain_env_sh_gpg" ] && . "$_keychain_env_sh_gpg"
} }
_start_agent
# tidy up after ourselves
unfunction _start_agent

5
plugins/nyan/README.md Normal file
View File

@ -0,0 +1,5 @@
# Nyan plugin
This plugin adds a command to display [Nyan Cat](https://en.wikipedia.org/wiki/Nyan_Cat) right inside your terminal.
**Plugin is deprecated**. Check [official repo](https://github.com/klange/nyancat) for more information.

View File

@ -0,0 +1,10 @@
print -Pn '%F{yellow}'
cat >&2 <<-EOD
nyan plugin:
The nyancat server used by this plugin was shut down due to increased
bandwidth costs, so the nyan plugin no longer works. You can get the
same functionality in some distributions by installing the nyancat package,
or you can compile it yourself.
See https://github.com/klange/nyancat for more information.
EOD
print -Pn '%f'

View File

@ -6,9 +6,9 @@
# REQUIRE: ack # REQUIRE: ack
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
if (( ! $+commands[ack] )); then if [ ! -x $(which ack) ]; then
echo "'ack' is not installed!" echo \'ack\' is not installed!
return exit -1
fi fi
ajs() { ajs() {

View File

@ -1,4 +1,2 @@
(( $+commands[stack] )) || return
autoload -U +X bashcompinit && bashcompinit autoload -U +X bashcompinit && bashcompinit
source <(stack --bash-completion-script stack) source <(stack --bash-completion-script stack)

View File

@ -1,6 +1,6 @@
function { function {
# search in these locations for the init script: # search in these locations for the init script:
for virtualenvwrapper in $commands[virtualenvwrapper_lazy.sh] \ for f in $commands[virtualenvwrapper_lazy.sh] \
$commands[virtualenvwrapper.sh] \ $commands[virtualenvwrapper.sh] \
/usr/share/virtualenvwrapper/virtualenvwrapper{_lazy,}.sh \ /usr/share/virtualenvwrapper/virtualenvwrapper{_lazy,}.sh \
/usr/local/bin/virtualenvwrapper{_lazy,}.sh \ /usr/local/bin/virtualenvwrapper{_lazy,}.sh \
@ -8,17 +8,16 @@ function {
/usr/share/bash-completion/completions/virtualenvwrapper \ /usr/share/bash-completion/completions/virtualenvwrapper \
$HOME/.local/bin/virtualenvwrapper.sh $HOME/.local/bin/virtualenvwrapper.sh
do do
if [[ -f "$virtualenvwrapper" ]]; then if [[ -f $f ]]; then
source "$virtualenvwrapper" source $f
return return
fi fi
done done
print "[oh-my-zsh] virtualenvwrapper plugin: Cannot find virtualenvwrapper.sh.\n"\ print "[oh-my-zsh] virtualenvwrapper plugin: Cannot find virtualenvwrapper.sh.\n"\
"Please install with \`pip install virtualenvwrapper\`" >&2 "Please install with \`pip install virtualenvwrapper\`" >&2
return 1
} }
if [[ $? -eq 0 ]] && ! type workon &>/dev/null; then if ! type workon &>/dev/null; then
print "[oh-my-zsh] virtualenvwrapper plugin: shell function 'workon' not defined.\n"\ print "[oh-my-zsh] virtualenvwrapper plugin: shell function 'workon' not defined.\n"\
"Please check ${virtualenvwrapper}" >&2 "Please check ${virtualenvwrapper}" >&2
return return