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

Re: tab doesn't work within incremental-complete-word



On 2014/07/14, at 18:40, Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx> wrote:
> But after activiated by '^xi' after inputting 'ls', I cannot use tab to
> complete files in current directory:
> 
> % ls
> aa  bb  cc
> % ls	# ctrl-x i works, but tab doesn't
> incremental (complete): -no prefix-
> files
> aa  bb  cc

I think this is the expected behavior.

If you look into the file incremental-complete-word
(it may be in /usr/{,local/}share/zsh/version/functions/)
then you will find the options menucomplete and automenu are unset
at the beginning of the function. So menu-complete will not take place.

In the example above, 'ls ^xia<tab>' will complete 'aa'.

If you also have a file 'ab', then 'ls ^xia' will display

files
aa ab

and hitting <tab> will not complete anything more. In this case,
you can just hit <return><tab><tab>... to exit from the
incremental-complete-word and go to the usual menu-completion
(assuming either menucomplete or automenu is set). But of course
you need to type ^xi again to go back to incremental-complete-word.

If you feel hitting <return> is not intuitive, then you may try

zstyle ':incremental' stop-keys $'\C-I'

then hitting tab always exits from incremental-complete-word,
and just <tab> (if menucomplete is set) or <tab><tab> (automenu)
will bring you to the menu-complete.

There are more elaborate versions of incremental-complete-word,
for exammple https://github.com/hchbaw/auto-fu.zsh
but I don't know how well they work.



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