summaryrefslogtreecommitdiffstats
path: root/.config/fzf
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-05-04 08:44:50 +0200
committerThomas Vanbesien <tvanbesi@proton.me>2026-05-06 16:43:16 +0200
commit0bc002288b984d8ec8123c135456570c78a22da3 (patch)
tree020ed3f6a7f28a081687a3e46ea190e3aa724f7c /.config/fzf
downloaddotfiles-0bc002288b984d8ec8123c135456570c78a22da3.tar.gz
dotfiles-0bc002288b984d8ec8123c135456570c78a22da3.zip
feat: initial setup
- `dotfiles` (this project's CLI) - foot configuration - tmux configuration - bash configuration - nvim (as a git submodule) + configuration - ranger configuration - fzf configuration - KDE global shortcuts - Other miscellaneous dependencies
Diffstat (limited to '.config/fzf')
-rw-r--r--.config/fzf/fzf.bash69
1 files changed, 69 insertions, 0 deletions
diff --git a/.config/fzf/fzf.bash b/.config/fzf/fzf.bash
new file mode 100644
index 0000000..f567a6d
--- /dev/null
+++ b/.config/fzf/fzf.bash
@@ -0,0 +1,69 @@
+# ——————————————————————————————————————————————————————————————————————————————
+# fzf configuration
+#
+# See https://github.com/junegunn/fzf
+# ——————————————————————————————————————————————————————————————————————————————
+
+fzf_default_usage='Alt+Y copy to clipboard
+Alt+/ move/hide preview'
+fzf_ctrl_t_usage='Ctrl+Y select
+Alt+Y copy to clipboard
+Alt+/ move/hide preview'
+fzf_ctrl_r_usage='Alt+R show surrounding entries
+Ctrl+R sort by relevance/recency
+Alt+Y copy to clipboard'
+fzf_alt_c_usage='Alt+Y copy to clipboard
+Alt+/ move/hide preview'
+
+# This is used by the Ctrl+T, Ctrl+R, and Alt+C bindings, unless redefined
+export FZF_DEFAULT_OPTS="
+--walker file,dir,follow,hidden
+--walker-skip .git,node_modules
+
+--bind tab:down,btab:up
+--bind 'alt-y:execute-silent(wl-copy {..})+abort'
+--bind 'alt-/:change-preview-window(down|hidden|)'
+
+--layout reverse --height 50%
+--color header:italic
+--footer '$fzf_default_usage'
+"
+
+# ——————————————————————————————————————————————————————————————————————————————
+# Ctrl+T, Ctrl+R, Alt+C function options
+#
+# See https://github.com/junegunn/fzf#key-bindings-for-command-line
+# ——————————————————————————————————————————————————————————————————————————————
+
+# (Ctrl+T) Paste the selected files and directories onto the command-line
+export FZF_CTRL_T_OPTS="
+--walker file,follow,hidden
+--preview 'bat --number --color=always {}'
+--bind ctrl-y:toggle
+--bind 'alt-/:change-preview-window(down|hidden|)'
+--footer '$fzf_ctrl_t_usage'
+"
+
+# (Ctrl+R) Paste the selected command from history onto the command-line
+export FZF_CTRL_R_OPTS="
+--bind 'alt-y:execute-silent(wl-copy {2..})+abort'
+--footer '$fzf_ctrl_r_usage'
+"
+
+# (Alt+C) `cd` into the selected directory
+export FZF_ALT_C_OPTS="
+--walker dir,follow,hidden
+--preview 'tree -C {}'
+--bind 'alt-/:change-preview-window(down|hidden|)'
+--footer '$fzf_alt_c_usage'
+"
+
+# ——————————————————————————————————————————————————————————————————————————————
+# ** fuzzy completion
+#
+# See https://github.com/junegunn/fzf#customizing-fuzzy-completion-for-bash-and-zsh
+# ——————————————————————————————————————————————————————————————————————————————
+
+# ——————————————————————————————————————————————————————————————————————————————
+
+eval "$(fzf --bash)"