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

Add set_layout helper to allow easy use of Tmux's select-layout command #33

Open
jimeh opened this issue Feb 27, 2014 · 4 comments
Open

Comments

@jimeh
Copy link
Owner

jimeh commented Feb 27, 2014

Example with layout string copied from the list-windows command:

set_layout "61de,238x73,0,0{118x73,0,0,1,119x73,119,0[119x36,119,0,2,119x36,119,37,3]}"
select_pane 0
run_cmd "htop"
select_pane 1
run_cmd "sensors"
select_pane 2

This could be useful when relying on one Tmux's five built-in layouts, or if often making small adjustments to a specific window layout. Instead of adjusting split_v and split_h commands, you can just get the layout string from tmux list-windows and paste it in.

@abelcheung
Copy link

A "me too" here as first time user, finding that select-layout support is something to be desired. It would be also nice to be able to specify how many panes to be splitted when using the 5 default layouts as well.

@jimeh
Copy link
Owner Author

jimeh commented Mar 3, 2014

I haven't used select-layout much, but I'm assuming what you mean is that Tmuxifier would add/remove panes till the window had the desired number of panes, and then apply your specified default layout right? :)

@abelcheung
Copy link

There are 2 cases to be considered. First one is exactly what you described: for a fixed layout, it is desirable to add/remove panes until it matches with the layout string.

Second case is for layout not fixed ahead. In tmux speak it is like:

splitw
splitw
splitw
.......[more splitw]........
select-layout main-vertical

So a hypothetical setting of set_layout main-vertical [n] can automatically create a layout with a single large pane on left side and n-1 panes on right side, without need to add any split_[vh].

@leesei
Copy link
Contributor

leesei commented Jun 16, 2015

This will help #9.

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

3 participants