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

Option to move between panes "circularly" #10

Open
mrjones2014 opened this issue Mar 18, 2022 · 7 comments
Open

Option to move between panes "circularly" #10

mrjones2014 opened this issue Mar 18, 2022 · 7 comments

Comments

@mrjones2014
Copy link

Not sure if the title makes sense, and actually not even sure this is possible with the Neovim API, but basically what I want is, if my cursor is in the leftmost split, and I call require('Navigator').left(), it should go to the rightmost split.

This already works this way with the tmux panes, but not with Neovim splits.

Example of how it works in tmux splits:

CleanShot-2022-03-18-at-09 19 51

vs. in Neovim splits

CleanShot-2022-03-18-at-09 22 28

Does that make sense? Not sure if I explained that too well 😅

@numToStr
Copy link
Owner

Navigating only between neovim splits is not the goal of this plugin but to move b/w nvim and tmux.

That being said, I won't promise you that i'll implement this but i can try and see if this feels home to me ;)

@mrjones2014
Copy link
Author

Awesome! Let me know if you figure out how to detect if we're currently in the leftmost/rightmost split inside Neovim, I wanted to figure that out for something else too (an idea I had for "smart" window resizing)

@numToStr
Copy link
Owner

Awesome! Let me know if you figure out how to detect if we're currently in the leftmost/rightmost split inside Neovim

You can do something like

prev_win --> wincmd h | l --> check cur_win == prev_win

I used the same logic to move out from neovim to tmux

@mrjones2014
Copy link
Author

Amazing, thanks! that worked perfectly.

@declancm
Copy link

declancm commented Apr 7, 2022

I implemented this in a repo fork if you ever want the feature added :)

@mrjones2014
Copy link
Author

Ended up implementing this functionality in my own smart-splits.nvim plugin, since I don't really use tmux splits often anymore. I mostly use tmux floating windows.

@numToStr
Copy link
Owner

numToStr commented Apr 7, 2022

@declancm I'll be happy to review a PR for it :)

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

No branches or pull requests

3 participants