brew: fzf

This commit is contained in:
2023-04-22 14:56:34 +03:00
parent 775d2abf13
commit e929b85669
4 changed files with 38 additions and 0 deletions

View File

@@ -73,6 +73,8 @@ brew "fd"
brew "freetds"
# Monitor a directory for changes and run a shell command
brew "fswatch"
# Command-line fuzzy finder written in Go
brew "fzf"
# Disk usage analyzer with console interface written in Go
brew "gdu", link: false
# GitHub command-line tool

View File

@@ -49,4 +49,14 @@ if [ "$SHELL" = "$(which zsh)" ]; then
export HISTFILE="$XDG_STATE_HOME/zsh/history"
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/zcompcache"
zstyle ':completion:*' list-colors "$LS_COLORS"
# fzf
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh ] \
&& source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh
fi
# If we are using bash
if [ "$SHELL" = "$(which bash)" ]; then
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash ] \
&& source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash
fi

13
config/fzf/fzf.bash Normal file
View File

@@ -0,0 +1,13 @@
# Setup fzf
# ---------
if [[ ! "$PATH" == */opt/homebrew/opt/fzf/bin* ]]; then
PATH="${PATH:+${PATH}:}/opt/homebrew/opt/fzf/bin"
fi
# Auto-completion
# ---------------
[[ $- == *i* ]] && source "/opt/homebrew/opt/fzf/shell/completion.bash" 2> /dev/null
# Key bindings
# ------------
source "/opt/homebrew/opt/fzf/shell/key-bindings.bash"

13
config/fzf/fzf.zsh Normal file
View File

@@ -0,0 +1,13 @@
# Setup fzf
# ---------
if [[ ! "$PATH" == */opt/homebrew/opt/fzf/bin* ]]; then
PATH="${PATH:+${PATH}:}/opt/homebrew/opt/fzf/bin"
fi
# Auto-completion
# ---------------
[[ $- == *i* ]] && source "/opt/homebrew/opt/fzf/shell/completion.zsh" 2> /dev/null
# Key bindings
# ------------
source "/opt/homebrew/opt/fzf/shell/key-bindings.zsh"