From 0655039766028108ef21e270bc376c311cc59ad7 Mon Sep 17 00:00:00 2001 From: Hyuga Tsukui Date: Tue, 2 Apr 2024 20:55:24 +0900 Subject: [PATCH] install fzf --- .chezmoidata.yaml | 4 ++-- dot_zshrc.tmpl | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.chezmoidata.yaml b/.chezmoidata.yaml index 5304ce4..166bd51 100644 --- a/.chezmoidata.yaml +++ b/.chezmoidata.yaml @@ -4,6 +4,7 @@ packages: - 'homebrew/cask-versions' - 'homebrew/cask-fonts' brews: + - 'fzf' - 'gh' - 'git' - 'jq' @@ -12,7 +13,6 @@ packages: - 'zsh-autosuggestions' - 'zsh-completions' casks: + - 'font-ricty-diminished' - 'wezterm-nightly' - - 'font-cousine-nerd-font' - - 'font-fira-code-nerd-font' diff --git a/dot_zshrc.tmpl b/dot_zshrc.tmpl index a702c2c..34d214f 100644 --- a/dot_zshrc.tmpl +++ b/dot_zshrc.tmpl @@ -13,6 +13,15 @@ setopt auto_menu # 補完キー(Tab, Ctrl+I) を連打するだけで順に setopt auto_param_slash # パラメータ展開時に末尾のスラッシュを自動で補完する zstyle ':completion:*' list-colors di=34 fi=0 # 補完候補の色を設定 +eval "$(fzf --zsh)" + +# incremental git switch +fsw() { + local branches branch + branches=$(git branch -vv) && + branch=$(echo "$branches" | fzf +m) && + git switch $(echo "$branch" | awk '{print $1}' | sed "s/.* //") +} # https://volta.sh/ export VOLTA_HOME="$HOME/.volta"