fzf-tab icon indicating copy to clipboard operation
fzf-tab copied to clipboard

More descriptive alias

Open oldfatcrab opened this issue 1 year ago • 3 comments

This is my quick and dirty way to solve the problem mentioned in https://github.com/Aloxaf/fzf-tab/issues/394

Not even certain if this is the correct approach (not very efficient to me) - feel free to close mine and make another PR if a better approach exists.

Short demo: https://youtu.be/L-Yml_kN9eU

oldfatcrab avatar Dec 25 '24 07:12 oldfatcrab

This is a really neat feature. It however doesn't work when fzf-tab-source is used.

Can be tested with the following:

cd /tmp
cd "$(mktemp -d -- "${PWD}/tmp.XXXXXXXXXX")"
git clone https://github.com/oldfatcrab/fzf-tab
git clone https://github.com/Freed-Wu/fzf-tab-source

> minzshrc << 'EOF'
autoload -Uz compinit
compinit
zstyle ':completion:*:descriptions' format '[%d]'
alias tree='tree -a -I .git'
source fzf-tab/fzf-tab.plugin.zsh
source fzf-tab-source/fzf-tab-source.plugin.zsh
EOF

Then just run zsh -d -f and then: source minzshrc

tree will only show its alias content when fzf-tab-source is commented

Sneethe avatar Jun 15 '25 03:06 Sneethe

@Sneethe at first I thought it was my branch is too old but it wasn't caused by that.

I am not even certain that my change is proper because the searching is not (that) efficient.

My recommendation is to check how zstyle ':fzf-tab:complete:*:*' fzf-preview is set in fzf-tab-source.

On my machine I set it like this

So the preview for directories works for me like: Screenshot 2025-06-15 at 01 22 05

oldfatcrab avatar Jun 15 '25 08:06 oldfatcrab

@Sneethe Actually I just (briefly) went through the code of fzf-tab-source, and I think it is better for you to submit a feature request - I think a code change on that side could yield more sufficient result.

oldfatcrab avatar Jun 15 '25 08:06 oldfatcrab