barbar.nvim icon indicating copy to clipboard operation
barbar.nvim copied to clipboard

Feature: named tabpages

Open dpetka2001 opened this issue 10 months ago • 2 comments

It would be awesome if you could provide a command for renaming Neovim tab pages just like bufferline's BufferLineTabRename command. It's really useful when using Neovim tabs to separate workflow based on projects instead of terminal native tabs or something like tmux.

That might also include a redesign of how tab pages are shown at the top right corner. Not sure how much of a hassle that would be, but I just thought to make this feature request regardless and leave it up to you if it's something worth considering or not.

dpetka2001 avatar Feb 03 '25 17:02 dpetka2001

It doesn't sound like a big change, though I don't use that feature enough to have interest in implementing it. We can leave the issue open in case someone wants to contribute it.

romgrk avatar Feb 03 '25 22:02 romgrk

Could nvim_buf_set_name do this? E.g.

vim.keymap.set('n', '<Leader>br', function()
  vim.ui.input(
    {
      prompt = 'Rename buffer',
      default = vim.api.nvim_buf_get_name(0),
    },
    function(input)
      vim.api.nvim_buf_set_name(0, input)
    end
  )
end)

Note I just wrote that on my phone so it might not execute, but it hopefully gets the gist across.


Edit: misread, this request is for tabpages, not buffers edit(romgrk): s/tabs/tabpages/, line above

Iron-E avatar Feb 04 '25 02:02 Iron-E