From 8e1e7b4456ed6ef2faac654bb5de1e50f4098701 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 4 Jun 2007 00:56:23 +0200 Subject: [PATCH] Applied patch by Christian Schneider --- debian/changelog | 7 +++++++ zsh-lovers.1.txt | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 2c3cada..fb7edb3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +zsh-lovers (0.6-5) unstable; urgency=low + + * Applied patch by Christian Schneider which adds some more + examples (like 'autoload -U age' examples). Thanks! + + -- Michael Prokop Mon, 04 Jun 2007 00:55:43 +0200 + zsh-lovers (0.6-4) unstable; urgency=low * Cleanup of spaces at end of lines. diff --git a/zsh-lovers.1.txt b/zsh-lovers.1.txt index 4512dc3..fea037f 100644 --- a/zsh-lovers.1.txt +++ b/zsh-lovers.1.txt @@ -190,12 +190,29 @@ cd will never select the parent directory (e.g.: cd ../): zstyle ':completion:*:cd:*' ignore-parents parent pwd --------------------------------------------------------------------------------------------------- +Another method for 'quick change directories'. Add this to your ~/.zshrc, then just enter +``cd ..../dir'' +--------------------------------------------------------------------------------------------------- +rationalise-dot() { + if [[ $LBUFFER = *.. ]]; then + LBUFFER+=/.. + else + LBUFFER+=. + fi +} +zle -N rationalise-dot +bindkey . rationalise-dot +--------------------------------------------------------------------------------------------------- + UNSORTED/MISC examples ~~~~~~~~~~~~~~~~~~~~~~ Hint: A list of valid glob Qualifiers can be found in zshexpn(1). See ``man 1 zshexpn | less -p'' Qualifiers for details. ------------------------------------------------------------------------------- +# cat first line in all files in this dir + $ for file (*(ND-.)) IFS= read -re < $file + # test if a parameter is numeric $ if [[ $1 == <-> ]] ; then echo numeric @@ -665,7 +682,32 @@ Modifiers are a powerful mechanism that let you modify the results returned by parameter, filename and history expansion. See zshexpn(1) for details. ------------------------------------------------------------------------------- +<<<<<<< /home/dope/download/Source/HG-Repos/zsh-lovers/zsh-lovers.1.txt.orig.432616858 +# NOTE: Zsh 4.3.4 needed! +$ autoload -U age +# files modified today + $ print *(e:age today now:) +# files modified since 5 pm + $ print *(e-age 17:00 now-) +# ... since 5 o'clock yesterda + $ print *(e-age yesterday,17:00 now-) +# ... from last Christmas before today + $ print *(e-age 2006/12/25 today-) +# ... before yesterday + $ print *(e-age 1970/01/01 yesterday-) +# all files modified between the start of those dates + $ print *(e:age 2006/10/04 2006/10/09:) +# all files modified on that date + $ print *(e:age 2006/10/04:) +# Supply times. + $ print *(e-age 2006/10/04:10:15 2006/10/04:10:45-) + +# Remove a trailing pathname component, leaving the head. This works like +||||||| /tmp/zsh-lovers.1.txt~base.AvW_ZW +# Remove a trailing pathname component, leaving the head. This works like +======= # Remove a trailing pathname component, leaving the head. This works like +>>>>>>> /tmp/zsh-lovers.1.txt~other.vDaddL # `dirname'. $ echo =ls(:h) /bin @@ -988,6 +1030,10 @@ zsh/datetime (require zmodload zsh/datetime) zsh/stat (require zmodload zsh/stat) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------------------------------------------------------------------------- +# test if a symbolic link links to a certain file + $ zmodload -i zsh/stat + $ ! stat -LH s foo.ln || [[ $s[link] != "foo.exe" ]] || ln -sf foo.exe foo.ln + # comparing file dates $ zmodload zsh/stat $ file1=foo @@ -1440,7 +1486,8 @@ Manpages of zsh: zsh Zsh overview zshall Tthe Z shell meta-man page zshbuiltins Zsh built-in commands - zshcompctl Zsh completion control + zshcalsys zsh calendar system + zshcompctl zsh programmable completion zshcompsys Zsh completion system zshcompwid Zsh completion widgets zshcontrib User contributions to zsh -- 2.1.4