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

Re: completion is over thinking things.



On Sun, Sep 29, 2019 at 8:30 AM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> ... probably half of that stuff is redundant or useless or harmful or
> whatever and I don't even know where it came from.

"I don't know half of you half as well as I should like, and I like
less than half of you half as well as you deserve."

Really though, there's nothing bad or alarming in there.  This is the
one you want to change:

> # Original: zstyle ':completion:*' completer _complete _match _approximate
> zstyle ':completion:*' completer _expand _complete

zstyle ':completion:*' completer _expand _complete _files

Note that this only makes completion fall back to _files when nothing
else matches; if _expand or _complete finds something, you won't get
file names.  If you want file names all the time, mixed in with other
results, you'll have to write a custom function.  The simplest such
function might look like:

_complete+files() {
  _alternative 'normal::_complete' 'files::_files'
}
zstyle ':completion:*' completer _expand _complete+files

I would not recommend doing this unless you also keep using the
display configuration below (specifically the group-name style),
otherwise the way things get mixed together will be too confusing.  As
written, this also has the drawback that even if _complete already
returns file names, _files will add them a second time anyway.

> # allow approximate
> #Tab completion should be case-insensitive.
> # Original: zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
> zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}'  'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'

That's doing what the comment says, it makes completion
case-insensitive.  It also allows dots, underscores, and hyphens to
fill themselves in.

> zstyle ':completion:*' auto-description 'specify: %d'
> zstyle ':completion:*' format 'Completing %d'
> zstyle ':completion:*' group-name ''
> zstyle ':completion:*' list-colors ''
> zstyle ':completion:*' list-prompt %SAt %p: Hit TAB 'for more', or the char to insert%s
> zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s

Those are all about what the display looks like.

> zstyle ':completion:*' use-compctl false

That says not to fall back on the old built-in completions if the
compsys functions fail.

The rest of what you had is reasonably obvious, I think.  The
kill-specific styles are from a zsh-users post a few years ago.



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