diff --git a/.gitignore b/.gitignore index 4477544..585c491 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ Brewfile.lock.json *cache .idea .vscode +config/fzf diff --git a/base/bashrc b/base/bashrc index 5be2806..eadf101 100644 --- a/base/bashrc +++ b/base/bashrc @@ -19,3 +19,5 @@ x-load-configs # Import ssh keys in keychain ssh-add -A 2>/dev/null; + +[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash ] && source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash diff --git a/base/zshrc b/base/zshrc index 386bc8f..5a8d238 100644 --- a/base/zshrc +++ b/base/zshrc @@ -41,3 +41,5 @@ have antigen && { # starship is present have starship && eval "$(starship init zsh)" + +[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh ] && source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh diff --git a/config/fzf/fzf.bash b/config/fzf/fzf.bash index ebf72a7..8abce08 100644 --- a/config/fzf/fzf.bash +++ b/config/fzf/fzf.bash @@ -1,13 +1,13 @@ # Setup fzf # --------- -if [[ ! "$PATH" == */opt/homebrew/opt/fzf/bin* ]]; then - PATH="${PATH:+${PATH}:}/opt/homebrew/opt/fzf/bin" +if [[ ! "$PATH" == */Users/ivuorinen/.config/fzf/bin* ]]; then + PATH="${PATH:+${PATH}:}/Users/ivuorinen/.config/fzf/bin" fi # Auto-completion # --------------- -[[ $- == *i* ]] && source "/opt/homebrew/opt/fzf/shell/completion.bash" 2> /dev/null +[[ $- == *i* ]] && source "/Users/ivuorinen/.config/fzf/shell/completion.bash" 2> /dev/null # Key bindings # ------------ -source "/opt/homebrew/opt/fzf/shell/key-bindings.bash" +source "/Users/ivuorinen/.config/fzf/shell/key-bindings.bash" diff --git a/config/fzf/fzf.zsh b/config/fzf/fzf.zsh index be24395..9e5c44a 100644 --- a/config/fzf/fzf.zsh +++ b/config/fzf/fzf.zsh @@ -1,13 +1,13 @@ # Setup fzf # --------- -if [[ ! "$PATH" == */opt/homebrew/opt/fzf/bin* ]]; then - PATH="${PATH:+${PATH}:}/opt/homebrew/opt/fzf/bin" +if [[ ! "$PATH" == */Users/ivuorinen/.config/fzf/bin* ]]; then + PATH="${PATH:+${PATH}:}/Users/ivuorinen/.config/fzf/bin" fi # Auto-completion # --------------- -[[ $- == *i* ]] && source "/opt/homebrew/opt/fzf/shell/completion.zsh" 2> /dev/null +[[ $- == *i* ]] && source "/Users/ivuorinen/.config/fzf/shell/completion.zsh" 2> /dev/null # Key bindings # ------------ -source "/opt/homebrew/opt/fzf/shell/key-bindings.zsh" +source "/Users/ivuorinen/.config/fzf/shell/key-bindings.zsh" diff --git a/local/bin/dfm b/local/bin/dfm index 29e5b0d..462684a 100755 --- a/local/bin/dfm +++ b/local/bin/dfm @@ -50,6 +50,7 @@ function section_install $0 brew install $0 install composer $0 install dotenv + $0 install fzf $0 install gh $0 install go $0 install imagick @@ -73,6 +74,10 @@ function section_install | sh -s -- -b "$XDG_BIN_HOME" \ && msg_yay "dotenv-linter installed!" ;; + fzf) + bash "$DOTFILES/scripts/install-fzf.sh" \ + && msg_yay "fzf installed!" + ;; gh) bash "$DOTFILES/scripts/install-gh-extensions.sh" \ && msg_yay "github cli extensions installed!" diff --git a/scripts/install-fzf.sh b/scripts/install-fzf.sh new file mode 100755 index 0000000..804ad93 --- /dev/null +++ b/scripts/install-fzf.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Install fzf +# +# shellcheck source=shared.sh +source "$HOME/.dotfiles/scripts/shared.sh" + +FZF_GIT="https://github.com/junegunn/fzf.git" +FZF_PATH="${XDG_CONFIG_HOME}/fzf" + +if [ ! -d "$FZF_PATH" ]; then + git clone --depth 1 "$FZF_GIT" "$FZF_PATH" + $FZF_PATH/install --xdg --all --no-update-rc +else + msg_done "fzf ($FZF_PATH/) already installed" +fi +