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

Re: Completion Guru needed (next/prev)



David R. Favor wrote:

> I'm trying to create a next/prev completion facility to quickly
> traverse complicated directory hierarchies.
> 
> Here is an example hierarchy:
> 
> ...
> 
> Typing cd-SPACE-TAB begins completion of the directories [src doc info]. Here's
> what I'm trying to do.
> 
> NEXT completion:
> 
> If src is currently seleted, normally it requires hitting BACKSPACE-TAB-TAB to
> begin selecting directories [client lib server tools]. I would like to be able
> to do this by hitting the shortcut SHIFT-TAB.
> 
> PREVIOUS completion:
> 
> If src/server/ is currently selected, I would like to be able to hit CNTL-TAB
> to go back to selecting [client lib server tools]
> 
> Suggestions would be appreciated.

No official version allows to do this in the completion code. But you
can probably use some bindkey-trickery:

  bindkey -s <SHIFT-TAB> '^H^I^I'
  bindkey -s <CTRL-TAB>  '^W^I'

This will only work if there is no `/' in your WORDCHARS parameter and 
if Control-W is bound to bachward-kill-word or backword-delete-word
(it's normally bound to backward-kill-word). Maybe I understood you
wrong and in the second case '^W^W^I' does what you want.

Bye
 Sven

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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