zsh-users
 help / color / mirror / code / Atom feed
From: Silas Silva <silasdb@gmail.com>
To: zsh-users@zsh.org
Subject: Playing with list-expand + complete-word
Date: Sat, 19 Jul 2014 02:22:23 -0300	[thread overview]
Message-ID: <20140719052223.GA21109@auron.ufabc.int.br> (raw)

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


             reply	other threads:[~2014-07-19  5:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-19  5:22 Silas Silva [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140719052223.GA21109@auron.ufabc.int.br \
    --to=silasdb@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).