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

About Tmux zoom feature #56

Closed
oblitum opened this issue Dec 30, 2014 · 12 comments
Closed

About Tmux zoom feature #56

oblitum opened this issue Dec 30, 2014 · 12 comments

Comments

@oblitum
Copy link

oblitum commented Dec 30, 2014

I'd like to put in discussion what would be the best behavior when you zoom a particular pane. For me it's a bit annoying when I'm in a zoomed pane and get out of zoom by accident when moving around buffers/panes.

Would it be possible/desirable to have vim-tmux-navigation disabled (both for tmux as for vim) when zoom is ON in a given pane? Because I find vim-tmux-navigation useful solely when zoom is off.

@keith
Copy link
Collaborator

keith commented Dec 30, 2014

Can you describe the case you don't like? Is this when you're zoomed in to a vim instance and try to move towards an edge?

@oblitum
Copy link
Author

oblitum commented Dec 30, 2014

@Keithbsmiley yes. It also applies when not using Vim too. Moving over the edge doesn't mean to go back to the zoomed out layout.

@oblitum
Copy link
Author

oblitum commented Dec 30, 2014

I know that when not using Vim is not an issue of the plugin though. But I'd like to know how to do it, nevertheless.

@keith
Copy link
Collaborator

keith commented Dec 30, 2014

It seems like using the default tmux mappings to go down when a pane is focused zooms out? Meaning that is the intended behavior when moving against an edge?

@oblitum
Copy link
Author

oblitum commented Dec 30, 2014

@Keithbsmiley yes indeed. Switching to default mappings for crossing over the edges, solely when zoomed in, would do it.

@christoomey
Copy link
Owner

Hello @oblitum, thanks for opening the discussion. Personally I'm 👎 on changing this behavior or making it configurable. I've always found this to be a nice feature of tmux. Changing this would mean deviating from the default behavior, and adding this behind a configurable option would add complexity that I would rather avoid in this already complicated setup (this would need to be implemented as part of the tmux bindings which are the most precarious aspect of the plugin).

That said, I've never run into this as an issue and when you raised you question I had to think why that was. My guess is it has to do with my workflow and how I handle tmux panes. The vast majority of the time I am in a 75/25 split with Vim occupying the 75. I only ever use zoom to review some scrollback in a secondary tmux pane, and never zoom the Vim pane itself.

Instead of zooming the Vim pane, I use a handful of other techniques to allow me to manage my screen space, particularly for Vim:

  1. Maximize split mapping in vim which allows me to quickly maximize a specific Vim pane, then easily rebalance all vim panes
  2. Break pane binding in tmux prompts for the pane number, then breaks it out to a new window
  3. Join pain binding in tmux allows me to join a pane from another window (useful to undo the break pane in 2 above)

Finally, if you're really interested in implementing this yourself, the following shell command will allow you to check if you are zoomed. You could hook this into the tmux bindings to short circuit when zoomed.

tmux display-message -p "#F" | grep -q "Z"

Hope this all helps.

@oblitum
Copy link
Author

oblitum commented Dec 31, 2014

Thanks for all the analysis @christoomey. I appreciate it. For my workflow it would be indeed useful because sometimes I have to have several panes to acomplish a given narrowed task, so I prefer to have panes instead of more windows, which I would be already using at a higher level of management.

@oblitum
Copy link
Author

oblitum commented Oct 25, 2015

Just wanted to report here that, for some reason, recently on Archlinux with an up to date tmux and vim-tmux-navigator, the plugin is behaving the way I wished. I'm forced to zoom out to tmux-navigate between panes.

blueyed added a commit to blueyed/vim-tmux-navigator that referenced this issue Jun 15, 2016
There were issues (e.g. christoomey#56) and pull requests (christoomey#65 and christoomey#104) to improve this
behavior, but they were mainly rejected because it breaks other use cases.

This PR adds an option that can be enabled to have the current behavior
(`let g:tmux_navigator_move_out_of_zoomed_tmux = 1`) by default, but it also
recognizes when the user tries to get out of the zoomed pane twice, and
then allows for it.
@blueyed
Copy link
Collaborator

blueyed commented Jun 15, 2016

See #133 for a fresh approach at this.

@oblitum
Copy link
Author

oblitum commented Jun 16, 2016

@blueyed thanks for letting me know... current behaviour for me is back as formerly explained in the issue, it seems I've learned to live with it, but if you got a fix I'll sure switch, I don't like the default.

@blueyed
Copy link
Collaborator

blueyed commented Jun 16, 2016

Yeah, try #133. It even let's you zoom out on 2nd invocation by default.
I think that's what @christoomey could live with even - but there's also a setting to get the current behavior.

@oblitum
Copy link
Author

oblitum commented Jun 16, 2016

Just trying.

blueyed added a commit to blueyed/vim-tmux-navigator that referenced this issue Jun 27, 2016
There were issues (e.g. christoomey#56) and pull requests (christoomey#65 and christoomey#104) to improve this
behavior, but they were mainly rejected because it breaks other use cases.

This PR adds an option that can be enabled to have the current behavior
(`let g:tmux_navigator_move_out_of_zoomed_tmux = 1`) by default, but it also
recognizes when the user tries to get out of the zoomed pane twice, and
then allows for it.
blueyed added a commit to blueyed/vim-tmux-navigator that referenced this issue Jul 7, 2016
There were issues (e.g. christoomey#56) and pull requests (christoomey#65 and christoomey#104) to improve this
behavior, but they were mainly rejected because it breaks other use cases.

This PR adds an option that can be enabled to have the current behavior
(`let g:tmux_navigator_move_out_of_zoomed_tmux = 1`) by default, but it also
recognizes when the user tries to get out of the zoomed pane twice, and
then allows for it.
blueyed added a commit to blueyed/vim-tmux-navigator that referenced this issue Feb 4, 2017
There were issues (e.g. christoomey#56) and pull requests (christoomey#65 and christoomey#104) to improve this
behavior, but they were mainly rejected because it breaks other use cases.

This PR adds an option that can be enabled to have the current behavior
(`let g:tmux_navigator_move_out_of_zoomed_tmux = 1`) by default, but it also
recognizes when the user tries to get out of the zoomed pane twice, and
then allows for it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants