feat: enable switching to the next and previous float terminal#368
feat: enable switching to the next and previous float terminal#368Blackmorse wants to merge 2 commits intoakinsho:mainfrom
Conversation
This comment was marked as spam.
This comment was marked as spam.
There was a problem hiding this comment.
@Blackmorse though I like this idea, I'm not sure if it should be specialized to floats alone. I don't want to have custom commands depending on the UI of a terminal, ideally. I think this should be a command that cycles between all terminals that have a matching layout e.g. if it's a split then this command should cycle through all terminals which are splits, if it is float then cycle through all floats
Bonus points would be a command like
ToggleTermCycleNext direction=float
and the default could be
ToggleTermCycleNext direction=match, this would cycle through all terminal with a matching direction
and without the direction argument, then
ToggleTermCycleNext would just cycle any non-hidden terminal regardless of direction
|
@akinsho , that for the feedback a lot I like the way you want to unify this plugin, and it is the first thing I've tried to implement. However, non-floating terminals are quite different and I stuck with some ambiguous behaviour, and therefore implemented it only for floating windows which looks natural here. It would be nice If you can give me an advice how it should work. First question that I remember: how cycling should work for the hidden splits? In case split terminal is hidden, should it appear when cycling through? (For floating windows it's exactly the point) |
TL;DR
Introducing of ToggleTermFloatNext/ToggleTermFloatPrev commands for the
floatterminals. Just switching to the next/previous terminal id from the list in a cycled manner.Motivation
Since I usually use
floatwindows for the terminals, in my flow I'm missing the feature of "switching to the previous/next terminal".E.g. It's common for me to have 3 terminals at the same time, and switching between them with the
countfeature is not very convenient, as I have to keep in mind some kind of mapping of the terminal number to its actual state. I'd like to switch between them just by going forward/backwardAfter Neovim 0.9 release and together with this feature (#363) process of switching will become even more transparent for the user.
It's my first experience in Lua/Neovim development, so don't judge me too much, I will be happy to fix any notes and issues :)