mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-08 21:28:24 +08:00
Compare commits
5 Commits
b9be3a43b4
...
65a1e4edbe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65a1e4edbe | ||
|
|
c7c0a8917b | ||
|
|
34cd8fbd4a | ||
|
|
08d5c936c6 | ||
|
|
52e848ce8f |
@ -10,7 +10,10 @@ plugins=(... brew)
|
||||
|
||||
## Shellenv
|
||||
|
||||
This plugin also executes `brew shellenv` at plugin load to set up many useful variables, such as `HOMEBREW_PREFIX` or `HOMEBREW_REPOSITORY`.
|
||||
If `brew` is not found in the PATH, this plugin will attempt to find it in common
|
||||
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
|
||||
|
||||
|
||||
@ -10,18 +10,21 @@ if (( ! $+commands[brew] )); then
|
||||
else
|
||||
return
|
||||
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
|
||||
|
||||
if [[ -z "$HOMEBREW_PREFIX" ]]; then
|
||||
if [[ -z $BREW_LOCATION ]]; then
|
||||
eval "$(brew shellenv)"
|
||||
else
|
||||
eval "$("$BREW_LOCATION" shellenv)"
|
||||
fi
|
||||
# Maintain compatability with potential custom user profiles, where we had
|
||||
# previously relied on always sourcing shellenv. OMZ plugins should not rely
|
||||
# on this to be defined due to out of order processing.
|
||||
export HOMEBREW_PREFIX="$(brew --prefix)"
|
||||
fi
|
||||
|
||||
unset BREW_LOCATION
|
||||
|
||||
alias bcubc='brew upgrade --cask && brew cleanup'
|
||||
alias bcubo='brew update && brew outdated --cask'
|
||||
alias brewp='brew pin'
|
||||
|
||||
@ -13,12 +13,11 @@ ZSH_THEME_FOSSIL_PROMPT_DIRTY=" %{$fg_bold[red]%}✖"
|
||||
ZSH_THEME_FOSSIL_PROMPT_CLEAN=" %{$fg_bold[green]%}✔"
|
||||
|
||||
function fossil_prompt_info() {
|
||||
local info=$(fossil branch 2>&1)
|
||||
local branch=$(fossil branch current 2>&1)
|
||||
|
||||
# if we're not in a fossil repo, don't show anything
|
||||
! command grep -q "use --repo" <<< "$info" || return
|
||||
! command grep -q "use --repo" <<< "$branch" || return
|
||||
|
||||
local branch=$(echo $info | grep "* " | sed 's/* //g')
|
||||
local changes=$(fossil changes)
|
||||
local dirty="$ZSH_THEME_FOSSIL_PROMPT_CLEAN"
|
||||
|
||||
|
||||
@ -28,6 +28,7 @@ function git-fetch-all {
|
||||
# Fetch all remotes (avoid ssh passphrase prompt)
|
||||
date -R &>! "$gitdir/FETCH_LOG"
|
||||
GIT_SSH_COMMAND="command ssh -o BatchMode=yes" \
|
||||
GIT_TERMINAL_PROMPT=0 \
|
||||
command git fetch --all 2>/dev/null &>> "$gitdir/FETCH_LOG"
|
||||
) &|
|
||||
}
|
||||
|
||||
@ -25,9 +25,10 @@ $ google oh-my-zsh
|
||||
Available search contexts are:
|
||||
|
||||
| Context | URL |
|
||||
|-----------------------|------------------------------------------|
|
||||
| --------------------- | ---------------------------------------- |
|
||||
| `bing` | `https://www.bing.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=` |
|
||||
| `ddg` or `duckduckgo` | `https://www.duckduckgo.com/?q=` |
|
||||
| `sp` or `startpage` | `https://www.startpage.com/do/search?q=` |
|
||||
|
||||
@ -7,22 +7,23 @@ function web_search() {
|
||||
typeset -A urls
|
||||
urls=(
|
||||
$ZSH_WEB_SEARCH_ENGINES
|
||||
google "https://www.google.com/search?q="
|
||||
bing "https://www.bing.com/search?q="
|
||||
yahoo "https://search.yahoo.com/search?p="
|
||||
duckduckgo "https://www.duckduckgo.com/?q="
|
||||
startpage "https://www.startpage.com/do/search?q="
|
||||
yandex "https://yandex.ru/yandsearch?text="
|
||||
github "https://github.com/search?q="
|
||||
baidu "https://www.baidu.com/s?wd="
|
||||
ecosia "https://www.ecosia.org/search?q="
|
||||
goodreads "https://www.goodreads.com/search?q="
|
||||
qwant "https://www.qwant.com/?q="
|
||||
givero "https://www.givero.com/search?q="
|
||||
stackoverflow "https://stackoverflow.com/search?q="
|
||||
wolframalpha "https://www.wolframalpha.com/input/?i="
|
||||
archive "https://web.archive.org/web/*/"
|
||||
scholar "https://scholar.google.com/scholar?q="
|
||||
google "https://www.google.com/search?q="
|
||||
bing "https://www.bing.com/search?q="
|
||||
brave "https://search.brave.com/search?q="
|
||||
yahoo "https://search.yahoo.com/search?p="
|
||||
duckduckgo "https://www.duckduckgo.com/?q="
|
||||
startpage "https://www.startpage.com/do/search?q="
|
||||
yandex "https://yandex.ru/yandsearch?text="
|
||||
github "https://github.com/search?q="
|
||||
baidu "https://www.baidu.com/s?wd="
|
||||
ecosia "https://www.ecosia.org/search?q="
|
||||
goodreads "https://www.goodreads.com/search?q="
|
||||
qwant "https://www.qwant.com/?q="
|
||||
givero "https://www.givero.com/search?q="
|
||||
stackoverflow "https://stackoverflow.com/search?q="
|
||||
wolframalpha "https://www.wolframalpha.com/input/?i="
|
||||
archive "https://web.archive.org/web/*/"
|
||||
scholar "https://scholar.google.com/scholar?q="
|
||||
)
|
||||
|
||||
# check whether the search engine is supported
|
||||
@ -47,6 +48,7 @@ function web_search() {
|
||||
|
||||
|
||||
alias bing='web_search bing'
|
||||
alias brs='web_search brave'
|
||||
alias google='web_search google'
|
||||
alias yahoo='web_search yahoo'
|
||||
alias ddg='web_search duckduckgo'
|
||||
|
||||
@ -273,7 +273,7 @@ setup_ohmyzsh() {
|
||||
}
|
||||
|
||||
ostype=$(uname)
|
||||
if [ -z "${ostype%CYGWIN*}" ] && git --version | grep -q msysgit; then
|
||||
if [ -z "${ostype%CYGWIN*}" ] && git --version | grep -Eq 'msysgit|windows'; then
|
||||
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"
|
||||
exit 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user