zsh-users
 help / color / mirror / code / Atom feed
* change behaviour of command line completion
@ 2015-05-27 11:36 ruud grosmann
  2015-05-27 11:55 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: ruud grosmann @ 2015-05-27 11:36 UTC (permalink / raw)
  To: zsh-users

hello all,

recently, I have changed to using ohmyzsh. I want to undo one of the
many changes, but I don't know what the change is caused by.

In the old situation, when I was in a directory with only one file,
'example.txt' and I typed 'ls x<TAB>', no completion followed. Because
no files start with an 'x'.
But now, zsh happily changes the x to 'example.txt', because the x is
in 'example.txt'. I rather don't want this behaviour, but I cannot
find in the documentation of the options anything that describes this.

I hope you can tell me what this (too) smart completion is caused by,
so that I can update my profile. If it is not controlled by an option,
I hope to find out what other possibilities van influence this kind of
behaviour...

I am running zsh 4.3.17 from the debian wheezy distribution.

When I use the ohmyzsh profile, the following options are added
compared to the old situation:
alwaystoend
autocd
cdablevars
extendedhistory
noflowcontrol
histexpiredupsfirst
histignorespace
histverify
longlistjobs
promptsubst
pushdignoredups
pushdminus
sharehistory

The correct option is not active any more.

thanks in advance, Ruud


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: change behaviour of command line completion
  2015-05-27 11:36 change behaviour of command line completion ruud grosmann
@ 2015-05-27 11:55 ` Peter Stephenson
  2015-05-27 13:03   ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2015-05-27 11:55 UTC (permalink / raw)
  To: zsh-users

On Wed, 27 May 2015 13:36:56 +0200
ruud grosmann <r.grosmann@gmail.com> wrote:
> In the old situation, when I was in a directory with only one file,
> 'example.txt' and I typed 'ls x<TAB>', no completion followed. Because
> no files start with an 'x'.
> But now, zsh happily changes the x to 'example.txt', because the x is
> in 'example.txt'. I rather don't want this behaviour, but I cannot
> find in the documentation of the options anything that describes this.

I'm assuming ohmyzsh uses the new completion system...  I have no idea
about ohmyzsh so I'm referring to the underlying shell to look for what
might be causing it.

This could be various things...


1. Approximate completion.  In other words, it's correcting what you
type and then trying to complete that.  So it thinks you "mistyped" by
omitting the "e" from "example.txt".

Do

  zstyle -L | grep -w completer

and look for something like:

  zstyle ':completion:*' completer _oldlist _expand _user_expand _complete _ignored _approximate

(This is mine, not ohmyzsh.)

If you see that "_approximate" (or also "_correct") you want to remove
those.  Using exactly the same line with that word or those words
removed will do the trick (the output in that form gives you a valid
command line you can put in .zshrc).  In this case, for example:

  zstyle ':completion:*' completer _oldlist _expand _user_expand _complete _ignored


2. Matcher control.  This allows you to update the rules that compare
what's on the command line with the trial matches.  This is probably
less likely, but it's certainly possible to set the sehll up like this.

Do

  zstyle -L | grep matcher-list

and look for something like:

  zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} r:|[[:punct:]]=* r:|=*'

As matcher control is complicated, the simplest thing to do is remove
arguments from the end and enter the corresponding line until the
problem goes away.  Put very briefly, things like 'r:|=*' and 'l:|=*'
are what might be causing the problem as they're allowing the completion
system to add anything at one end or other of the string.  Obviously,
adding things at the end isn't usually a problem so I'd worry more about
things looking like 'l:|=*'.


Hope that's enough to track it down.

pws


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: change behaviour of command line completion
  2015-05-27 11:55 ` Peter Stephenson
@ 2015-05-27 13:03   ` Peter Stephenson
  2015-05-27 21:14     ` Andrew Janke
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2015-05-27 13:03 UTC (permalink / raw)
  To: zsh-users

