ドキュメントを読みましたが、翻訳したzinitコードが機能しませんでした。私は彼らのzinitドキュメントが非常に混乱していることに気づきました。
どのzpluguse
がzinit言語で参照されているかわかりません。例:
zplug "mafredri/zsh-async", from:github, use:async.zsh
zplug "junegunn/fzf-bin", as:command, from:gh-r, rename-to:fzf, use:"*${(L)$(uname -s)}*amd64*"
zplug "junegunn/fzf", use:"shell/*.zsh"
zplug "peco/peco", as:command, from:gh-r, use:"*${(L)$(uname -s)}*amd64*"
私はzinitに変換しました:
zinit light "mafredri/zsh-async" pick "async.zsh"
しかし、それはエラーを与えました:No such (plugin or snippet) directory: mafredri/zsh-async/pickasync.zsh
。私は疑問src
とmultisrc
。どちらがに似てrename-to
いるかもわかりません。と思いますがid-as
、よくわかりません。
defer
zinit言語でzplugに似たオプションが見つかりませんでした:
zplug "zdharma/fast-syntax-highlighting", defer:2
depth=2
代わりに使用するのが正しいかどうかはわかりません。
zinitのドキュメントで見つけられなかったもう1つの同様のオプションは、次のとおりですhook-load
。
zplug "larkery/zsh-histdb", use:"{sqlite-history,histdb-interactive}.zsh", hook-load:"histdb-update-outcome"
複数のプラグインをzinitの構文for
に変換しますが、正しく翻訳する方法がわかりません。
zplug "plugins/common-aliases", from:oh-my-zsh
zplug "plugins/copydir", from:oh-my-zsh
zplug "plugins/cp", from:oh-my-zsh
zplug "plugins/encode64", from:oh-my-zsh
zplug "plugins/extract", from:oh-my-zsh
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/golang", from:oh-my-zsh, if:"(( $+commands[go] ))"
zplug "plugins/npm", from:oh-my-zsh, if:"(( $+commands[npm] ))"
zplug "plugins/sudo", from:oh-my-zsh, if:"(( $+commands[sudo] ))"
zplug "plugins/systemd", from:oh-my-zsh, if:"(( $+commands[systemctl] ))"
zplug "plugins/urltools", from:oh-my-zsh
zplug "tcnksm/docker-alias", use:zshrc
私はzinitに翻訳しました:
zinit wait lucid for \
OMZ::plugins/common-aliases \
OMZ::plugins/copydir \
OMZ::plugins/cp \
OMZ::plugins/encode64 \
OMZ::plugins/extract \
OMZ::plugins/git \
OMZ::plugins/golang if "[[ $+commands[go] ]]" \
OMZ::plugins/npm if "[[ $+commands[npm] ]]" \
OMZ::plugins/sudo if "[[ $+commands[sudo] ]]" \
OMZ::plugins/systemd if "[[ $+commands[systemd] ]]" \
OMZ::plugins/urltools \
OMZ::tcnksm/docker-alias pick "zshrc"
またzplug check
、zinit言語と同様のオプションがあるかどうかも知りたいです。例:
if zplug check "junegunn/fzf-bin"; then
export FZF_DEFAULT_OPTS="--height 40% --reverse --border --inline-info --color=dark,bg+:235,hl+:10,pointer:5"
fi
use
はZinitpick
です:https://github.com/zdharma/zinit#selection-of-files-to-source-defer
はZinitwait
です:https://github.com/zdharma/zinit#conditional-loadinghook-load
は同等のものはありませんが、次のように解決できます。zinit light-mode for pick'sqlite-history.zsh' \
atload'autoload -Uz add-zsh-hook && add-zsh-hook precmd histdb-update-outcome' \
larkery/zsh-histdb
zinit wait lucid for \
OMZ::plugins/common-aliases \
OMZ::plugins/copydir \
OMZ::plugins/cp \
OMZ::plugins/encode64 \
OMZ::plugins/extract \
OMZ::plugins/git \
if"[[ $+commands[go] ]]" OMZ::plugins/golang \
if"[[ $+commands[npm] ]]" OMZ::plugins/npm \
if"[[ $+commands[sudo] ]]" OMZ::plugins/sudo \
if"[[ $+commands[systemd] ]]" OMZ::plugins/systemd \
OMZ::plugins/urltools \
pick"zshrc" tcnksm/docker-alias
check
は同等のものはありませんが、次のように解決できます。zinit from"gh-r" as"program" for \
atload'export FZF_DEFAULT_OPTS="--height 40% --reverse --border --inline-info --color=dark,bg+:235,hl+:10,pointer:5"' \
junegunn/fzf-bin
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加