-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation Idea #2
Comments
Sure I could improve the documentation to include some Before/After invocations and Null Plugin examples. Feel free to share some examples here and I'll look into including them. |
Before/After
## Before
zinit ice as"command" from"gh-r" mv"zoxide* -> zoxide" \
atclone"./zoxide init zsh > init.zsh" atpull"%atclone" src"init.zsh" nocompile'!'
zinit light ajeetdsouza/zoxide
## After
zinit ice as"command" from"gh-r" mv"zoxide* -> zoxide" \
eval"./zoxide init zsh"
zinit light ajeetdsouza/zoxide```
## Before
# trapd00r/LSCOLORS: https://zdharma.org/zinit/wiki/LS_COLORS-explanation/
zinit ice atclone"dircolors -b LS_COLORS > init.zsh" \
atpull"%atclone" pick"init.zsh" nocompile'!' \
atload'zstyle ":completion:*" list-colors “${(s.:.)LS_COLORS}”'
zinit light trapd00r/LS_COLORS
# dbrgn/tealdeer
_tldr-setting() {
tldr --update
local comp="$(tldr 2>/dev/null --list)"
echo "complete -W \"$comp\" tldr" > init.zsh
}
zinit ice as"command" from"gh-r" \
mv"tldr* -> tldr" atclone"_tldr-setting" atpull"%atclone" pick"init.zsh"
zinit light dbrgn/tealdeer
## After
# trapd00r/LSCOLORS
zinit ice wait"2" eval"dircolors -b LS_COLORS" \
atload'zstyle ":completion:*" list-colors “${(s.:.)LS_COLORS}”'
zinit light trapd00r/LS_COLORS
# dbrgn/tealdeer
zinit ice wait"2" as"command" from"gh-r" \
mv"tldr* -> tldr" atclone"./tldr --update" atpull"%atclone" \
eval'echo "complete -W \"$(./tldr 2>/dev/null --list)\" tldr"'
zinit light dbrgn/tealdeer Null Plugin Eval ## Before
# thefuck -- simple example
eval $(thefuck --alias)
# kubectl -- complex example
if [[ "${+commands[kubectl]}" == 1 ]]; then
eval $(kubectl completion zsh)
fi
## After
# thefuck
zinit ice id-as"thefuck_alias" eval"thefuck --alias"
zinit light zdharma/null
# kubectl
zinit ice id-as"kubectl_completion" has"kubectl" \
eval"kubectl completion zsh"
zinit light zdharma/null Will this be enough? |
Alright included some examples and linked this issue as a reference for more! |
Zinit Wiki
I think this is useful and worth mentioning in the official document.
Before/After
It's intuitive what kind of situation you need.
Null Plugin Eval
It is good to have an example when caching non-plugin things. (like with
id-as
)The text was updated successfully, but these errors were encountered: