1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-08 21:28:24 +08:00

Compare commits

...

5 Commits

Author SHA1 Message Date
Marc Cornellà
65a1e4edbe
fix(installer): detect newer Git for Windows version errors (#11157)
Fixes #11157
2022-10-14 20:31:33 +02:00
tmoschou
c7c0a8917b
fix(brew): do not source brew shellenv if already on path (#11167) 2022-10-14 20:27:42 +02:00
Warren Young
34cd8fbd4a
refactor(fossil): use fossil branch current supported since v2.7 (#11138)
Using the automation-friendly "fossil branch current" feature added in
Fossil 2.7 instead of ad hoc parsing of human-readable "fossil branch"
output.  Not only does this fix a stray space in the output, it's more
robust against changes in command output in general.

Closes #11138
2022-10-14 20:15:50 +02:00
Syphdias
08d5c936c6
fix(git-auto-fetch): avoid password prompt with GIT_TERMINAL_PROMPT=0 (#11234) 2022-10-14 19:12:04 +02:00
Sibs
52e848ce8f
feat(web-search): add support for Brave search engine (#11106) 2022-10-14 19:07:26 +02:00
7 changed files with 38 additions and 29 deletions

View File

@ -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

View File

@ -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'

View File

@ -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"

View File

@ -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"
) &|
}

View File

@ -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=` |

View File

@ -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'

View File

@ -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