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

Compare commits

..

No commits in common. "d6474237b823448b3a1dd176a246ed73a30494f9" and "dbd16000a55f57e3f1a1fdc9557eacd5577a4afe" have entirely different histories.

5 changed files with 27 additions and 25 deletions

View File

@ -73,4 +73,4 @@ if [[ $COMPLETION_WAITING_DOTS = true ]]; then
fi
# automatically load bash completion functions
autoload -U +X bashcompinit && bashcompinit
autoload -Uz bashcompinit && bashcompinit

View File

@ -89,7 +89,7 @@ function default() {
# 0 if the env variable exists, 3 if it was set
#
function env_default() {
[[ ${parameters[$1]} = *-export* ]] && return 0
(( ${${(@f):-$(typeset +xg)}[(I)$1]} )) && return 0
export "$1=$2" && return 3
}

View File

@ -25,7 +25,7 @@ env_default 'LESS' '-R'
alias _='sudo '
## more intelligent acking for ubuntu users
if (( $+commands[ack-grep] )); then
if which ack-grep &> /dev/null; then
alias afind='ack-grep -il'
else
alias afind='ack -il'

View File

@ -1,3 +1,4 @@
#! /bin/zsh
# A script to make using 256 colors in zsh less painful.
# P.C. Shyamshankar <sykora@lucentbeing.com>
# Copied from https://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
@ -18,18 +19,19 @@ for color in {000..255}; do
BG[$color]="%{[48;5;${color}m%}"
done
ZSH_SPECTRUM_TEXT=${ZSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris}
# Show all 256 colors with color number
function spectrum_ls() {
local ZSH_SPECTRUM_TEXT=${ZSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris}
for code in {000..255}; do
print -P -- "$code: $FG[$code]$ZSH_SPECTRUM_TEXT%{$reset_color%}"
print -P -- "$code: %{$FG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}"
done
}
# Show all 256 colors where the background is set to specific color
function spectrum_bls() {
local ZSH_SPECTRUM_TEXT=${ZSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris}
for code in {000..255}; do
print -P -- "$code: $BG[$code]$ZSH_SPECTRUM_TEXT%{$reset_color%}"
print -P -- "$code: %{$BG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}"
done
}

View File

@ -175,7 +175,7 @@ function battery_level_gauge() {
local filled_symbol=${BATTERY_GAUGE_FILLED_SYMBOL:-'▶'}
local empty_symbol=${BATTERY_GAUGE_EMPTY_SYMBOL:-'▷'}
local charging_color=${BATTERY_CHARGING_COLOR:-$color_yellow}
local charging_symbol=${BATTERY_CHARGING_SYMBOL:-'⚡'}
local charging_symbol=${BATTERY_CHARGING_SYMBOL:-'%{%G%}'}
local battery_remaining_percentage=$(battery_pct)
local filled empty gauge_color