Skip to content

More descriptive alias #499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

oldfatcrab
Copy link

This is my quick and dirty way to solve the problem mentioned in #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

@Sneethe
Copy link

Sneethe commented Jun 15, 2025

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

This is my quick and dirty way to solve the problem mentioned in Aloxaf#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 oldfatcrab reopened this Jun 15, 2025
@oldfatcrab
Copy link
Author

oldfatcrab commented Jun 15, 2025

@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
Copy link
Author

oldfatcrab commented Jun 15, 2025

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants