1

I'll explain what I mean. Suppose I've created a horizontal split and then zoomed the top pane.

Then when I'm pressing C-w-l bounded to select-pane -R (I'm using vim and TmuxNavigator plugin to 'seamless' navigation between tmux and vim panes) tmux would unzoom pane and the active pane would remain the same. I don't like that.

If I would press C-w-j bounded to select-pane -D tmux would unzoom and make bottom pane active which I like very much.

How can I disable the first behaviour while saving the second?

1 Answer 1

1
+50

You would have to replace your bindings on the binds you want to have the zoom after pressing. You would need to add the resize-pane -Z command directly after the normal behavior of the key. For example if C-<prefix>-l is normally bound to select-pane -L you would change it to select-pane -L ; resize-pane -Z. You can do this with the following command.

:bind-key -T prefix l select-pane -L\; resize-pane -Z

Note: You need to escape the ; otherwise tux will interpret resize-pane -Z as its own command after bind-key

3
  • Okay, so first of all adding resize-pane -Z after select-pane -L messes tmux somehow and it start to showing something like random letters instead of terminal. But even if this would work properly, I don't think that this is the answer to my question. Imagine I would have two windows in vertical split and then zommed into the left one, then pressed C-w-l. Tmux would unzoom right pane and bring me to the left one and then it would zoom into left one, which isn't what I want. Nov 22, 2016 at 11:45
  • @user1685095 did you give it a try? It all happens so fast you can't visually tell. Nov 22, 2016 at 11:49
  • I told you I did. Tmux screwed the terminal completely after that. It's not about speed it's about wrong logic. If there is a pane in the left I want to switch to it. If there isn't I want to stay in zoom. And what your solution would do AFAIK is it would switch me to the left pane and zoom into it. What I need is a way to determine if there is a window next to the current. Nov 22, 2016 at 11:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .