Navigator.nvim icon indicating copy to clipboard operation
Navigator.nvim copied to clipboard

Option to move between panes "circularly"

Open mrjones2014 opened this issue 3 years ago • 7 comments

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 😅

mrjones2014 avatar Mar 18 '22 13:03 mrjones2014

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

numToStr avatar Mar 18 '22 13:03 numToStr

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)

mrjones2014 avatar Mar 18 '22 13:03 mrjones2014

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

numToStr avatar Mar 18 '22 14:03 numToStr

Amazing, thanks! that worked perfectly.

mrjones2014 avatar Mar 18 '22 15:03 mrjones2014

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

declancm avatar Apr 07 '22 13:04 declancm

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.

mrjones2014 avatar Apr 07 '22 13:04 mrjones2014

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

numToStr avatar Apr 07 '22 15:04 numToStr