Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Simple Tip of the Day



On Friday 28 October 2005 15:47, Hannu Koivisto wrote:
> bindkey -s '^[[5~' 'cds\r' # "PageUp"
>
> Just in case you are wondering what that 'cds' is, it is an
> interactive way to select a directory from the directory
> stack-treated-as-history, along the lines of a similar feature in
> 4nt:
>
> cds () {
>     local DIR="$PWD"
>     if [[ ! -z "$dirstack" ]]; then
>         DIR=$(print -rl $dirstack | tac \
>
>             | iselect -a -f -n chdir -Q "$PWD" -t "Change directory to..."
>             | -p ${#dirstack})
>
>     fi
>     cd "$DIR"
> }

I'm using menu completion for this:

bindkey "^Z" "menu-complete"
bindkey -s '\ec' 'cd -^Z'

-- 
/KoS
* Any program will expand to fill all memory PLUS ONE BYTE!	      



Messages sorted by: Reverse Date, Date, Thread, Author