X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=be62172c40d9a54e25a461adb095108715442900;hb=e3f3b08c2e641279e80235e739c3136d8cccac49;hp=bf6a90264446fe60b2b8450ac7e0e8d657c3ede1;hpb=b9a705677f13f26dde24e938c98314271e6cba27;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index bf6a902..be62172 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -506,6 +506,7 @@ xcat() { xunfunction() { emulate -L zsh local -a funcs + local func funcs=(salias xcat xsource xunfunction zrcautoload zrcautozle) for func in $funcs ; do [[ -n ${functions[$func]} ]] \ @@ -530,6 +531,7 @@ fi for var in LANG LC_ALL LC_MESSAGES ; do [[ -n ${(P)var} ]] && export $var done +builtin unset -v var # set some variables if check_com -c vim ; then @@ -606,7 +608,7 @@ typeset -U path cdpath fpath manpath is4 && \ for mod in parameter complist deltochar mathfunc ; do zmodload -i zsh/${mod} 2>/dev/null || print "Notice: no ${mod} available :(" -done +done && builtin unset -v mod # autoload zsh modules when they are referenced if is4 ; then @@ -767,7 +769,7 @@ grmlcomp() { # host completion if is42 ; then - [[ -r ~/.ssh/config ]] && _ssh_config_hosts=(${${${(@M)${(f)"$(<$HOME/.ssh/config)"}:#Host *}#Host }:#*[*?]*}) || _ssh_config_hosts=() + [[ -r ~/.ssh/config ]] && _ssh_config_hosts=(${${(s: :)${(ps:\t:)${${(@M)${(f)"$(<$HOME/.ssh/config)"}:#Host *}#Host }}}:#*[*?]*}) || _ssh_config_hosts=() [[ -r ~/.ssh/known_hosts ]] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() [[ -r /etc/hosts ]] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$( 0 )); then fi # Translate DE<=>EN -# 'translate' looks up fot a word in a file with language-to-language +# 'translate' looks up a word in a file with language-to-language # translations (field separator should be " : "). A typical wordlist looks -# like at follows: -# | english-word : german-transmission +# like the following: +# | english-word : german-translation # It's also only possible to translate english to german but not reciprocal. -# Use the following oneliner to turn back the sort order: +# Use the following oneliner to reverse the sort order: # $ awk -F ':' '{ print $2" : "$1" "$3 }' \ # /usr/local/lib/words/en-de.ISO-8859-1.vok > ~/.translate/de-en.ISO-8859-1.vok #f5# Translates a word @@ -3196,7 +3204,7 @@ trans() { simple-extract() { emulate -L zsh setopt extended_glob noclobber - local DELETE_ORIGINAL DECOMP_CMD USES_STDIN USES_STDOUT GZTARGET WGET_CMD + local ARCHIVE DELETE_ORIGINAL DECOMP_CMD USES_STDIN USES_STDOUT GZTARGET WGET_CMD local RC=0 zparseopts -D -E "d=DELETE_ORIGINAL" for ARCHIVE in "${@}"; do @@ -3295,9 +3303,9 @@ simple-extract() { elif [[ "$ARCHIVE" == (#s)(https|http|ftp)://* ]] ; then if check_com curl; then - WGET_CMD="curl -L -k -s -o -" + WGET_CMD="curl -L -s -o -" elif check_com wget; then - WGET_CMD="wget -q -O - --no-check-certificate" + WGET_CMD="wget -q -O -" else print "ERROR: neither wget nor curl is installed" >&2 RC=$((RC+4)) @@ -3477,6 +3485,7 @@ if check_com -c hg ; then #f5# GNU like diff for mercurial hgdi() { emulate -L zsh + local i for i in $(hg status -marn "$@") ; diff -ubwd <(hg cat "$i") "$i" }