Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Simple Tip of the Day
- X-seq: zsh-users 9593
- From: Christian Taylor <cht@xxxxxxxxx>
- To: "zsh-users" <zsh-users@xxxxxxxxxx>
- Subject: Re: Simple Tip of the Day
- Date: Sat, 29 Oct 2005 16:52:30 +0200
- In-reply-to: <200510291637.58926.kos@xxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <ci14m1hm45ig6umsu2v0tkini1gp0bad3r@xxxxxxx> <87ek65zwuw.fsf@xxxxxxxxxxxxxxxx> <200510291637.58926.kos@xxxxxxxxxxxxxxxxx>
Konstantin Sobolev wrote:
> 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:
> >
[...]
>
> I'm using menu completion for this:
>
> bindkey "^Z" "menu-complete"
> bindkey -s '\ec' 'cd -^Z'
I'm using something very similar:
zle -N select-from-cd-stack
select-from-cd-stack() {
LBUFFER=$LBUFFER"~+"
zle menu-complete
if [[ ${LBUFFER[-2,-1]} = "~+" ]]; then
LBUFFER=${LBUFFER[1,-3]}
fi
}
bindkey '\ed' select-from-cd-stack
The advantage is that I can also use it for other commands like cp (for
example when I want to copy a file from a directory in the stack to the
current one). And since I have setopt auto_cd, I can instantly jump to
directories in the stack.
Another (default) binding that I really like is:
bindkey "^[h" run-help
Christian
Messages sorted by:
Reverse Date,
Date,
Thread,
Author