zimfw / completion

Enables and configures smart and extensive tab completion.
MIT License
37 stars 10 forks source link

Use zstyle for configuration #1

Closed ericbn closed 6 years ago

ericbn commented 6 years ago

instead of "global" environment variables.

From the "(z)style" glossary entry of From Bash To The Z Shell:

style

In zsh, the style mechanism is a flexible way of configuring shell add-ons that use functions, such as the completion system and editor widgets. Unlike variables they can be different in different contexts and unlike shell options they can take values. The mechanism is based on the command style.

ericbn commented 6 years ago

@Eriner, I want to use zstyle for all the zim configuration, as we already use in the git-info module. Two advantages are:

I'm taking advantage of zstyle also for the modules configuration in the new distributed code. For example, this is how you would define them:

zstyle ':zim' modules \
    zsh-autosuggestions directory environment git git-info history \
    input ssh utility completion zsh-syntax-highlighting history-substring-search

zstyle ':zim:module:zsh-autosuggestions' url zsh-users/zsh-autosuggestions
zstyle ':zim:module:zsh-syntax-highlighting' url zsh-users/zsh-syntax-highlighting

What do you think?

Eriner commented 6 years ago

Yes, this is fine. Let's take this off the master branch though -- I don't want to break anything for anyone else.

Eriner commented 6 years ago

Derp, this is in a module. LGTM.