Zsh Mailing List Archive
Messages sorted by:
Playing with list-expand + complete-word
- X-seq: zsh-users 18961
- From: Silas Silva <silasdb@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Playing with list-expand + complete-word
- Date: Sat, 19 Jul 2014 02:22:23 -0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent; bh=YLKYYRFC8tT+H5/ZPzfOtBnC1jlOqWX+AWHLNbUsOYU=; b=GNKrarVe6UF9/OPLiN659bHv6KIYW60C9zbrj623ENDqhMIgzhnv42wODT0PjXbZwb 4Amn3ev1ShkChVqVta5g9DBvxZIvSFhMTkA8W+t30X+1e0ARzFmpDIZsohITrJD7Ijc/ 1fituwg59Y+n7odKXTlgsPt+EnH8AfW5ezQ7DG/duoPsjyzrXBiZDPKQNIMzq1yoKvof oLXmZVSk6ZqkXDUm9av9lxDcmOVaIxVWsGHWXzWBdoUED4IDNFaoJ96XqK0V9E6utE8k j7yAAVWktsXtE/JhSNUHYyauHQfD8SOhI3lPIvlUJCVBer2esRMEoCyq9jRbcSbNPLsz Kewg==
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:email@example.com>
- Mail-followup-to: zsh-users@xxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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
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.
Messages sorted by: