-
-
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
[feat] Add commands for moving between splits with a direction #860
Conversation
This doesn't exactly follow a direction, it just goes to next/prev but doesn't wrap around. I think what we want would be the equivalent of ctrl-w h/j/k/l in vim which will move to the next visual direction. For example if I have two splits stacked vertically on the left, and a split on the right, moving to the right wouldn't focus the bottom-most split first but instead move to the rightmost one. Equivalent code from sway, although I think I found a better function for it previously |
@archseer Yes you are right I actually belived the neovim behaved the same way until I tested it (usually do not have horizontal splits) I can try to fix this in a bit |
@archseer I'm still working on this. When testing with more complex splits I wasn't happy with my current solution in this pr because it didn't behave the way I would expect as a user. I have a new solution which is more accurate in what you'd expect by looking at the splits visually. I'll update this pr when I've completed it and cleaned it up. |
Now I cleaned up, it works significantly better now and always matches the movement you'd expect by looking at the splits visually so I'm much more happy with this solution even if it is a bit more complicated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 🎉
Ah, looks like there's a small conflict with master. Can you resolve it? Then we should be good to merge |
@archseer Fixed 👍 |
Add new commands for moving between splits in a specified direction (up, down, left, right). It is something that I find really convenient in neovim when I have more than 2 splits open at the same time.
This makes it possible to add the following keymapping: