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

Playing with list-expand + complete-word



Hello all!

I always wanted to change default behaviour of zsh expand and completion
behaviour to something similar to ksh or bash, that is:

    % ls *<tab>

After pressing tab, in expand-or-complete widget would expand * to every
file in current directory.  In ksh it would just print a list of files
that match the glob.

This can be achieved by list-expand widget, but then it looses
completion.  After reading chapter 6 of the zsh user guide and changing
a lot of style, the solution I found was to create a new widget with the
following line:

    zle list-expand || zle complete-word

That is, when it failed to expand the glob, it would them try to
complete the word.

It worked really fine until I realized the problem with variables and
tildes.  So, the following:

    % cd ~/<Tab>

Will not list directories in $HOME, but just give a list ofone item:
/home/username.  The same happens if I change ~ by $HOME variable.

I'd like that it ignored the expansion of tilde and variables if there
was slash.  Any clue?  Or maybe I'm complicating everything and this can
be achieved with standard widgets and some style changing?

Thank you very much.

-- 
Silas Silva



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