On Wed, 27 May 2015 12:55:49 +0100
Peter Stephenson <p.stephenson@samsung.com> wrote:
> On Wed, 27 May 2015 13:36:56 +0200
> ruud grosmann <r.grosmann@gmail.com> wrote:
> > In the old situation, when I was in a directory with only one file,
> > 'example.txt' and I typed 'ls x<TAB>', no completion followed. Because
> > no files start with an 'x'.
> > But now, zsh happily changes the x to 'example.txt', because the x is
> > in 'example.txt'. I rather don't want this behaviour, but I cannot
> > find in the documentation of the options anything that describes this.
> 
> This could be various things...
>
> 2. Matcher control.

In case anyone else wants to know, Ruud told me off-list it was here ---
removing the matcher-list style stopped that particular behaviour.

pws


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: change behaviour of command line completion
  2015-05-27 13:03   ` Peter Stephenson
@ 2015-05-27 21:14     ` Andrew Janke
  2015-05-28  8:15       ` ruud grosmann
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Janke @ 2015-05-27 21:14 UTC (permalink / raw)
  To: Peter Stephenson, r.grosmann, zsh-users



On 5/27/15 9:03 AM, Peter Stephenson wrote:
> On Wed, 27 May 2015 12:55:49 +0100
> Peter Stephenson <p.stephenson@samsung.com> wrote:
>> On Wed, 27 May 2015 13:36:56 +0200
>> ruud grosmann <r.grosmann@gmail.com> wrote:
>>> In the old situation, when I was in a directory with only one file,
>>> 'example.txt' and I typed 'ls x<TAB>', no completion followed. Because
>>> no files start with an 'x'.
>>> But now, zsh happily changes the x to 'example.txt', because the x is
>>> in 'example.txt'. I rather don't want this behaviour, but I cannot
>>> find in the documentation of the options anything that describes this.
>> This could be various things...
>>
>> 2. Matcher control.
> In case anyone else wants to know, Ruud told me off-list it was here ---
> removing the matcher-list style stopped that particular behaviour.
>
> pws

FYI, while oh-my-zsh doesn't have a mailing list, questions and config
problems like this are welcome as Issues on their GitHub issue tracker.
https://github.com/robbyrussell/oh-my-zsh/

OMZ does a lot of non-default stuff on top of ZSH. It may be best to send
OMZ-related questions there (or to the OMZ IRC) first, so we don't burden
the core ZSH folks with support for stuff they didn't write themselves. (And
my apologies if you did and we just didn't see it.)

Cheers,
Andrew


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: change behaviour of command line completion
  2015-05-27 21:14     ` Andrew Janke
@ 2015-05-28  8:15       ` ruud grosmann
  0 siblings, 0 replies; 5+ messages in thread
From: ruud grosmann @ 2015-05-28  8:15 UTC (permalink / raw)
  To: Andrew Janke; +Cc: zsh-users

On 27/05/2015, Andrew Janke <janke@pobox.com> wrote:
> FYI, while oh-my-zsh doesn't have a mailing list, questions and config
> problems like this are welcome as Issues on their GitHub issue tracker.
> https://github.com/robbyrussell/oh-my-zsh/

Hi Andrew,
I wasn't aware of that possibility. I will keep that in mind.

>
> OMZ does a lot of non-default stuff on top of ZSH. It may be best to send
> OMZ-related questions there (or to the OMZ IRC) first, so we don't burden
> the core ZSH folks with support for stuff they didn't write themselves.
> (And
> my apologies if you did and we just didn't see it.)

For this reason, I have considered not sending the question to the
list. I found it appropriate because the question was zsh related too.
Peter's answer was a great help. My apologies for burdening the list.

Ruud


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-05-28  8:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-27 11:36 change behaviour of command line completion ruud grosmann
2015-05-27 11:55 ` Peter Stephenson
2015-05-27 13:03   ` Peter Stephenson
2015-05-27 21:14     ` Andrew Janke
2015-05-28  8:15       ` ruud grosmann

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).