zsh-users
 help / color / mirror / code / Atom feed
* .zshrc sanity check
@ 2004-04-03 12:12 Thorsten Kampe
  2004-04-05 18:59 ` Oliver Kiddle
  0 siblings, 1 reply; 3+ messages in thread
From: Thorsten Kampe @ 2004-04-03 12:12 UTC (permalink / raw)
  To: zsh-users

Hi,

re-reading the User's guide I have made many changes to my .zshrc and
I was wondering what the "pros" would say about that. So if you're
really bored and don't know what to do with your sparetime you might
have a look at http://www.thorstenkampe.de/tmp/zshrc.txt [14 kB] and
tell me what you think.

Just to make myself clear: I'm not looking for an "in-depth analysis",
just a quick "overhaul" like...

- "you're setting "foo" but also "bar" which is contradictory and
makes no sense"

- "you're not setting "foo", but everyone else does, so you might have
forgotten that"

- "line n seems pretty unclear to me. Do you really know what it's
supposed to do[1]?"


Thanks in advance,
Thorsten

[1] Don't look at the "matcher-list" zstyle. I know what the comment
says but I'm still trying to figure out what I wanted it to do when I
wrote this line two years ago :-/


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

* Re: .zshrc sanity check
  2004-04-03 12:12 .zshrc sanity check Thorsten Kampe
@ 2004-04-05 18:59 ` Oliver Kiddle
  2004-04-05 23:33   ` Thorsten Kampe
  0 siblings, 1 reply; 3+ messages in thread
From: Oliver Kiddle @ 2004-04-05 18:59 UTC (permalink / raw)
  To: Thorsten Kampe; +Cc: zsh-users

Thorsten Kampe wrote:
> 
> re-reading the User's guide I have made many changes to my .zshrc and

> zstyle ':completion:*' completer        _expand _complete _match _approximate _ignored
> zstyle ':completion:*:expand:*' glob             true

The _match completer is pretty much superfluous if you already use
_expand to expand any globs. I have _match bound to a separate key.

> zstyle    ':completion:*:approximate:*' insert-unambiguous true

This style is not doing anything. _approximate only looks up that style
after it has added the number of corrections to the context. I use:
  zstyle ':completion::approximate*:*' insert-unambiguous true

> zstyle    ':completion:*:approximate:*' original           false

false is the default value for this style. It would also need an extra
`*' in the style after `approximate'. If you never want _approximate to
add the original string as a match, you need to use:
  zstyle ':completion::approximate:*' tag-order corrections

You might want to think about using more specific contexts for quite a
few of the styles. It is worth thinking through all the style
components whenever you set a style. If you can't remember the
components, add a comment:
  # contexts are :completion:<function>:<completer>:<command>:<arg>:<tag>

I prefer to avoid matching anything (with *) in the function component
with styles that affect completion behaviour.

Another case where you could make the context more specific:

> zstyle ':completion:*:functions' ignored-patterns  '_*'

Anything which restricts matches by literal checks of what has already
been typed against a fixed string tends not to be desirable for the
_correct and _approximate completers. This is because you might
mis-type the literal string. So, for example:
  unfunction -ssh<tab>
won't correct to
  unfunction _ssh

I instead use:
  zstyle ':completion::(^approximate*):*:functions' ignored-patterns '_*'

> zstyle ':completion:*:expand:*' subst-globs-only true

You might want to rethink setting that (and your expand styles in
general since it looks like you've just set everything true). Other
styles now do a better job with what I tried to do with
subst-globs-only.

Other than that, it rest comes down to personal preference. I found
myself thinking "yuk" but not "that's insane" on seeing some of your
option settings. A couple of options you may want to try setting are
c_bases and braceccl.

Oliver


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

* Re: .zshrc sanity check
  2004-04-05 18:59 ` Oliver Kiddle
@ 2004-04-05 23:33   ` Thorsten Kampe
  0 siblings, 0 replies; 3+ messages in thread
From: Thorsten Kampe @ 2004-04-05 23:33 UTC (permalink / raw)
  To: zsh-users

* Oliver Kiddle (2004-04-05 20:59 +0100)
> Thorsten Kampe wrote:
>> re-reading the User's guide I have made many changes to my .zshrc and
> 
>> zstyle ':completion:*' completer        _expand _complete _match _approximate _ignored
>> zstyle ':completion:*:expand:*' glob             true
> 
> The _match completer is pretty much superfluous if you already use
> _expand to expand any globs.

Okay, I've put "_match" out of "matcher-list".
 
>> zstyle    ':completion:*:approximate:*' insert-unambiguous true
> 
> This style is not doing anything. _approximate only looks up that style
> after it has added the number of corrections to the context. I use:
>   zstyle ':completion::approximate*:*' insert-unambiguous true

And another one for my .zshrc ;-)
 
> You might want to think about using more specific contexts for quite a
> few of the styles. It is worth thinking through all the style
> components whenever you set a style.

Yeah, probably. But my understanding of the whole "zstyle" stuff and
syntax is not so deep (for a proof see "This style is not doing
anything" above).

> I prefer to avoid matching anything (with *) in the function component
> with styles that affect completion behaviour.

Why?
 
>> zstyle ':completion:*:expand:*' subst-globs-only true
> 
> You might want to rethink setting that (and your expand styles in
> general since it looks like you've just set everything true).

Yes, almost. Peter Stephenson's description of these options in the
User' Guide is so persuading that I thought: "Sounds good and
reasonable to me. Let's set this to 'true'.".

> Other styles now do a better job with what I tried to do with
> subst-globs-only.

For instance?
 
> Other than that, it rest comes down to personal preference. I found
> myself thinking "yuk" but not "that's insane" on seeing some of your
> option settings. A couple of options you may want to try setting are
> c_bases and braceccl.

Did that (although I don't know what "yuk" means). I've set most of
these options two and a half years ago when I first got in contact
with zsh and read the User's Guide.

If reading the description of the option made me think "I don't have
the slightest idea what that means", I optioned for the default. And
every time I thought "Wow, looks like some extra functionality", I set
the option.

Shame on me that I had "shwordsplit" set until a few weeks ago ;-)


Thorsten


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

end of thread, other threads:[~2004-04-05 23:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-03 12:12 .zshrc sanity check Thorsten Kampe
2004-04-05 18:59 ` Oliver Kiddle
2004-04-05 23:33   ` Thorsten Kampe

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