j-morano/buffer_manager.nvim

How to navigate to "next" buffer?

paulrouget opened this issue · 6 comments

I love this plugin! Thank you so much :)

As far as I can tell, reordering buffers only changes how buffers are displayed in this plugin. Using :bn to navigate buffer will still use the neovim buffer ordering.

I use <tab> to move to the next buffer (which calls :bn), what would be the proper mapping to reproduce the same behavior but based on buffer_manager ordering?

Hi, I have just added two functions to go the next and previous buffers in the buffer_manager list. In your case, you can use the nav_next function this way:

map('n', '<Tab>', require("buffer_manager.ui").nav_next, {noremap = true})

Thanks for your feedback. I will close the issue once it is confirmed that everything works as expected.

This is working great! Thank you :)

Hi! Is it possible to preselect the alternative buffer in the list? I hate pressing <C-^> (this is three keys for me on my keyboard with one hand) to toggle between buffers. I'd like to open the list and hit CR to open the alternative buffer.

I could implement the feature, but why not just add a custom remap for the alternate buffer? I use one myself:

local map = vim.keymap.set
opts = {noremap = true}

map('i', '<M-w>', '<ESC>:e#<CR>a', opts)
map('n', '<M-w>', ':e#<CR>', opts)

It is faster than using the plugin (and built-in).

Thanks but I don't like messing with builtin maps. The reason I asked is because this is native behavior for Telescope and I'm used to it. It's so intuitive and the only feature I like in Telescope.

I will take a look, although I am not very convinced, as I still think it is better to use built-in remaps for that.
Anyway, that question is not related to this issue and, as it seems that the added functionality regarding this issue is correct, I will close it.
You can open another issue, so I can reach you if I implement the feature. Thanks.