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

Re: known hosts tab completion



On 23 June 2012 20:18, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Jun 22,  2:48pm, Matt Woodson wrote:
> }
> } Let's say I have these hosts:
> }
> } host01.stage.example.com
> } host02.stage.example.com
> } host01.prod.example.com
> } host02.prod.example.com
> }
> } now, in my prompt, I will type:
> }
> } $ ssh hos<tab>
> }
> } zsh will show me:
> }
> } $ ssh host..example.com
> }
> } with the cursor right after "host" and shows me a menu with the host
> } names in it. I like the menu showing me hostnames, I just don't want
> } it to complete everything.
>
> This similar to the confusion about the default matcher-list that was
> discussed about a month ago in the "completion oddity" thread (starts
> with zsh-users/17099 if you want to check the archives).
>
> In this case, though, the default matcher-list does not include the
> dot character, so you must have a zstyle that does.  Disable it for
> this context and you should be able to get the behavior you want.

The default matcher-list for host completion does have the . in it, or
rather it uses a hardcoded compadd -M 'm:{a-zA-Z}={A-Za-z} r:|.=*
r:|=*', as do a couple of other completions. zsh -f gives me the
"magic" behaviour with just compinit, and I don't think you can
override compadd -M 'foo' provided stuff with styles.

-- 
Mikael Magnusson



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