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

16
zshrc
View File

@ -77,7 +77,7 @@ setopt autocd
# correct # correct
setopt CORRECT_ALL setopt CORRECT_ALL
SPROMPT="Correct '%R' to '%r' ? ([Y]es/[N]o/[E]dit/[A]bort) " SPROMPT="Correct '%R' to '%r' ? (nyae) "
# append history # append history
setopt APPEND_HISTORY setopt APPEND_HISTORY
@ -146,8 +146,6 @@ $(batcharge)\
$returncode\ $returncode\
"%{$fg_bold[white]%}]%{$reset_color%}" "%{$fg_bold[white]%}]%{$reset_color%}"
} }
# right prompt with time
#RPROMPT=$'%{\e[1;37m%}%T, %D%{\e[0m%}'
show_which() { show_which() {
OUTPUT=$(which $1 | cut -d " " -f7-) OUTPUT=$(which $1 | cut -d " " -f7-)
@ -165,7 +163,7 @@ alias less='vimpager'
alias zless='vimpager' alias zless='vimpager'
rm() { rm() {
# error check # 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 -qe '-h\|--help' && { echo "Usage: rm FILE..."; return 0 }
echo "$@" | grep -q "-" && echo "Warning: this function doesn't support any flags" echo "$@" | grep -q "-" && echo "Warning: this function doesn't support any flags"
# set trash path # set trash path
@ -181,7 +179,7 @@ rm() {
done done
# confirm # confirm
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 [[ ! $CONFIRM =~ [yY] ]] && return 1
# move # move
for FILE in "$@"; do for FILE in "$@"; do
@ -370,6 +368,8 @@ else
alias pacdiff='sudo pacdiff' alias pacdiff='sudo pacdiff'
alias staging-i686-build='sudo staging-i686-build' alias staging-i686-build='sudo staging-i686-build'
alias staging-x86_64-build='sudo staging-x86_64-build' alias staging-x86_64-build='sudo staging-x86_64-build'
alias extra-i686-build='sudo extra-i686-build'
alias extra-x86_64-build='sudo extra-x86_64-build'
alias multilib-staging-build='sudo multilib-staging-build' alias multilib-staging-build='sudo multilib-staging-build'
alias backlight='sudo backlight' alias backlight='sudo backlight'
alias cpu='sudo cpu' alias cpu='sudo cpu'
@ -413,3 +413,9 @@ export GCC_COLOR="auto"
# fix urxvt # fix urxvt
if [[ ${TERM} =~ "rxvt-unicode-*" ]] export TERM="xterm" if [[ ${TERM} =~ "rxvt-unicode-*" ]] export TERM="xterm"
# ssh-agent
if [[ $EUID != 0 ]]; then
eval $(ssh-agent) > /dev/null
ssh-add -l > /dev/null || alias ssh='ssh-add -l >/dev/null || ssh-add && unalias ssh; ssh'
fi

View File

@ -77,7 +77,7 @@ setopt autocd
# correct # correct
setopt CORRECT_ALL setopt CORRECT_ALL
SPROMPT="Correct '%R' to '%r' ? ([Y]es/[N]o/[E]dit/[A]bort) " SPROMPT="Correct '%R' to '%r' ? (nyae) "
# append history # append history
setopt APPEND_HISTORY setopt APPEND_HISTORY
@ -140,7 +140,7 @@ alias less='vimpager'
alias zless='vimpager' alias zless='vimpager'
rm() { rm() {
# error check # 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 -qe '-h\|--help' && { echo "Usage: rm FILE..."; return 0 }
echo "$@" | grep -q "-" && echo "Warning: this function doesn't support any flags" echo "$@" | grep -q "-" && echo "Warning: this function doesn't support any flags"
# set trash path # set trash path
@ -156,7 +156,7 @@ rm() {
done done
# confirm # confirm
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 [[ ! $CONFIRM =~ [yY] ]] && return 1
# move # move
for FILE in "$@"; do for FILE in "$@"; do

View File

@ -77,7 +77,7 @@ setopt autocd
# correct # correct
setopt CORRECT_ALL setopt CORRECT_ALL
SPROMPT="Correct '%R' to '%r' ? ([Y]es/[N]o/[E]dit/[A]bort) " SPROMPT="Correct '%R' to '%r' ? (nyae) "
# append history # append history
setopt APPEND_HISTORY setopt APPEND_HISTORY
@ -146,13 +146,7 @@ $(batcharge)\
$returncode\ $returncode\
"%{$fg_bold[white]%}]%{$reset_color%}" "%{$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
alias grep='grep --colour=auto' alias grep='grep --colour=auto'
alias top='htop' alias top='htop'
@ -162,7 +156,7 @@ alias less='vimpager'
alias zless='vimpager' alias zless='vimpager'
rm() { rm() {
# error check # 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 -qe '-h\|--help' && { echo "Usage: rm FILE..."; return 0 }
echo "$@" | grep -q "-" && echo "Warning: this function doesn't support any flags" echo "$@" | grep -q "-" && echo "Warning: this function doesn't support any flags"
# set trash path # set trash path
@ -178,7 +172,7 @@ rm() {
done done
# confirm # confirm
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 [[ ! $CONFIRM =~ [yY] ]] && return 1
# move # move
for FILE in "$@"; do for FILE in "$@"; do