Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: cd ..<tab>?
- X-seq: zsh-users 4656
- From: Dennis Haney <davh@xxxxxxx>
- Subject: Re: cd ..<tab>?
- Date: Tue, 05 Feb 2002 19:26:36 +0100
- Cc: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20020129102017.E3A633FC1B@xxxxxxxxxxxxxxxxxx> <15446.30464.872842.207355@xxxxxxxxxxxxxxxxxx> <3C572BEB.2030001@xxxxxxx> <020129171248.ZM11938@xxxxxxxxxxxxxxxxxxxxxxx> <3C60140C.6020006@xxxxxxx> <1020205174636.ZM29789@xxxxxxxxxxxxxxxxxxxxxxx>
Bart Schaefer wrote:
On Feb 5, 6:19pm, Dennis Haney wrote:
}
} Bart Schaefer wrote:
}
} >>Is there a way to make this work properly with setopt GLOB_DOTS?
} >
} It want to ignore '..' when it is a stupid choice.
} eg.
} mkdir Z
} cd Z/[tab]
} should NOT complete to 'cd Z/../'
} (unless CHASE_DOTS is on and 'cd Z/..' will be different from 'cd .')
This is a case where you need 'zstyle -e'. You want the special-dirs
style to be non-empty only in certain circumstances.
This completes `..' only if the prefix is either empty, or has a leading
`.' and contains no slashes:
zstyle -e ':completion:*' special-dirs \
'[[ $PREFIX = (|.[^/]#) ]] && reply=(..)'
heh Thanks. I didnt know I could run a "script" here :)
zstyle -e ':completion:*' special-dirs \
'[[ $PREFIX = (../)#(|.|..) ]] && reply=(..)'
This will continue to work with cd ../../../..[tab] while working with
cd .[tab]
Would you please add your (or my) little script to the documentation
under special-dirs? :)
To find out that `Z/..' is not the same directory as `.' requires a bit
of extra work, which I don't have time to do just now, but you can see
how you'd just insert that into the conditions under which the reply
array is set by the style.
I dont use CHASE_DOTS luckely :)
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
--
Dennis
use Inline C => qq{void p(char*g){printf("Just Another %s Hacker\n",g);}};p("Perl");
Messages sorted by:
Reverse Date,
Date,
Thread,
Author