nvim-lualine / lualine.nvim

A blazing fast and easy to configure neovim statusline plugin written in pure lua.
MIT License
6.19k stars 466 forks source link

Feat: Enumerate buffer tabs in tabline #603

Closed nkakouros closed 2 years ago

nkakouros commented 2 years ago

Requested feature

Similar to other buffer line extensions, it would be useful to have custom numbering for buffers in the buffer line, instead of using the internal buffer number of nvim.

Motivation

The buffer number increments for the life time of a vim session. This could lead to large numbers if the session is long lived. This makes it cumbersome to select the desired buffer and only really saves an :ls for the user. It also makes it hard to jump to the first buffer in the buffer line as you need to know the buffer number. If buffer tabs where numbered sequentially, the first tab would be 1 always.

I understand that this request is more complex than it appears, since in order to make use of these sequential numbers custom mappings will need to be provided by the plugin to select a specific buffer which will take care of the translation between sequential number and internal buffer number. But, it would greatly improve the usability.

shadmansaleh commented 2 years ago

This is something we can definitely add. Any one interested in making a pr with this ?

Also can you elaborate on what you mean by custom mappings ? I think providing a vim command like we currently provide for naming tabs (LualineRenameTab) would be sufficient.

nkakouros commented 2 years ago

Yes, sure, a vim command would work great. My thought was that regardless of how the functionality gets presented to the user (mapping, command, lua function, ...), there is more to implementing this feature other than just enumerating the tabs in the UI. The tab selection mechanism will also need to be implemented, which may be more than what the title of this feature request asks for.

shadmansaleh commented 2 years ago

The tab selection mechanism will also need to be implemented

Not sure what you mean by tab selection ??

nkakouros commented 2 years ago

The equivalent of :buffer X but using the custom numbering (instead of the internal buffer number).