.bashrc erweitert um fzf

This commit is contained in:
2026-01-10 10:16:35 +01:00
parent b2dcd13266
commit f387118832
2 changed files with 21 additions and 2 deletions

20
.bashrc
View File

@@ -6,7 +6,7 @@
# /_/ \_\_|
#
# Beschreibung: .bashrc
# letzte Änderung: 21.06.2025
# letzte Änderung: 10.01.2026
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
@@ -79,6 +79,24 @@ PS1='\[\033[1;34m\]\w\[\033[0m\] \[\033[0;32m\]\[\033[0m\] '
eval "$(starship init bash)"
eval "$(zoxide init bash)"
# Set up fzf key bindings and fuzzy completion
# CTRL-Y to copy the command into clipboard using pbcopy
export FZF_CTRL_R_OPTS="
--bind 'ctrl-y:execute-silent(echo -n {2..} | pbcopy)+abort'
--color header:italic
--header 'Press CTRL-Y to copy command into clipboard'"
# Preview file content using bat (https://github.com/sharkdp/bat)
export FZF_CTRL_T_OPTS="
--walker-skip .git,node_modules,target
--preview 'bat -n --color=always {}'
--bind 'ctrl-/:change-preview-window(down|hidden|)'"
# Print tree structure in the preview window
export FZF_ALT_C_OPTS="
--walker-skip .git,node_modules,target
--preview 'tree -C {}'"
eval "$(fzf --bash)"
source $HOME/.profile
neofetch