zsh-users
 help / color / mirror / code / Atom feed
* tab doesn't work within incremental-complete-word
@ 2014-07-14  9:40 Han Pingtian
  2014-07-14 12:54 ` Jun T.
  0 siblings, 1 reply; 2+ messages in thread
From: Han Pingtian @ 2014-07-14  9:40 UTC (permalink / raw)
  To: zsh-users

Hi,

Looks like tab (complete-word) doesn't work within
incremental-complete-word on my system. 

I have initialised incremental-complete-word by putting those in my .zshrc:

zstyle :incremental list yes
autoload -U incremental-complete-word
zle -N incremental-complete-word
bindkey '^xi' incremental-complete-word

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: tab doesn't work within incremental-complete-word
  2014-07-14  9:40 tab doesn't work within incremental-complete-word Han Pingtian
@ 2014-07-14 12:54 ` Jun T.
  0 siblings, 0 replies; 2+ messages in thread
From: Jun T. @ 2014-07-14 12:54 UTC (permalink / raw)
  To: zsh-users


On 2014/07/14, at 18:40, Han Pingtian <hanpt@linux.vnet.ibm.com> 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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-14 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-14  9:40 tab doesn't work within incremental-complete-word Han Pingtian
2014-07-14 12:54 ` Jun T.

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).