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

FZF Like Anchors/Selectors #44

Open
joshuarubin opened this issue Sep 17, 2021 · 5 comments
Open

FZF Like Anchors/Selectors #44

joshuarubin opened this issue Sep 17, 2021 · 5 comments

Comments

@joshuarubin
Copy link

This plugin is great! One thing I really miss though is that since this is implemented essentially as a sorter (with underlying matching done just with substrings) I lose all the intelligence of the grammar I have with my default sorter (fzf-native). Primarily, I miss being able to use ^ (consecutive chars at the beginning of the match), ' (consecutive chars anywhere in the match) and $ (consecutive chars at the end of the match.

Is there any way I can regain this functionality? Thanks!

@Conni2461
Copy link
Member

You can just override the sorter. This for example to set your configured default file sorter

:lua require'telescope'.extensions.frecency.frecency{ sorter = require('telescope.config').values.file_sorter() }

@joshuarubin
Copy link
Author

joshuarubin commented Sep 17, 2021

Interesting. This works, but the displayed results are shortened, though I'm only able to match against absolute paths, so I always have to match with things like ^/ even though that might not be displayed in the result.

Edit: using the command:

require("telescope").extensions.frecency.frecency({ sorter = require("telescope").extensions.fzf.native_fzf_sorter() })

@lougreenwood
Copy link

I wonder if the sorter could be a config option instead?

@FelipeLema
Copy link

FelipeLema commented Jul 15, 2022

#44 shows how to use other sorter

if you're using https://github.com/natecraddock/telescope-zf-native.nvim , after setup, you can use the following code to use zf as sorter (prioritizes basename/file_name)

    require  'telescope'.extensions.frecency.frecency({
      sorter = require  'telescope.config'.values.file_sorter(),

require 'telescope.config'.values.file_sorter is modified by telescope-zf-native, so this is actually another sorter that we're using (not get_fzy_sorter). But, anyway... it gives you an idea of how to use a non-default sorter with this extension

@mizlan
Copy link

mizlan commented Apr 23, 2023

@FelipeLema thanks for that, i was actually wondering exactly how to use this with zf-native :)

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

No branches or pull requests

5 participants