Repository navigation
Replies: 1 comment
|
Thanks for the suggestion!
It would have been better for that goal indeed. Unfortunately, one of 'mini.pick' goals (as any 'mini.nvim' module) is to balance features and maintainability. Allowing this type of flexibility in the
Writing own version of
It was considered, yes. And it was discarded, yes. For example, in #1082. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I recently switched from other pickers to Mini.pick and I'm loving it so far. When using it for my neovim config is perfect out of the box, but for work projects the way files are displayed is inconvenient since my files have paths that are too long (java devs should know 🙈), and so I'm missing a feature I had in snacks picker and that I've been able to implement in others:
changing the display of files to be
basename pathand givingpatha grey highlight (likeNonTextfor example).Looking into the documentation I was able to find a way to do this: provide a custom
source.showfunction, but this quickly grew too much: to do simple things, it is manageable, but to replicate the default behavior (icons, match highlights, current line highlight, case sensitivity, etc) it is too much work for a user defined option imo.So, I made an experiment modifying the code: use an optional parameter
item_to_stringwhich should be a function that takes the item, and returns a table with the line text and highlightsExample:
To make this work, I had to modify
mini.pickto handle this parameter in thedefault_showfunction by calling theitem_to_stringfunction for every line, then applying the highlights at the end.Demo:
Screen.Recording.2026-04-03.at.00.57.48.mov
I think having something along those lines would be helpful to make it easier to customize the pickers.
Is there already an easy way to do this, that would let me write something similar to my example (without having to re-implement
MiniPick.default_show)?This is just me wondering what it would take to implement this for myself, and I have no idea if this has been considered before and discarded, but I would love to have this in mini.pick!
All reactions