mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-26 01:57:26 +08:00
Compare commits
No commits in common. "65a1e4edbe678cdac37ad96ca4bc4f6d77e27adf" and "b9be3a43b4da579299b4426b1ba9121f746e2555" have entirely different histories.
65a1e4edbe
...
b9be3a43b4
@ -10,10 +10,7 @@ plugins=(... brew)
|
|||||||
|
|
||||||
## Shellenv
|
## Shellenv
|
||||||
|
|
||||||
If `brew` is not found in the PATH, this plugin will attempt to find it in common
|
This plugin also executes `brew shellenv` at plugin load to set up many useful variables, such as `HOMEBREW_PREFIX` or `HOMEBREW_REPOSITORY`.
|
||||||
locations, and execute `brew shellenv` to set the environment appropriately.
|
|
||||||
This plugin will also export `HOMEBREW_PREFIX="$(brew --prefix)"` if not previously
|
|
||||||
defined for convenience.
|
|
||||||
|
|
||||||
## Aliases
|
## Aliases
|
||||||
|
|
||||||
|
|||||||
@ -10,21 +10,18 @@ if (( ! $+commands[brew] )); then
|
|||||||
else
|
else
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Only add Homebrew installation to PATH, MANPATH, and INFOPATH if brew is
|
|
||||||
# not already on the path, to prevent duplicate entries. This aligns with
|
|
||||||
# the behavior of the brew installer.sh post-install steps.
|
|
||||||
eval "$("$BREW_LOCATION" shellenv)"
|
|
||||||
unset BREW_LOCATION
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "$HOMEBREW_PREFIX" ]]; then
|
if [[ -z "$HOMEBREW_PREFIX" ]]; then
|
||||||
# Maintain compatability with potential custom user profiles, where we had
|
if [[ -z $BREW_LOCATION ]]; then
|
||||||
# previously relied on always sourcing shellenv. OMZ plugins should not rely
|
eval "$(brew shellenv)"
|
||||||
# on this to be defined due to out of order processing.
|
else
|
||||||
export HOMEBREW_PREFIX="$(brew --prefix)"
|
eval "$("$BREW_LOCATION" shellenv)"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
unset BREW_LOCATION
|
||||||
|
|
||||||
alias bcubc='brew upgrade --cask && brew cleanup'
|
alias bcubc='brew upgrade --cask && brew cleanup'
|
||||||
alias bcubo='brew update && brew outdated --cask'
|
alias bcubo='brew update && brew outdated --cask'
|
||||||
alias brewp='brew pin'
|
alias brewp='brew pin'
|
||||||
|
|||||||
@ -13,11 +13,12 @@ ZSH_THEME_FOSSIL_PROMPT_DIRTY=" %{$fg_bold[red]%}✖"
|
|||||||
ZSH_THEME_FOSSIL_PROMPT_CLEAN=" %{$fg_bold[green]%}✔"
|
ZSH_THEME_FOSSIL_PROMPT_CLEAN=" %{$fg_bold[green]%}✔"
|
||||||
|
|
||||||
function fossil_prompt_info() {
|
function fossil_prompt_info() {
|
||||||
local branch=$(fossil branch current 2>&1)
|
local info=$(fossil branch 2>&1)
|
||||||
|
|
||||||
# if we're not in a fossil repo, don't show anything
|
# if we're not in a fossil repo, don't show anything
|
||||||
! command grep -q "use --repo" <<< "$branch" || return
|
! command grep -q "use --repo" <<< "$info" || return
|
||||||
|
|
||||||
|
local branch=$(echo $info | grep "* " | sed 's/* //g')
|
||||||
local changes=$(fossil changes)
|
local changes=$(fossil changes)
|
||||||
local dirty="$ZSH_THEME_FOSSIL_PROMPT_CLEAN"
|
local dirty="$ZSH_THEME_FOSSIL_PROMPT_CLEAN"
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,6 @@ function git-fetch-all {
|
|||||||
# Fetch all remotes (avoid ssh passphrase prompt)
|
# Fetch all remotes (avoid ssh passphrase prompt)
|
||||||
date -R &>! "$gitdir/FETCH_LOG"
|
date -R &>! "$gitdir/FETCH_LOG"
|
||||||
GIT_SSH_COMMAND="command ssh -o BatchMode=yes" \
|
GIT_SSH_COMMAND="command ssh -o BatchMode=yes" \
|
||||||
GIT_TERMINAL_PROMPT=0 \
|
|
||||||
command git fetch --all 2>/dev/null &>> "$gitdir/FETCH_LOG"
|
command git fetch --all 2>/dev/null &>> "$gitdir/FETCH_LOG"
|
||||||
) &|
|
) &|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,10 +25,9 @@ $ google oh-my-zsh
|
|||||||
Available search contexts are:
|
Available search contexts are:
|
||||||
|
|
||||||
| Context | URL |
|
| Context | URL |
|
||||||
| --------------------- | ---------------------------------------- |
|
|-----------------------|------------------------------------------|
|
||||||
| `bing` | `https://www.bing.com/search?q=` |
|
| `bing` | `https://www.bing.com/search?q=` |
|
||||||
| `google` | `https://www.google.com/search?q=` |
|
| `google` | `https://www.google.com/search?q=` |
|
||||||
| `brs` or `brave` | `https://search.brave.com/search?q=` |
|
|
||||||
| `yahoo` | `https://search.yahoo.com/search?p=` |
|
| `yahoo` | `https://search.yahoo.com/search?p=` |
|
||||||
| `ddg` or `duckduckgo` | `https://www.duckduckgo.com/?q=` |
|
| `ddg` or `duckduckgo` | `https://www.duckduckgo.com/?q=` |
|
||||||
| `sp` or `startpage` | `https://www.startpage.com/do/search?q=` |
|
| `sp` or `startpage` | `https://www.startpage.com/do/search?q=` |
|
||||||
|
|||||||
@ -9,7 +9,6 @@ function web_search() {
|
|||||||
$ZSH_WEB_SEARCH_ENGINES
|
$ZSH_WEB_SEARCH_ENGINES
|
||||||
google "https://www.google.com/search?q="
|
google "https://www.google.com/search?q="
|
||||||
bing "https://www.bing.com/search?q="
|
bing "https://www.bing.com/search?q="
|
||||||
brave "https://search.brave.com/search?q="
|
|
||||||
yahoo "https://search.yahoo.com/search?p="
|
yahoo "https://search.yahoo.com/search?p="
|
||||||
duckduckgo "https://www.duckduckgo.com/?q="
|
duckduckgo "https://www.duckduckgo.com/?q="
|
||||||
startpage "https://www.startpage.com/do/search?q="
|
startpage "https://www.startpage.com/do/search?q="
|
||||||
@ -48,7 +47,6 @@ function web_search() {
|
|||||||
|
|
||||||
|
|
||||||
alias bing='web_search bing'
|
alias bing='web_search bing'
|
||||||
alias brs='web_search brave'
|
|
||||||
alias google='web_search google'
|
alias google='web_search google'
|
||||||
alias yahoo='web_search yahoo'
|
alias yahoo='web_search yahoo'
|
||||||
alias ddg='web_search duckduckgo'
|
alias ddg='web_search duckduckgo'
|
||||||
|
|||||||
@ -273,7 +273,7 @@ setup_ohmyzsh() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ostype=$(uname)
|
ostype=$(uname)
|
||||||
if [ -z "${ostype%CYGWIN*}" ] && git --version | grep -Eq 'msysgit|windows'; then
|
if [ -z "${ostype%CYGWIN*}" ] && git --version | grep -q msysgit; then
|
||||||
fmt_error "Windows/MSYS Git is not supported on Cygwin"
|
fmt_error "Windows/MSYS Git is not supported on Cygwin"
|
||||||
fmt_error "Make sure the Cygwin git package is installed and is first on the \$PATH"
|
fmt_error "Make sure the Cygwin git package is installed and is first on the \$PATH"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user