Add move_buffer_{left,right,start,end}
commands
#11790
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #10278.
Default mapping: (let me know if you have better ideas)
move_buffer_left
:[[
move_buffer_right
:]]
move_buffer_start
:[{
move_buffer_end
:]}
#10077 was already closed as "encourag[ing] a more gui/mouse driven tab like workflow" but this is an even smaller and very straight-forward implementation.
If the Helix team truly wants to discourage this type of workflow this badly, why leave the
gn
/gp
commands in?#10278 shows there are a lot of users that would like this in Helix and personally at least I feel like I can get around faster by ordering my buffers spatially than by searching for them in a normally hidden menu every time I want to get to a different one.
With the ordered approach I just always know where my file is, it doesn't keep changing, so I know exactly which commands I need to use to get to it, without opening the buffer picker and scanning through it.
Implementation
I added
indexmap
as a dependency for a simple drop-in-place implementation.I believe that a
Vec
should really be enough instead of anyHashMap
-like container, but after no responses from the team to my question on this matter, and a lot of friction in my attempts to switch aHashMap
with aVec
due to how many places it was used in, I decided it's better to add a dependency than give up on this feature.goto_buffer
(used bygoto_buffer_prev
,goto_buffer_next
) is also now noticeably faster with very highcount
s (which was never a real use case but)