-
zinitのインストール
bash -c "$(curl --fail --show-error --silent --location https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"exec zshでシェルを再起動。zinit self-updateでzinitを初期化,
~/.zshrcの末尾にzinitのロード設定が書いてあることを確認する。 -
zinit経由でプラグインをインストール
~/.zshrcの末尾に以下を記述。.zshrczinit light zsh-users/zsh-autosuggestions zinit light zsh-users/zsh-completions zinit light zsh-users/zsh-syntax-highlightingexec zshでシェルを再起動したタイミングでプラグインは ~/.local/share/zinit/plugins/ にインストールされる。オプションやサブコマンドの補完を有効化する。
.zshrcautoload -Uz compinit compinit -
starshipを導入
brew install starship~/.zshrcの末尾に以下を記述。.zshrc# Initialize Starship prompt eval "$(starship init zsh)"exec zshでシェルを再起動。 -
モダンな
lsコマンド。ezaをいれる。brew install ezaこの後に
以下からNerdFontを好きなものをダウンロードしてFontBookで登録する。
https://www.nerdfonts.com/font-downloadsそして,ターミナルにフォントを設定する。
VS codeのターミナルを使っている人は以下も設定する。settings.json"terminal.integrated.fontFamily": "'0xProto Nerd Font'"lsコマンドをオーバーライドする。.zshrc# Use eza instead of ls alias ls='eza --icons --group-directories-first --color=always' alias ll='eza -lh --icons --group-directories-first' alias la='eza -lha --icons --group-directories-first'treeコマンドも定義しておくと便利。.zshrcalias tree='eza --tree --icons --group-directories-first' alias lt='eza --tree --git-ignore --icons --group-directories-first' -
touch ~/.hushloginで ログインメッセージを一切非表示 にする。
ここからは+αの設定
-
fzf-tabを入れる。
brew install fzfzinitでプラグイン追加。
.zshrczinit light Aloxaf/fzf-tabezaと色を合わせるため以下の設定を追加。
.zshrc# --- fzf-tab preview with eza and bat --- zstyle ':fzf-tab:*' fzf-preview '' zstyle ':fzf-tab:*' fzf-flags --preview-window=hidden zstyle ':fzf-tab:complete:(cd|ls|cat|less|vim|nvim|nano|emacs|code|bat|exa|eza|cp|mv|rm):*' fzf-preview '[[ -d $realpath ]] && eza --color=always --icons --tree -L 1 --git-ignore --group-directories-first -- $realpath || bat --style=numbers --color=always --line-range=:400 -- $realpath 2>/dev/null || head -400 -- $realpath' zstyle ':fzf-tab:complete:(cd|ls|cat|less|vim|nvim|nano|emacs|code|bat|exa|eza|cp|mv|rm):*' fzf-flags --preview-window='right:50%:wrap'