[mini.pick] Augment Pick buffers with hotkeys
#1096
Replies: 2 comments 3 replies
-
|
That's a nice idea! To be perfectly honest, I'd say that code look a bit too complex for what it eventually achieves. I especially wouldn't recommend the My mind immediately went in the direction of making a more general
|
Beta Was this translation helpful? Give feedback.
-
|
Good work on this, I do think a hybrid would be interesting to investigate although i personally never really exceed 20 buffers |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
pick_labeled_buffers.mp4
My workflow regarding buffer navigation is centered around grapple.nvim. I do use
Pick buffersoften. Usually, itsquerycontains more than one character, followed byenter. It would be nice to only type one single "hotkey", inJump2dfashion.Trying my hand on this requirement has been on my
todo-listfor some time. Recently, plugin snipe.nvim was announced on reddit, reminding me on that "todo".I tried to incorporate
Jump2dintoPickin various ways. No cigar unfortunately. The mainPickwindow disappears beforeJump2dhas a chance to kick-in.In my opinion, there exists a sweet spot between the amount of opened buffers and the benefit accomplished by using a "hotkey". When the amount of buffers is considerable, the best approach is to narrow down the list using default
Pick buffers. Pluginsnipe.nvimuses multiple pages in that situation, a less optimal approach.I took the code from Pick buffers and implemented Pick labeled_buffers
Algorithm:
If the amount of labels can be used to add "hotkeys" to all buffer items, the labels are highlighted. Otherwise, the labels are dimmed, but they are still available for faster navigation.
Pickoperates as usual in that case.The straightforward matching algorithm provided by
Picksimplified the implementation.Just add a unique letter before the text representing the buffer, and done.
For now, I centered the
pickwindow, to more closely resemble the centeredgrapplewindow. Also, as the text representing the buffer can be lengthy, I surrounded the text with the labels.The code:
Beta Was this translation helpful? Give feedback.
All reactions