update zsh configs

This commit is contained in:
arcan1s
2014-10-01 03:06:54 +04:00
parent 1de4975b7f
commit d3da6a556c
3 changed files with 20 additions and 20 deletions

View File

@ -77,7 +77,7 @@ setopt autocd
# correct
setopt CORRECT_ALL
SPROMPT="Correct '%R' to '%r' ? ([Y]es/[N]o/[E]dit/[A]bort) "
SPROMPT="Correct '%R' to '%r' ? (nyae) "
# append history
setopt APPEND_HISTORY
@ -121,7 +121,7 @@ else
%{$fg_bold[yellow]%}%1/%{$reset_color%}\
%{$fg_bold[white]%}]$ %{$reset_color%}"
fi
precmd () {
precmd() {
# battery charge
function batcharge {
bat_perc=$((($(cat /sys/class/power_supply/BAT0/capacity)+$(cat /sys/class/power_supply/BAT1/capacity))/2))
@ -146,13 +146,7 @@ $(batcharge)\
$returncode\
"%{$fg_bold[white]%}]%{$reset_color%}"
}
# right prompt with time
#RPROMPT=$'%{\e[1;37m%}%T, %D%{\e[0m%}'
show_which() {
OUTPUT=$(which $1 | cut -d " " -f7-)
echo "Running '$OUTPUT'" 1>&2
}
## alias
alias grep='grep --colour=auto'
alias top='htop'
@ -162,7 +156,7 @@ alias less='vimpager'
alias zless='vimpager'
rm() {
# error check
[ $# -eq 0 ] && { echo "Files are not set!"; return 1 }
[ $# -eq 0 ] && { echo "Files are not set"; return 1 }
echo "$@" | grep -qe '-h\|--help' && { echo "Usage: rm FILE..."; return 0 }
echo "$@" | grep -q "-" && echo "Warning: this function doesn't support any flags"
# set trash path
@ -178,7 +172,7 @@ rm() {
done
# confirm
CONFIRM=""
echo -n "You realy want to remove '$@'? [y/n] "; read -k1 CONFIRM; echo
echo -n "Do you realy want to remove '$@'? [ny] "; read -k1 CONFIRM; echo
[[ ! $CONFIRM =~ [yY] ]] && return 1
# move
for FILE in "$@"; do