-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move tab functionality #8
Comments
Yes, it would be great if that worked. The reason it doesn’t is because this plugin doesn’t care about tabs at all, it shows buffers. And you can’t change the order of buffers in Vim. It would be possible to make this plugin show buffers in an order that’s different from Vim’s own buffer list. To implement that I would have to keep an own buffer list in the plugin. This would require machinery to make sure the plugin’s buffer list stays up to date when buffers are deleted or created. It would also require UI (mostly, new commands) to allow moving buffers around in the plugin’s list. So this is a fairly big feature, possibly as big as the entire plugin already is. But it’s the need for extra UI that’s the worst part, much more than the code complexity. I would be more inclined to ask the NeoVim people how feasible it is to implement a feature to move or swap buffers in the actual buffer list. (And if they get it done, ask Bram if that feature can be copied in Vim.) That would solve the problem in one place, for all uses of the buffer list. If that doesn’t pan out, I would tend in the direction of a separate plugin which provides the move-things-around layer over the buffer list, that multiple other plugins could then use. I’m leaving this open for now but I don’t plan to work on it. |
Opened neovim/neovim#7558 |
@ap so I raised the neovim issue, and it was closed immediately. Sooks like a separate buffer list in a plugin is the only option. |
I saw. I don’t know if I’ll ever get around to writing one. I think I don’t want to write a plugin that maintains a list outside of Vim’s own mechanisms, because then I’d have to invent an API, which seems very doubtful that it would be adopted by other plugins (maybe if I were Tim Pope or something… and even then), as well as UI, meaning that users would have to switch from So I briefly considered using the argument list instead of the buffer list (if the user flips a setting), because that one is built into Vim, and unlike the buffer list, it can be reordered any way you want. The drawback is, you can’t add non-existent files (i.e. new buffers and scratch buffers) to it – all of the entries in the argument list are actual paths by necessity (though the files need not yet exist). So by itself it would be a nonstarter – but I tried to think of some way of working around that which would allow using it for this purpose. So far I got nothing though. (Also, Vim has this weird concept of window-local argument lists. I don’t know of anyone ever using it, but… it’s there, and I have no idea whether I should support it, or if so, how.) So for now I remain at a loss. |
Hi 👋, recent Vim / Neovim daily driver here 🚙, and came across this plugin a while back (probably earlier this month) and a convert from using vim-airline. Couldn't help but think vim-airline was getting more bloated by each new update. 🤷♂️ I've really been enjoying the snappiness of this plugin, and can't help but think if the Neovim guys n gals don't want implement a feature to change the order of the buffers, then why not try and implement this feature as an opt-in feature for this plugin, ie. don't change the default behavior we have, but rather if one wants to change / rearrange the buffers on the tabline, then create a branch that has this experimental feature. That said, I can't help but think this seems like setting for a virtual buffer list. And can't help but think that it would be similar to how aliases work on a *nix filesystem, ie. we don't modify the original buffer number but rather create a dictionary that updates a pointer to the actual buffer. |
Hey there. Glad you enjoy the plugin. 😊 Your sense of how it would be implemented is not at all incorrect. It would indeed just be an array containing buffer numbers. That isn’t the hard part, though. It’s everything that follows from that. First thing the plugin will need after adding this array is new commands and/or bindings for switching to the next/previous buffer based on that array, to replace That’s a lot of non-Vim-standard, this-plugin-only stuff for new users to learn. Currently the plugin is super easy to adopt. There’s almost nothing you have to do. There’s a few settings you may tweak a bit, some slight differences in what various users prefer, but mostly, you just stick the plugin in your Vim setup and you’re done. (Even so, the documentation runs a couple pages… but users can completely ignore it.) If I add features to manage the order of buffers, that changes completely. Now the docs run 15 or 20 pages, and many more users will be reading at least some of the docs. That‘s my dilemma. The programming part is easy… it’s all code you can write while half asleep. It’s the product part that’s difficult. |
I appreciate this is WONTFIX, but leaving a comment for other users. Currently the only tabline plugin that appears to support this functionality is xtabline (https://github.com/mg979/vim-xtabline). It works as discussed by keeping an internal reference. There is a plugin for it if one is using airline. Unlike this plugin or airline (with default tabline) it doesn't support mapping to jump directly to a buffer/tab (e.g. 1-N). |
Hi, |
That does require less UI than manual moving of buffers. OTOH it requires more configurability… and I’m really unsure what level of flexibility would make this a broadly useful feature. In that regard it would be useful if you can cite any other existing Vim feature that does something related. |
As an avid |
Hi,
Can you please add the move functionality. Vim already has this for tabs with :tabmove but this dose not work your plugin. This is extremely useful when one has many tabs/buffers and wants to sort the order in the tabline.
This is the only thing missing form, otherwise, awesome plugin!
The text was updated successfully, but these errors were encountered: