From 6128f92326c409e57ac17a7c37cfcb933af2acde Mon Sep 17 00:00:00 2001 From: punkfairie <23287005+punkfairie@users.noreply.github.com> Date: Sat, 10 Feb 2024 18:48:15 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20fzf=20improvements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ cli/fzf.config.fish | 15 +++++++++++++++ fish/.config/fish/functions/fm.fish.symlink | 5 +++++ fish/theme.config.fish | 6 ------ 4 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 cli/fzf.config.fish create mode 100644 fish/.config/fish/functions/fm.fish.symlink diff --git a/README.md b/README.md index 9fe5014..fd89419 100644 --- a/README.md +++ b/README.md @@ -62,3 +62,5 @@ dotfile repos: [signing-git-commits](https://gist.github.com/phortuin/cf24b1cca3258720c71ad42977e1ba57) [Correct_GnuPG_Permission](https://gist.github.com/oseme-techguy/bae2e309c084d93b75a9b25f49718f85) + +[A Practical Guide to fzf](https://thevaluable.dev/practical-guide-fzf-example/) diff --git a/cli/fzf.config.fish b/cli/fzf.config.fish new file mode 100644 index 0000000..3c80fb1 --- /dev/null +++ b/cli/fzf.config.fish @@ -0,0 +1,15 @@ +#!/usr/bin/env fish + +set -gx FZF_DEFAULT_CMD 'rg --files --hidden --glob "!.git"' + +set -gx FZF_DEFAULT_OPTS "\ +--margin=10%,5% \ +--border=sharp \ +--pointer=' ' \ +--marker=' ' \ +--prompt=' ' \ +--preview-label-pos='bottom' \ +--preview-window='border-sharp' \ +--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 \ +--color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc \ +--color=marker:#f5e0dc,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8" diff --git a/fish/.config/fish/functions/fm.fish.symlink b/fish/.config/fish/functions/fm.fish.symlink new file mode 100644 index 0000000..5708167 --- /dev/null +++ b/fish/.config/fish/functions/fm.fish.symlink @@ -0,0 +1,5 @@ +#!/usr/bin/env fish + +function fm --wraps=fzf -d "Use fzf as a simple file viewer" + find . -type d | fzf --preview='eza --color=always -T {} | head -n 50' +end diff --git a/fish/theme.config.fish b/fish/theme.config.fish index 1d97654..b9ffb51 100644 --- a/fish/theme.config.fish +++ b/fish/theme.config.fish @@ -9,9 +9,3 @@ set -g man_underline -u f5c2e7 magenta # Starship set -gx STARSHIP_CONFIG "$DOT/fish/starship.toml" starship init fish | source - -# fzf -set -Ux FZF_DEFAULT_OPTS "\ ---color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 \ ---color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc \ ---color=marker:#f5e0dc,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8"