slim down zshrc

This commit is contained in:
2021-10-23 10:20:59 +02:00
parent 9406f66cf8
commit 2a387f8a1b

View File

@@ -19,7 +19,6 @@ setopt histignorealldups
setopt histignorespace setopt histignorespace
bindkey -e bindkey -e
bindkey "^r" history-incremental-search-backward
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init() { function zle-line-init() {
@@ -34,26 +33,10 @@ zle -N zle-line-init
zle -N zle-line-finish zle -N zle-line-finish
fi fi
if [[ "${terminfo[khome]}" != "" ]]; then [[ -n "${terminfo[khome]}" ]] && bindkey "${terminfo[khome]}" beginning-of-line
bindkey "${terminfo[khome]}" beginning-of-line [[ -n "${terminfo[kend]}" ]] && bindkey "${terminfo[kend]}" end-of-line
fi [[ -n "${terminfo[kcbt]}" ]] && bindkey "${terminfo[kcbt]}" reverse-menu-complete
[[ -n "${terminfo[kdch1]}" ]] && bindkey "${terminfo[kdch1]}" delete-char
if [[ "${terminfo[kend]}" != "" ]]; then
bindkey "${terminfo[kend]}" end-of-line
fi
if [[ "${terminfo[kcbt]}" != "" ]]; then
bindkey "${terminfo[kcbt]}" reverse-menu-complete
fi
if [[ "${terminfo[kdch1]}" != "" ]]; then
bindkey "${terminfo[kdch1]}" delete-char
else
# fallbacks
bindkey "^[[3~" delete-char
bindkey "^[3;5~" delete-char
bindkey "\e[3~" delete-char
fi
zstyle ':completion:*:commands' rehash 1 zstyle ':completion:*:commands' rehash 1
zstyle ':completion:*' completer _oldlist _expand _complete _files _ignored zstyle ':completion:*' completer _oldlist _expand _complete _files _ignored
@@ -89,42 +72,10 @@ preexec () {
print -Pn "\e]0;(%M) $1\a" print -Pn "\e]0;(%M) $1\a"
} }
alias :q="exit"
alias ..="cd .."
[[ -x /usr/bin/xdg-open ]] && alias open="xdg-open"
sshl() { sshl() {
ssh -N -L ${1}:localhost:${2} $3 ssh -N -L ${1}:localhost:${2} $3
} }
#toolbox() { alias :q="exit"
# if [[ $@ =~ (enter) && ! $@ =~ (-r|--release|-d|--distro) ]]; then alias ..="cd .."
# [[ -x /usr/bin/xdg-open ]] && alias open="xdg-open"
# CONTAINER=$(sed -E -e 's/enter|--container|-c|toolbox|\t|\n|\s//g' <<< $@)
#
# if [[ ! -z ${CONTAINER} && ${CONTAINER} =~ "^[a-zA-Z0-9-]{1,15}$" ]]; then
# command toolbox --container ${CONTAINER} run sudo hostname ${CONTAINER}
# command toolbox enter ${CONTAINER}
# else
# command toolbox enter
# fi
# else
# command toolbox $@
# fi
#}
dupfind() {
if [ $# -lt 1 ]; then
echo "Usage: $0 THREAD_COUNT [directory] ..." > /dev/stderr
fi
if ! [[ "$1" =~ ^[0-9]+$ ]]; then
echo "THREAD_COUNT needs to be an integer." > /dev/stderr
else
if [ $# -lt 2 ]; then
find . ! -empty -type f -print0 | xargs -0 -n1 -P${1} md5sum | sort | uniq -w32 -dD
else
find ${@:2:128} ! -empty -type f -print0 | xargs -0 -n1 -P${1} md5sum | sort | uniq -w32 -dD
fi
fi
}