28 lines
917 B
Bash
Executable file
28 lines
917 B
Bash
Executable file
#!/usr/bin/env zsh
|
|
|
|
# Indicate the shell explicitly
|
|
export FZF_SHELL="zsh"
|
|
|
|
# Ensure fzf is installed and get its path
|
|
if command -v fzf >/dev/null; then
|
|
export FZF_PATH="$(dirname "$(command -v fzf)")"
|
|
else
|
|
export FZF_PATH=""
|
|
fi
|
|
|
|
# Load fzf key bindings and completion for zsh
|
|
if command -v fzf >/dev/null; then
|
|
[ -f "$FZF_PATH/key-bindings.zsh" ] && . "$FZF_PATH/key-bindings.zsh"]
|
|
[ -f "$FZF_PATH/completion.zsh" ] && . "$FZF_PATH/completion.zsh"]
|
|
fi
|
|
|
|
# Load fzf theme if available
|
|
FZF_THEME_SCRIPT="$HOME/.local/bin/scripts/fzf_theme.sh"
|
|
if [[ -f "$FZF_THEME_SCRIPT" ]]; then
|
|
# If theme script is available, use it and add the default fzf options
|
|
export FZF_DEFAULT_OPTS="$($FZF_THEME_SCRIPT) --height 40% --layout=reverse --border"
|
|
else
|
|
# Set default options for fzf without any theme, with preview enabled for general use
|
|
export FZF_DEFAULT_OPTS="--height 40% --layout=reverse --border"
|
|
fi
|
|
|