LoginSignup
1
0

More than 1 year has passed since last update.

M1 Mac + zplug + prezto な環境で enhancd が有効にならない

Last updated at Posted at 2022-05-22

環境

OS: macOS Monterey 12.2.1
チップ: Apple M1
zsh: 5.8 (x86_64-apple-darwin21.0)
zplug: 2.4.2

現象

zplug 経由で enhancd を install したが、 enhancd を利用できない。
この現象が M1 固有かは未検証です。

.zshrc
export ZPLUG_HOME=~/.zplug
source $ZPLUG_HOME/init.zsh

zplug "b4b4r07/enhancd", use:init.sh
export ENHANCD_FILTER=peco
zplug "sindresorhus/pure"

if ! zplug check; then
    zplug install
fi

zplug load

if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
  source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi

原因

詳細は不明です、、、。

おそらく source .zprezto/init.zsh に原因があることまではわかりました。
source .zprezto/init.zsh をコメントアウトすると enhancd を利用できます。
が、その先を調べきれていません。

とりあえず下記の解決策を試したら直ったので共有です。

解決策

zplug よりも前に prezto を初期化する。

.zshrc
# 1. 先に prezto を初期化
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
  source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi

# 2. 次に zplug を初期化
export ZPLUG_HOME=~/.zplug
source $ZPLUG_HOME/init.zsh

zplug "b4b4r07/enhancd", use:init.sh
export ENHANCD_FILTER=peco
zplug "sindresorhus/pure"

if ! zplug check; then
    zplug install
fi

zplug load

おわりに

原因がわからないというなんともむず痒い形ですが、待望の enhancd が利用できたので良しとします。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0