ghillb / cybu.nvim

Neovim plugin that offers context when cycling buffers in the form of a customizable notification window.
MIT License
305 stars 5 forks source link

Feature request: be able to keep the buffers at the same place in the list #5

Closed tyrossel closed 2 years ago

tyrossel commented 2 years ago

Hi, thank you for your plugin, it works very well.

When using it, I have some trouble to focus on the filenames, as they are always change when cycling through the list. For me at least, it would be more interesting to keep the names at the same position in the list, and change the position of the highlight instead.

I guess it would still have to keep the same behavior when the buffer list is longer than the window height.

ghillb commented 2 years ago

Hi, glad to hear that it is useful!

This is something that I'm adding in conjunction with #3. Feel free to test it on the feat.cycle_last_used branch.

It currently only works with the "history" cycle mode and not the default mode. But since most people seem to prefer that mode anyways, you maybe don't mind.

After installing the branch, you would have to set two new mappings for this though:

vim.keymap.set("n", "<a-s-tab>", "<plug>(CybuHistoryPrev)")
vim.keymap.set("n", "<a-tab>", "<plug>(CybuHistoryNext)")

Beware that the exemplary keys <a-s-tab> and <a-tab> do not work for all terminals out of the box, and you would have to change them, if this is the case for you.

This will soon be in the main branch. But first I have to fix a bug, that is inconsistently occurring when triggering the window in short succession.

tyrossel commented 2 years ago

The new feature branch fit me perfectly. I think I also prefer with the history cycle mode, even though I'll have to get used to it.

I mapped the new functions respectively to <Tab> and <S-Tab>, so no need to configure Kitty to pass them to the shell.

Thanks a lot for the nice work, good luck with the bug fixing !

ghillb commented 2 years ago

Fixed with #6.