[mini.pick] emulating emacs M-x find-file with a custom picker
#2523
Replies: 3 comments 5 replies
|
For the statusline, I've fixed this for both my minibuffer.nvim plugin (outdated) and your msgarea.nvim plugin. Take a look at |
|
Thanks for sharing! I really like the idea of "interactively traverse directory tree without pressing
This probably works as expected since the cache is done per prompt (concatenated query) by caching matching indexes. If it shows items like it does, then they were the ones used for the first time the prompt was cached. It is also reset after every
Not sure. My guess would be that this has something to do with extmark priority and/or the fact that this is inline text. In both cases it might matter in which order the extmarks were added. Haven't really looked deep into this kind of interaction in 'mini.pick'.
This looks like a responsibility of custom match function. I.e. it should be smart enough to know how to prioritize this kind of "treat Also the |
Uh oh!
There was an error while loading. Please reload this page.
hello again
minienjoyers,I've been working on my own little plugin that handles opening persistent and ephemeral windows in the msgarea and one of the main use cases was emulating the emacs "minibuffer" with mini.pick. I wanted to see if I could create an
M-x find-filepicker and it turned out pretty good :).The main behavior I wanted to capture:
~or//sends you to home and root dir, but keeps a history of previously typed queries so that when you clear current query, previous query is restoredchoosewhen the current query doesn't match anything should:editthat query as a pathls -lcolumnsmini_pick_findfile_demo.mp4
Here's the code (about ~250 LOC, but a lot is just comments and styling)
For jumping to a file in
cwdI thinkMiniPick.builtin.files()is still far superior, but I really like this picker as an:editreplacement and when I need to quickly jump to root/home dir or any dir outside ofcwd. I know there's alsoMiniExtra.pickers.explorer(), but there you have to press enter many times to move through directories.mini.pickis really nice to use, I had fun tinkering :)A few notes / things I couldn't do yet:
Weird
options.use_cache = truebehavior (bug?)I'm not sure why this happens, but when
options.use_cacheis on, a weird bug occurs - typing a full directory name relists all items and current match ends in the wrong position. It happens when backspacing or finishing a directory name in query... see vid:findfile_usecache_bug.mp4
So I just forced
options.use_cache = falsefor this picker and implemented my own little cache.Why does extmark with
virt_text_pos = "inline"at col 0 not get line hl?My "size" column in the picker doesn't get highlighted with
MiniPickMatchCurrentlike the rest of the line, but when I go to preview and back, it's fixed... any idea why?findfile_extmark_demo.mp4
How to autocomplete truncated paths?
There was one feature from

M-x find-fileI'm not sure how to implement... When you type truncated paths for example~/.c/n/l, the items listing will automatically update to match paths that have those first chars. For example in emacs it looks like this:I have no idea how to implement this. Would I need to use a fuzzy finding algorithm?
Also completely separate question, but do you know if there is any simple way to keep the
Statuslinehighlight on the current window target of the picker? I uselaststatus = 2so I like theStatuslineNChighlight to dim non-current window, but I don't want my current window statusline to switch to non-current highlight while inside a picker.All reactions