hkupty / nvimux

Neovim as a TMUX replacement
Apache License 2.0
445 stars 17 forks source link

Last tab shortcut #33

Closed devth closed 5 years ago

devth commented 5 years ago

Nice plugin :)

I'm exploring ditching tmux right now and am missing the <prefix>-l shortcut to go to the last tab I was at. Could that be supported in nvimux?

Note: this is different than :tablast which literally takes you to the last (endmost) tab in the list of tabs. Tmux's interpretation of "last" means switching to the tab you were previously at, e.g. switching back and forth between tab 3 and tab 5. I'm not sure if vim natively supports this notion.

hkupty commented 5 years ago

Hi,

I'm glad you're liking it so far and thanks for opening this issue.

I believe this is feasible, yes. Either through a default command or something or, if that's not possible, by tracking the last tab you switched to through autocommands or something similar.

Cheers, Henry

hkupty commented 5 years ago

Hey @devth, I sort of solved the issue you mentioned. It works as expected, but I have a clash on the mappings.

By default, <prefix>hjkl is mapped to window navigation. So Instead, I mapped it to <prefix>- (analogous to cd - moving you back to previous working directory). While that works, I feel I failed to accomplish your issue because of that clash.

Is it important more that <prefix>l does this or that the functionality is available? You can genuinely answer this because the goal of this plugin is to reduce the friction between using tmux+{neo,}vim to only neovim.

Thank you very much for the suggestion.

Cheers, Henry

devth commented 5 years ago

This is great! I think <prefix>- is a very good alternative, and no it's not essential that <prefix>l does this.

hkupty commented 5 years ago

Perfect! I'm merging it right now through #34.

Thanks a lot!