Merge branch 'master' of https://github.com/sorin-ionescu/prezto into patch-1

This commit is contained in:
arshavindn 2018-09-17 13:36:56 +07:00
commit f68f659c4a
3 changed files with 47 additions and 13 deletions

View file

@ -212,12 +212,19 @@ function git-info {
# Format stashed. # Format stashed.
zstyle -s ':prezto:module:git:info:stashed' format 'stashed_format' zstyle -s ':prezto:module:git:info:stashed' format 'stashed_format'
if [[ -n "$stashed_format" && -f "$(git-dir)/refs/stash" ]]; then if [[ -n "$stashed_format" ]]; then
commondir=""
if [[ -f "$(git-dir)/commondir" ]]; then
commondir="$(<$(git-dir)/commondir)"
[[ "$commondir" =~ ^/ ]] || commondir="$(git-dir)/$commondir"
fi
if [[ -f "$(git-dir)/refs/stash" || ( -n "$commondir" && -f "$commondir/refs/stash" ) ]]; then
stashed="$(command git stash list 2> /dev/null | wc -l | awk '{print $1}')" stashed="$(command git stash list 2> /dev/null | wc -l | awk '{print $1}')"
if [[ -n "$stashed" ]]; then if [[ -n "$stashed" ]]; then
zformat -f stashed_formatted "$stashed_format" "S:$stashed" zformat -f stashed_formatted "$stashed_format" "S:$stashed"
fi fi
fi fi
fi
# Format action. # Format action.
zstyle -s ':prezto:module:git:info:action' format 'action_format' zstyle -s ':prezto:module:git:info:action' format 'action_format'

View file

@ -1,7 +1,16 @@
Homebrew Homebrew
======== ========
Defines Homebrew aliases. Defines Homebrew specific shell environment variables and aliases.
Environment Variables
---------------------
Execute the following to list the environment variables loaded in the shell:
```sh
brew shellenv
```
Aliases Aliases
------- -------
@ -20,12 +29,9 @@ Aliases
### Homebrew Cask ### Homebrew Cask
- `cask` is aliased to `brew cask`. - `cask` is aliased to `brew cask`.
- `caskc` cleans up old cached downloads.
- `caskC` cleans up all cached downloads.
- `caski` installs a cask. - `caski` installs a cask.
- `caskl` lists installed casks. - `caskl` lists installed casks.
- `casko` lists casks which have an update available. - `casko` lists casks which have an update available.
- `casks` searches for a cask.
- `caskx` uninstalls a cask. - `caskx` uninstalls a cask.
Authors Authors

View file

@ -10,6 +10,16 @@ if [[ "$OSTYPE" != (darwin|linux)* ]]; then
return 1 return 1
fi fi
#
# Environmental Variables
#
# Load standard Homebrew shellenv into the shell session.
# `brew shellenv` is relatively new, guard for legacy Homebrew.
if (( $+commands[brew] )); then
eval "$(brew shellenv 2> /dev/null)"
fi
# #
# Aliases # Aliases
# #
@ -21,15 +31,26 @@ alias brewi='brew install'
alias brewl='brew list' alias brewl='brew list'
alias brewo='brew outdated' alias brewo='brew outdated'
alias brews='brew search' alias brews='brew search'
alias brewu='brew update && brew upgrade' alias brewu='brew upgrade'
alias brewx='brew remove' alias brewx='brew uninstall'
# Homebrew Cask # Homebrew Cask
alias cask='brew cask' alias cask='brew cask'
alias caskc='brew cask cleanup --outdated' alias caskc='hb_deprecated brew cask cleanup'
alias caskC='brew cask cleanup' alias caskC='hb_deprecated brew cask cleanup'
alias caski='brew cask install' alias caski='brew cask install'
alias caskl='brew cask list' alias caskl='brew cask list'
alias casko='brew cask outdated' alias casko='brew cask outdated'
alias casks='brew cask search' alias casks='hb_deprecated brew cask search'
alias caskx='brew cask uninstall' alias caskx='brew cask uninstall'
function hb_deprecated {
local cmd="${argv[3]}"
local cmd_args=( ${(@)argv:4} )
printf "'brew cask %s' has been deprecated, " "${cmd}"
printf "using 'brew %s' instead\n" "${cmd}"
cmd_args=( ${(@)argv:4} )
command brew "${cmd}" ${(@)cmd_args}
}