-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Goto buffer by num #8198
Goto buffer by num #8198
Conversation
Thanks for implementing this! It looks to me like And I think it would be okay if |
I think for larger numbers we could just min it with the amount of buffers and then any higher number would just bring you to the last one, then we don't have to special case 9 you can just use something like 999 to go to the last buffer. Also mentioning this pr: #4756 so they are linked |
I wanted to apply the same behavior of Chrome and Firefox tabs. But I think your approaches are good.
|
I wanted to try this out with this key mapping: [keys.normal.space]
1 = ":buffer-index 1"
2 = ":buffer-index 2"
3 = ":buffer-index 3"
4 = ":buffer-index 4"
5 = ":buffer-index 5"
6 = ":buffer-index 6"
7 = ":buffer-index 7"
8 = ":buffer-index 8"
9 = ":buffer-index 9"
0 = ":buffer-index 10" but I realized this doesn't work at the moment because of this issue: (Only Nevertheless, I think this is a good PR! |
#8471 has been merged, so it should now be possible to use |
I don't think we will be going forward with this one. The bufferline and the "gui like ordered tabs" workflow is not a priorty. We focus on picker baswd navigation instead. The current buffer ordering is an implementation detail and I would like to not make users rely on it with commands or introsuce somekind of manual order (buffer picker is sorted by most recently used by contrast which I much prefer). Sorry we didn't give you that kind of feedback sooner. Thank you for contributing! |
I don't think anyone expects the order to be fixed, but the current internal order is always visible in the bufferline, so I don't see the problem there. (If the order in the bufferline changes after, e.g., opening a new buffer, that seems completely fine.) I don't think you realize just how much of a mental overhead there is for using a buffer picker if you've never had it set up such that you can switch buffers at the blink of an eye. You can set it up in (n)vim that the buffers are shown in a bufferline and numbered – you then only need the barest glance at the bufferline and then you type space+num, or whatever your shortcut is, and you're immediately there. You never leave your editing flow. A buffer picker on the other hand, requires some kind of context change in your brain: a new menu appears mid-screen, you have to parse what it says, you have to find the buffer you're looking for, you have to type potentially multiple letters to select the right one. As someone used to a numbered bufferline with quick switching, I can tell you the buffer picker workflow feels very cumbersome every time I have to use it. |
The buffer picker is exactly the issue because it changes so much as you work through multiple files. Being able to jump around without reading or typing the buffer name saves time and maintains focus. Right now I open the files I'll work on in some specific order (there's no way to order the bufferline manually) and |
@obedm503 On PR #8875 I proposed that the "amp-like" jumping to other locations should extended other windows: #8875 (comment) If implemented, it would also directly jumping to other buffers, at the ones that have some of their content or name visible. |
Implement the select buffer by index :
:buffer-index <number>
:bi <number>
:buffer-first
:buffer-last