From 0f258b3509c2d5c097e3ca051f8e9b233cb5cd0d Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 13 Apr 2007 17:36:19 +0200 Subject: [PATCH] /etc/zsh/zshrc: generic file completion, function sll --- debian/changelog | 9 +++++++++ etc/zsh/zshrc | 24 +++++++++++++++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 853f5bb..3ce6b17 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +grml-etc-core (0.2.43) unstable; urgency=low + + * /etc/zsh/zshrc: + - applied patch by ft for generic file completion (thanks!) + - added function sll (list symlinks in more details), thanks + for the code base, Manuel Fuhr! + + -- Michael Prokop Fri, 13 Apr 2007 17:35:15 +0200 + grml-etc-core (0.2.42) unstable; urgency=low * Update and cleanup /etc/apt/sources.list.grml. Thanks for hints, diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index a9fe3ce..153f61d 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -810,20 +810,20 @@ grmlcomp() { } # some people don't like the automatic correction - so run 'NOCOR=1 zsh' to deactivate it if [[ -n "$NOCOR" ]] ; then - zstyle ':completion:*' completer _oldlist _expand _force_rehash _complete + zstyle ':completion:*' completer _oldlist _expand _force_rehash _complete _files setopt nocorrect # do not try to correct the spelling if possible else -# zstyle ':completion:*' completer _oldlist _expand _force_rehash _complete _correct _approximate +# zstyle ':completion:*' completer _oldlist _expand _force_rehash _complete _correct _approximate _files setopt correct # try to correct the spelling if possible zstyle -e ':completion:*' completer ' if [[ $_last_try != "$HISTNO$BUFFER$CURSOR" ]]; then _last_try="$HISTNO$BUFFER$CURSOR" - reply=(_complete _match _prefix) + reply=(_complete _match _prefix _files) else if [[ $words[1] = (rm|mv) ]]; then - reply=(_complete) + reply=(_complete _files) else - reply=(_oldlist _expand _force_rehash _complete _correct _approximate) + reply=(_oldlist _expand _force_rehash _complete _correct _approximate _files) fi fi' fi @@ -974,6 +974,20 @@ If you want to use xinit anyway please call \"/usr/bin/xinit\"." } compdef _functions reload freload + # list symlinks in detail (more detailed version of 'readlinkg -f') + sll() { + if [ -z "$1" ] ; then + print 'Usage: sll ' >&2 + return 1 + fi + for i in $* ; do + ls --color=auto -la "$i" + if [ -L "$i" ] ; then + sll $(readlink "$i") + fi + done + } + # fast manual access if type -p qma &>/dev/null ; then manzsh() { qma zshall "$1" } -- 2.1.4