Closed jghauser closed 2 years ago
I think this would not be trivial to implement, as vim does not seem to be able to distinguish between press and release events:
(There is also a workaround for this kind of problem mentioned in the answer section of the Stackoverflow question)
Incidentally, I'm working on a feature, which maybe is and an adequate solution to this. It will make it possible to switch the buffer immediately in the last_used
mode also. This way you would be always directly in the buffer you have selected in Cybu (like in the default mode).
But for this to work and not to pollute the last used history, there is a little more work involved. So it will probably take a while.
In the meantime I can only recommend reducing the display_time
parameter, so you don't have to wait so long :)
Oh, a shame neovim doesn't distinguish between key press and release. Thanks for explaining that. I also found this neovim core issue, though it doesn't seem to be very active. Hopefully at some point the feature will see the light of day! :)
I'm really looking forward to the new feature you're planning. Does that have anything to do with the changes you just implemented (I'm not quite sure I understand the immediate
/on_close
and rolling
/paging
functionalities)?
What might also be useful in combination with switching buffers immediately would be to dim the buffers when the cybu floating window is present. This would make that window stand out much more. I'm imagining something like what hop does or what shade.nvim wants to do for floating windows generally. Incidentally shade.nvim doesn't work with cybu (nothing gets dimmed when the cybu window is open), do have any idea why that might be the case?
Given that this feature requires a change in upstream -- and a change that might very well never be implemented -- feel free to close this issue if you want.
You are right, a few more details in the docs regarding this new options wouldn't hurt. They are in fact the precursor to the mentioned feature.
The immediate
option enables instant buffer switching (as soon as the focus in the cybu window moves to the new list entry), in contrast to the on_close
option, which lets cybu switch the buffer only when the cybu window closes.
Right now, using the immediate
option for the last_used
mode will pollute your buffer history, which makes it a bit less useful. To make this right, there needs to be an additional history of last used buffers curated by the plugin, and there is the complexity (at least I think so).
The rolling
view type displays the focus and buffers list like a slot machine
(see previews in the readme for the default mode) and the paging
view type partitions the list (wandering focus over a static segment of the last used list). Before this options, one was stuck with immediate
& rolling
behavior for the default
mode and with on_close
& paging
for the last_used
mode. Now you can have all combinations for both modes.
I really like your idea with dimming the background when cybu is open, and will look into how it might be resolved that cybu and shade.nvim don't work well together.
Thanks a lot for all the explanations! It was mostly my mistake for tripping over British vs. American bahavior/behaviour when editing my config :facepalm:.
I hope the dimming thing will work! :)
Btw (and sorry for the change of topic): Would u consider also making the highlight of cybu's float's border configurable? Currently, it uses whatever FloatBorder is set to, but it would be nice to be able to adjust that.
Thanks again for the great work!
EDIT: Note that shade.nvim seems unmaintained. However, I've managed to get it to work mostly fine with just a few changes, and a PR with those is pending in the shade.nvim repo. I might consider forking eventually if the creator doesn't pick it up again.
Cool that you managed to fix this! I will see how it develops and maybe mention that it is possible to do this with shade.nvim in the readme.
On the window border issue: I have pushed a commit to main that allows you to customize the highlight group of the window border via:
config = {
style = {
highlights = {
border = "YourHLGroup",
},
},
Great, thanks a lot!
Thanks for the really useful plugin, I've been enjoying it a lot! :)
Is it possible to switch to the buffer immediately after releasing all keys? I'm using the 'most recent' feature with the default keybinds ("J", "K"), which means I press shift+j/k to select the entry. What would be brilliant is if I could keep shift pressed while moving up/down the list with j/k. Once I have arrived at the desired entry, I release shift and cybu switches to the selected buffer. In this case the limited
display_time
would also not be needed, making things easier if you're having to hunt a bit for the relevant buffer name. Can this already be achieved? If not, would this be a feature you'd like to see in your plugin?Thanks!