Skip to content
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

feat: add path_display support with a default value #24

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

qw457812
Copy link

@qw457812 qw457812 commented Jul 15, 2024

  • Add default path_display to:
    1. Replace home dir with ~ to make path shorter.
    2. Truncate long path.
    3. Filename highlighting.
  • Add show_score opt, default to true.
  • Add previewer opt, uses terminal tree previewer via eza/tree, can be disabled by user via previewer = false.
zoxide-preview

Copied some codes from gczcn's fork, telescope-z.nvim and petobens's dotfiles.

@jvgrootveld
Copy link
Owner

Ty for your contribution. I was a little absent lately due to different things. I just want to let everyone know will check all Open issues and PR's shortly.

@qw457812
Copy link
Author

Sorry for the mess about commit history. I'm new to GitHub and didn't know new commits will be associated with this PR...

About 2 newer commits, I just made the same mistake as I did a few days ago, forgot that set previewer = nil can not disable the previewer...

In this PR, I think there should be a way for user to disable previewer. How about revert to this commit which use use_default_previewer opt?

Sorry for the mess again. I'd like to recreate a PR using a new branch if you think that's better.

@qw457812
Copy link
Author

I just found out that setting previewer = false can disable the previewer, I think the use_default_previewer opt is no longer needed.

@jvgrootveld
Copy link
Owner

@qw457812 Haha no problem. I use git more than a decade now, and still learn new things (or make stupid mistakes).

Your PR is quite the change. I see that some ideas are also addressed in the open PR's #16, #19 and #20. I just reviewed all of those and if you don't mind I will wait for those to be updated with my comments and merged. After that I want to discuss your ideas for new and updated features.


To explain a little of why new changes are going into this PR: You made a PR from a copy branch on your account (fork) which basically says "I want to merge the changes on my copy to you". If you add new changes to your copy (commits), those also reflects in the PR because you want to merge a branch into this. Not one single commit.

Easier is to create a new feature/bugfix branch on your main fork which should contain only the changes you want to merge back.

@jvgrootveld jvgrootveld added the enhancement New feature or request label Jul 31, 2024
@jvgrootveld jvgrootveld self-assigned this Jul 31, 2024
@qw457812
Copy link
Author

@jvgrootveld Thanks for the explanation and welcome back!

I don't mind at all, looking forward to discussing with you.

My starting point for this PR is that I want make the path shorter to see whole file name. Then curious about why telescope.defaults.path_display option has no effect.
Then I found telescope-z.nvim's docs about path_display and related code.

The eza previewer is actually a personal choice. By the way, it can also fallback to lsd before tree. I use it only because vim_buffer_cat, from PR #16, is too wide to show full content for my 16-inch MacBook. They both seem like good previewers to me. It's totally up to you.

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

Successfully merging this pull request may close these issues.

2 participants