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

Re: Wishlist for zsh: 3 tcsh features



I'll answer both martin.ebourne@xxxxxxxxxxxx & schaefer@xxxxxxxxxxxxxxxx at
once.

Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote: 
> On Oct 8,  5:25pm, martin.ebourne@xxxxxxxxxxxx wrote:
> }
> }       1) <Meta-Del>: In tcsh, when deleting elements in a path,
> }          <Meta-Del> generally deletes everything up to the next
> }          "/" character, e.g.
> } 
> } In ZSH this is controlled with the WORDCHARS env var. Mine is set to:
> } WORDCHARS='*?_-.[]~#'

Perfect! This is exactly what I want. And it even works for <Meta-f> and
<Meta-b> :->
 
> You can also try using vi-backward-kill-word instead of backward-kill-word.

This is what I was using before, but there may be another way to set it
up that gets what I want...doesn't really matter now :->

> }       2) <Meta-p>, part 1 : In tcsh, <Meta-p>, when looking up history
> }          elements that begin with the already-typed string, will return
> }          a unique list of elements that match the string, e.g.:
> } 
> } One solution to this is prevent history lines from getting duplicated in
> } the first place. Something like:
> } setopt hist_find_no_dups
> 
> Just that one, should give what James wants.  If it doesn't, we need to
> fix it.

Works like a charm!

> }       3) <Meta-p>, part 2 : In tcsh, <Meta-p> will return the command that
> }          matches exactly what's been typed already:
> } 
> } The ZLE widgets 'history-beginning-search-backward' and '
> } history-beginning-search-forward' are probably what you are after.
> 
> On Oct 8,  6:10pm, Oliver Kiddle wrote:
> } 
> } Those two widgets annoyingly don't allow you to navigate up and down in
> } multiple line commands so you may prefer to try `up-line-or-search' and
> } `down-line-or-search' which are similar. They also have their faults
> } though because they only use the first word on the current line in their
> } search. Ideally, these will be replaced with more primitive widgets
> } (e.g. just up-line) so that I can write one which works exactly as I
> } like in a shell function.

Actually, history-beginning-search-{backward,forward} are perfect! I bind
those to <Meta-p> and <Meta-f>, and still can use <Ctrl-p> and <Ctrl-f> to
move through multi-line commands.

*sniff* It's just beautiful *sniff* :->

Thanks to all who answered, I'm very happy now :->

Jim



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