zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: completion of filenames
Date: Fri, 13 Dec 2019 13:10:15 -0800	[thread overview]
Message-ID: <d4be8afe-ae9e-3622-ca8a-14025ce1ea97@eastlink.ca> (raw)
In-Reply-To: <CAH+w=7YZCs5Czy7no2juuUfawRFkmHKAHX_vAwTazO8WJ23Y7w@mail.gmail.com>

On 2019-12-13 11:46 a.m., Bart Schaefer wrote:

It's more than my tiny brain can really understand Bart, however:

> You've got one more issue, I think, based on your subsequent question:
>
>> Where is 'expand-or-complete' defined?
> You shouldn't be using both expand-or-complete and the _expand
> completer.
I was under the impression that the TAB key called expand-or-complete 
and that this somehow
tweaked itself via the 'zstyle .....' lines.

>    If you invoke expand-or-complete, it's going to try to do
> expansion on the word and if that succeeds it will never proceed into
> attempting completion.  To use _expand, you should be re-binding the
> TAB key:
>
> bindkey "^I" complete-word
>
> Usually compinit will take care of this for you, but only if the
> zstyle definitions appear in your .zshrc (et al) BEFORE you invoke
> compinit.  This is in the doc:
>
>         To  initialize  the system, the function compinit should be in a direc-
>         tory mentioned  in  the  fpath  parameter  ...  If completion styles (see
>         below) are set up  to  perform  expansion  as  well  as  completion  by
>         default,  and the TAB key is bound to expand-or-complete, compinit will
>         rebind it to complete-word; this is necessary to use the  correct  form
>         of expansion.
>
> Does any of this help with your situation?
All possible combinations of the above have not yet been tested, however 
as I have it now:

     zstyle ':completion:*' completer _files _expand _complete 
#('_files' first as you suggest).

      autoload -U compinit && compinit -d $ZSHBOOT/zcompdump
This had been *above* the 'styles', moving it below the 'styles' as you 
indicate seems to have worked :-)
What is puzzling is that your previous help with my 'styles' was 
effective even though 'autoload ...'  was above it.

     # This is the default for TAB:
     #bindkey  '^I' expand-or-complete
     #bindkey '^I' complete word             #(tried but didn't work 
*apart* from the above and seems not needed anyway so TAB is default.

So, pending further advice or tinkerings, It is exactly as I want: empty 
or partial command line is first completed with local files.
I guess this is a cultural issue -- if one is accustomed to the normal 
function then you wouldn't want it any other way and this could
be a last remaining vestige of my DOS-think, but I can't imagine 
completion working on anything other than files myself, seeing commands
pop up really bothers me.

Thanks again Bart.



      reply	other threads:[~2019-12-13 21:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20191210161919epcas1p2c60b547299b6425434345c4f26071643@epcas1p2.samsung.com>
2019-12-10 16:17 ` Ray Andrews
2019-12-10 16:30   ` Peter Stephenson
2019-12-10 16:59     ` Ray Andrews
2019-12-10 17:16       ` Peter Stephenson
2019-12-10 17:45         ` Ray Andrews
2019-12-13 15:59       ` Ray Andrews
2019-12-13 16:24         ` Peter Stephenson
2019-12-13 17:06           ` Ray Andrews
2019-12-13 19:46             ` Bart Schaefer
2019-12-13 21:10               ` Ray Andrews [this message]

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=d4be8afe-ae9e-3622-ca8a-14025ce1ea97@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --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).