Skip to content
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

feat: enable switching to the next and previous float terminal #368

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Blackmorse
Copy link
Contributor

TL;DR

Introducing of ToggleTermFloatNext/ToggleTermFloatPrev commands for the float terminals. Just switching to the next/previous terminal id from the list in a cycled manner.

Motivation

Since I usually use float windows 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 count feature 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/backward

After 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 :)

@beem812

This comment was marked as spam.

Copy link
Owner

@akinsho akinsho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

@Blackmorse
Copy link
Contributor Author

@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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants