X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=577c63f094b0ea96a513dfe37d836e0b8e5cbaa3;hb=96e953dc4fd26a05ad8811bf44a54bdf38edd968;hp=7874e221b5e990619cd352a0128a2ad8380a4826;hpb=3b7644286437411ebc63acb8f8e1a844a42f17a2;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 7874e22..577c63f 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -867,17 +867,9 @@ done # autoload zsh modules when they are referenced if is4 ; then - tmpargs=( - a stat - a zpty - ap mapfile - ) - - while (( ${#tmpargs} > 0 )) ; do - zmodload -${tmpargs[1]} zsh/${tmpargs[2]} ${tmpargs[2]} - shift 2 tmpargs - done - unset tmpargs + zmodload -a zsh/stat zstat + zmodload -a zsh/zpty zpty + zmodload -ap zsh/mapfile mapfile fi if is4 && zrcautoload insert-files && zle -N insert-files ; then @@ -3522,17 +3514,25 @@ regcheck() { pcre_match $2 && echo "regex matches" || echo "regex does not match" } +#f5# List files which have been accessed within the last {\it n} days, {\it n} defaults to 1 +accessed() { + emulate -L zsh + print -l -- *(a-${1:-1}) +} + #f5# List files which have been changed within the last {\it n} days, {\it n} defaults to 1 changed() { emulate -L zsh - print -l *(c-${1:1}) + print -l -- *(c-${1:-1}) } #f5# List files which have been modified within the last {\it n} days, {\it n} defaults to 1 -new() { +modified() { emulate -L zsh - print -l *(m-${1:1}) + print -l -- *(m-${1:-1}) } +# modified() was named new() in earlier versions, add an alias for backwards compatibility +check_com new || alias new=modified #f5# Grep in history greph() { @@ -3987,50 +3987,6 @@ getair() { [[ -x /usr/local/bin/air ]] && [[ -n "$DISPLAY" ]] && $SUDO air } -#f5# Get specific git commitdiff -git-get-diff() { - emulate -L zsh - if [[ -z $GITTREE ]] ; then - GITTREE='linux/kernel/git/torvalds/linux-2.6.git' - fi - if ! [[ -z $1 ]] ; then - ${=BROWSER} "http://kernel.org/git/?p=$GITTREE;a=commitdiff;h=$1" - else - echo "Usage: git-get-diff " - fi -} - -#f5# Get specific git commit -git-get-commit() { - emulate -L zsh - if [[ -z $GITTREE ]] ; then - GITTREE='linux/kernel/git/torvalds/linux-2.6.git' - fi - if ! [[ -z $1 ]] ; then - ${=BROWSER} "http://kernel.org/git/?p=$GITTREE;a=commit;h=$1" - else - echo "Usage: git-get-commit " - fi -} - -#f5# Get specific git diff -git-get-plaindiff () { - emulate -L zsh - if [[ -z $GITTREE ]] ; then - GITTREE='linux/kernel/git/torvalds/linux-2.6.git' - fi - if [[ -z $1 ]] ; then - echo 'Usage: git-get-plaindiff ' - else - echo -n "Downloading $1.diff ... " - # avoid "generating ..." stuff from kernel.org server: - wget --quiet "http://kernel.org/git/?p=$GITTREE;a=commitdiff_plain;h=$1" -O /dev/null - wget --quiet "http://kernel.org/git/?p=$GITTREE;a=commitdiff_plain;h=$1" -O $1.diff \ - && echo done || echo failed - fi -} - - # http://strcat.de/blog/index.php?/archives/335-Software-sauber-deinstallieren...html #f5# Log 'make install' output mmake() {