zsh-users
 help / color / mirror / code / Atom feed
* _approximate without expansion
@ 2006-10-14 17:04 John Eikenberry
  2006-10-14 21:19 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: John Eikenberry @ 2006-10-14 17:04 UTC (permalink / raw)
  To: zsh users

I'd like to make my _approximate and noremal _complete behavior to be in
sync. With my current setup if I start with the correct partial string and
hit tab, it completes up to the point of ambiguity, pauses and if I hit tab
again it brings up a menu. But when I typo and _approximate gets run it
fixes the typo and completes the first of the possible completions. I'd
like the _approximate to behave like _complete. Where it would just fix the
typo and complete up to the point of ambiguity.

I never trigger _approximate on purpose so I always have to pause to notice
what's going on. Where with the normal completion I don't even think about
it. This flow-breaking pause is annoying.

Thanks.

Here's an example that will hopefully make it more clear.

[jae_0]ls
foo_bar_one  foo_bar_three  foo_bar_two

Completer behaviour without using _approximate:

[jae_0]ls foo_<tab>bar_<tab>
- files -
foo_bar_one    foo_bar_three  foo_bar_two  
- all matches -
foo_bar_one foo_bar_three foo_bar_two


Completer behaviour using _approximate:
<foo_bar_one> is the selected menu item

[jae_0]ls Foo_<tab>
Turns into to...
[jae_0]ls foo_bar_one
- corrections -
<foo_bar_one>    foo_bar_three  foo_bar_two  
- original -
Foo_


How I'd like the Completer to behave using _approximate:

[jae_0]ls Foo_<tab>
Turns into to...
[jae_0]ls foo_bar_<tab>
- corrections -
foo_bar_one    foo_bar_three  foo_bar_two  
- original -
Foo_  
(I don't really care about original)

This is with zsh v4.2.5. 
Here's the parts of my zshrc that seem appropriate.

zstyle ':completion:*' completer _all_matches _complete _match _approximate _ignored
zstyle ':completion:*:match:*' original only
zstyle ':completion:*:approximate:*' max-errors 1 numeric
zstyle ':completion:*'              menu select
zstyle ':completion:*'              group-name ''
zstyle ':completion:*'              group-order ''
zstyle ':completion:*:descriptions' format "- %d -"

setopt auto_list


-- 

John Eikenberry
[jae@zhar.net - http://zhar.net]
______________________________________________________________
"It is difficult to produce a television documentary that is both incisive
and probing when every twelve minutes one is interrupted by twelve dancing
rabbits singing about toilet paper." - Rod Serling


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

* Re: _approximate without expansion
  2006-10-14 17:04 _approximate without expansion John Eikenberry
@ 2006-10-14 21:19 ` Bart Schaefer
  2006-10-15  1:15   ` John Eikenberry
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2006-10-14 21:19 UTC (permalink / raw)
  To: zsh users

On Oct 14,  1:04pm, John Eikenberry wrote:
}
} With my current setup if I start with the correct partial string and
} hit tab, it completes up to the point of ambiguity, pauses and if I
} hit tab again it brings up a menu. But when I typo and _approximate
} gets run it fixes the typo and completes the first of the possible
} completions.

    zstyle ':completion::approximate*:*' insert-unambiguous yes

Note that you need "approximate*" because the actual context is
":completion::approximate-N:::" where N is the number of corrections.


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

* Re: _approximate without expansion
  2006-10-14 21:19 ` Bart Schaefer
@ 2006-10-15  1:15   ` John Eikenberry
  0 siblings, 0 replies; 3+ messages in thread
From: John Eikenberry @ 2006-10-15  1:15 UTC (permalink / raw)
  To: zsh users

Bart Schaefer wrote:

> On Oct 14,  1:04pm, John Eikenberry wrote:
> }
> } With my current setup if I start with the correct partial string and
> } hit tab, it completes up to the point of ambiguity, pauses and if I
> } hit tab again it brings up a menu. But when I typo and _approximate
> } gets run it fixes the typo and completes the first of the possible
> } completions.
> 
>     zstyle ':completion::approximate*:*' insert-unambiguous yes
> 
> Note that you need "approximate*" because the actual context is
> ":completion::approximate-N:::" where N is the number of corrections.

Perfect. I had tried insert-unambiguous, missed that * next to approximate.

Thanks.

-- 

John Eikenberry
[jae@zhar.net - http://zhar.net]
______________________________________________________________
"It is difficult to produce a television documentary that is both incisive
and probing when every twelve minutes one is interrupted by twelve dancing
rabbits singing about toilet paper." - Rod Serling


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

end of thread, other threads:[~2006-10-15  1:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-14 17:04 _approximate without expansion John Eikenberry
2006-10-14 21:19 ` Bart Schaefer
2006-10-15  1:15   ` John Eikenberry

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