-
Notifications
You must be signed in to change notification settings - Fork 32
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
Extend plugin to optionally move to prev/next tab when at edge of screen. #39
Comments
Hi! I was able to achieve this thanks to a lot of help from page-down over on the Kitty discussions page, and wanted to post what I have. Please note that I'm not even good enough at programming to call myself a novice, so I feel certain this could be polished and done more cleanly. Especially in my if/elif/else section in pass_keys.py. I'm sure it can be done more succinctly.... There is also the issue that, say you have 2 splits in grid layout (or any layout other than vertical and stacks) in tab 1 and you navigate from tab 2 to tab 1 using this modification, it will open tab 1 with the focus in the window that was last active and not necessarily the tab closest from the direction you came from. Ideally if you're coming into tab 1 from tab 2 (previous_tab) it would automatically focus on the far-right window rather than just last active. If coming in from the right (next_tab) then it should focus to the left-most window. I suppose it also needs some way to select the new behavior versus the original behavior. Not sure what the best way to do that is. pass_keys.py
neighboring_window.py
|
Hey @mwpardue , thanks for the thoughtful contribution! Please feel free to open a draft pull request with your changes. |
@knubie Thanks for that! Only, I assume it needs some method of selecting this behavior or original, not everybody is going to want to cycle through tabs like I do. How would you recommend that choice be handled? |
I would like to see the plugin extended so that, if you have navigated to a window at the far edge of the screen and press the kitten key in that same direction it moves to the corresponding previous or next tab. For instance, if I move to the far right window and press my "vim-kitty-navigator right" keybind again then it will activate the next_tab action instead.
I'm trying to figure out how to do this myself, but I am not much of a programmer (trying to learn) and definitely don't know python. If somebody could help me with how to determine if there are no neighboring windows in the direction pressed then I think I could do the rest, I just can't figure out that part.
Edit: edited for clarity, had wrong action in description.
The text was updated successfully, but these errors were encountered: