From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: Playing with list-expand + complete-word
Date: Sat, 19 Jul 2014 18:21:12 -0700 [thread overview]
Message-ID: <140719182113.ZM13840@torch.brasslantern.com> (raw)
In-Reply-To: <20140719052223.GA21109@auron.ufabc.int.br>
On Jul 19, 2:22am, Silas Silva wrote:
}
} 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.
Since you've read chapter 6 of the user guide and fiddled with styles,
I presume you have run compinit, and have also bound TAB to complete-word
instead of expand-or-complete?
Whether or not you've run compinit,
bindkey $'\t' complete-word
setopt glob_complete
will probably get you very close to the behavior you want. How it works
out in combination with the zstyle settings you've experimented with, I
can't say.
Equivalently (if you *have* run compinit), you should be able to add
_match to your list of completers, e.g.
zstyle ':completion:*' completer _complete _match
If glob_complete doesn't seem to be what you want ...
} ... the solution I found was to create a new widget with the
} following line:
}
} zle list-expand || zle complete-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.
What you probably want there is
zle list-choices || zle list-expand || zle complete-word
However ...
} I'd like that it ignored the expansion of tilde and variables if there
} was slash. Any clue?
You've just described the behavior of the _expand completer when the
"suffix" zstyle is true (the default). What's the current value of
your "completer" zstyle?
next prev parent reply other threads:[~2014-07-20 1:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-19 5:22 Silas Silva
2014-07-20 1:21 ` Bart Schaefer [this message]
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=140719182113.ZM13840@torch.brasslantern.com \
--to=schaefer@brasslantern.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).