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

_approximate without expansion



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@xxxxxxxx - 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



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