zsh-users
 help / color / mirror / code / Atom feed
* Playing with list-expand + complete-word
@ 2014-07-19  5:22 Silas Silva
  2014-07-20  1:21 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Silas Silva @ 2014-07-19  5:22 UTC (permalink / raw)
  To: zsh-users

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


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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-19  5:22 Playing with list-expand + complete-word Silas Silva
2014-07-20  1:21 ` Bart Schaefer
2014-07-20 14:49   ` Silas Silva
2014-07-20 17:02     ` Bart Schaefer
2014-07-21 13:40       ` Silas Silva
2014-07-21 14:38         ` Silas Silva

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).