Fix FZF integration in to ZSH
This commit is contained in:
27
zsh/.profile.d/fzf.sh
Normal file → Executable file
27
zsh/.profile.d/fzf.sh
Normal file → Executable file
@@ -1,8 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
is_debian_based() {
|
||||
# Checking /etc/os-release
|
||||
if [[ -f /etc/os-release ]]; then
|
||||
. /etc/os-release
|
||||
if [[ "$ID_LIKE" == *"debian"* ]] || [[ "$ID" == "debian" ]]; then
|
||||
return 0 # OK: Debian-based
|
||||
fi
|
||||
fi
|
||||
|
||||
# Alternative check: /etc/debian_version
|
||||
if [[ -f /etc/debian_version ]]; then
|
||||
return 0 # OK: Debian-based
|
||||
fi
|
||||
|
||||
return 1 # NO Debian-based
|
||||
}
|
||||
|
||||
# Add fzf keybindings and enhancements
|
||||
export FZF_CTRL_T_COMMAND="fd --type f"
|
||||
export FZF_ALT_C_COMMAND="fd --type d"
|
||||
if is_debian_based; then
|
||||
export FZF_CTRL_T_COMMAND="fdfind --type f"
|
||||
export FZF_ALT_C_COMMAND="fdfind --type d"
|
||||
else
|
||||
export FZF_CTRL_T_COMMAND="fd --type f"
|
||||
export FZF_ALT_C_COMMAND="fd --type d"
|
||||
fi
|
||||
|
||||
export FZF_CTRL_R_OPTS="--preview 'echo {}'"
|
||||
|
||||
# Export Catppuccin Mocha theme for FZF
|
||||
|
||||
Reference in New Issue
Block a user