Beter pane resizing mapping for tmux
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
My current pane resize mapping are
bind Left resize-pane -L 5
bind Down resize-pane -D 5
bind Up resize-pane -U 5
bind Right resize-pane -R 6
I have to type the key binding strokes and the arrow keys to resize the pane each time. That's stupid. How to into some sort of the resizing pane mode and only tapping the key arrows till the size is satisfied and then exit the resize pane mode.
What will be the command/key mapping for your to "Enter the pan and can change size by only the arrow key mode" and "Exit this mode"
Thanks
tmux
migrated from vi.stackexchange.com Aug 17 at 11:26
This question came from our site for people using the vi and Vim families of text editors.
add a comment |Â
up vote
0
down vote
favorite
My current pane resize mapping are
bind Left resize-pane -L 5
bind Down resize-pane -D 5
bind Up resize-pane -U 5
bind Right resize-pane -R 6
I have to type the key binding strokes and the arrow keys to resize the pane each time. That's stupid. How to into some sort of the resizing pane mode and only tapping the key arrows till the size is satisfied and then exit the resize pane mode.
What will be the command/key mapping for your to "Enter the pan and can change size by only the arrow key mode" and "Exit this mode"
Thanks
tmux
migrated from vi.stackexchange.com Aug 17 at 11:26
This question came from our site for people using the vi and Vim families of text editors.
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
My current pane resize mapping are
bind Left resize-pane -L 5
bind Down resize-pane -D 5
bind Up resize-pane -U 5
bind Right resize-pane -R 6
I have to type the key binding strokes and the arrow keys to resize the pane each time. That's stupid. How to into some sort of the resizing pane mode and only tapping the key arrows till the size is satisfied and then exit the resize pane mode.
What will be the command/key mapping for your to "Enter the pan and can change size by only the arrow key mode" and "Exit this mode"
Thanks
tmux
My current pane resize mapping are
bind Left resize-pane -L 5
bind Down resize-pane -D 5
bind Up resize-pane -U 5
bind Right resize-pane -R 6
I have to type the key binding strokes and the arrow keys to resize the pane each time. That's stupid. How to into some sort of the resizing pane mode and only tapping the key arrows till the size is satisfied and then exit the resize pane mode.
What will be the command/key mapping for your to "Enter the pan and can change size by only the arrow key mode" and "Exit this mode"
Thanks
tmux
tmux
asked Aug 17 at 7:08
SLN
1277
1277
migrated from vi.stackexchange.com Aug 17 at 11:26
This question came from our site for people using the vi and Vim families of text editors.
migrated from vi.stackexchange.com Aug 17 at 11:26
This question came from our site for people using the vi and Vim families of text editors.
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
Using existing keys
You might not need to add anything to your configuration at all. Here are the default bindings for resizing the panes (from :list-keys
):
bind-key -r -T prefix M-Up resize-pane -U 5
bind-key -r -T prefix M-Down resize-pane -D 5
bind-key -r -T prefix M-Left resize-pane -L 5
bind-key -r -T prefix M-Right resize-pane -R 5
bind-key -r -T prefix C-Up resize-pane -U
bind-key -r -T prefix C-Down resize-pane -D
bind-key -r -T prefix C-Left resize-pane -L
bind-key -r -T prefix C-Right resize-pane -R
That -r
option to bind-key
means they support repeat -- you can keep hitting C-Arrow or M-Arrow until you've finished resizing, without entering the prefix sequence again. The amount of time before this repeat mode times out is controlled by the repeat_time
option (default 500ms).
Binding with no prefix
If you want to avoid the prefix key entirely, you can use a different bind
table. From the bind-key section of the manpage:
By default (without -T), the key is bound in the prefix key
table. This table is used for keys pressed after the prefix key (for example, by default 'c' is bound to new-window in the prefix table, so 'C-b c' creates a new window). The root table is used for keys pressed without the prefix key: binding 'c' to new-window in the root table (not recommended) means a plain 'c' will create a new window. -n is an alias for -T root.
To bind directly into the root table:
bind-key -n C-Up resize-pane -U 5
bind-key -n C-Down resize-pane -D 5
bind-key -n C-Left resize-pane -L 5
bind-key -n C-Right resize-pane -R 5
Binding in copy mode
You suggested a dedicated mode for resizing. tmux
has no support for such custom modes, but it already has copy mode (by default, entered with prefix-[
and left with q
) in which keypresses can have different bindings, typically without the prefix. Unfortunately, binding multiword commands (including commands with arguments) in this mode isn't supported (see tmux issue 215). However, there is a workaround of testing #pane_in_mode
before doing anything. Based on the comments on that issue, and the above "bind with no prefix" solution:
bind-key -n C-Up if-shell -F "#pane_in_mode" "resize-pane -U 5" "send-keys C-Up"
bind-key -n C-Down if-shell -F "#pane_in_mode" "resize-pane -D 5" "send-keys C-Down"
bind-key -n C-Left if-shell -F "#pane_in_mode" "resize-pane -L 5" "send-keys C-Left"
bind-key -n C-Right if-shell -F "#pane_in_mode" "resize-pane -R 5" "send-keys C-Right"
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Using existing keys
You might not need to add anything to your configuration at all. Here are the default bindings for resizing the panes (from :list-keys
):
bind-key -r -T prefix M-Up resize-pane -U 5
bind-key -r -T prefix M-Down resize-pane -D 5
bind-key -r -T prefix M-Left resize-pane -L 5
bind-key -r -T prefix M-Right resize-pane -R 5
bind-key -r -T prefix C-Up resize-pane -U
bind-key -r -T prefix C-Down resize-pane -D
bind-key -r -T prefix C-Left resize-pane -L
bind-key -r -T prefix C-Right resize-pane -R
That -r
option to bind-key
means they support repeat -- you can keep hitting C-Arrow or M-Arrow until you've finished resizing, without entering the prefix sequence again. The amount of time before this repeat mode times out is controlled by the repeat_time
option (default 500ms).
Binding with no prefix
If you want to avoid the prefix key entirely, you can use a different bind
table. From the bind-key section of the manpage:
By default (without -T), the key is bound in the prefix key
table. This table is used for keys pressed after the prefix key (for example, by default 'c' is bound to new-window in the prefix table, so 'C-b c' creates a new window). The root table is used for keys pressed without the prefix key: binding 'c' to new-window in the root table (not recommended) means a plain 'c' will create a new window. -n is an alias for -T root.
To bind directly into the root table:
bind-key -n C-Up resize-pane -U 5
bind-key -n C-Down resize-pane -D 5
bind-key -n C-Left resize-pane -L 5
bind-key -n C-Right resize-pane -R 5
Binding in copy mode
You suggested a dedicated mode for resizing. tmux
has no support for such custom modes, but it already has copy mode (by default, entered with prefix-[
and left with q
) in which keypresses can have different bindings, typically without the prefix. Unfortunately, binding multiword commands (including commands with arguments) in this mode isn't supported (see tmux issue 215). However, there is a workaround of testing #pane_in_mode
before doing anything. Based on the comments on that issue, and the above "bind with no prefix" solution:
bind-key -n C-Up if-shell -F "#pane_in_mode" "resize-pane -U 5" "send-keys C-Up"
bind-key -n C-Down if-shell -F "#pane_in_mode" "resize-pane -D 5" "send-keys C-Down"
bind-key -n C-Left if-shell -F "#pane_in_mode" "resize-pane -L 5" "send-keys C-Left"
bind-key -n C-Right if-shell -F "#pane_in_mode" "resize-pane -R 5" "send-keys C-Right"
add a comment |Â
up vote
0
down vote
Using existing keys
You might not need to add anything to your configuration at all. Here are the default bindings for resizing the panes (from :list-keys
):
bind-key -r -T prefix M-Up resize-pane -U 5
bind-key -r -T prefix M-Down resize-pane -D 5
bind-key -r -T prefix M-Left resize-pane -L 5
bind-key -r -T prefix M-Right resize-pane -R 5
bind-key -r -T prefix C-Up resize-pane -U
bind-key -r -T prefix C-Down resize-pane -D
bind-key -r -T prefix C-Left resize-pane -L
bind-key -r -T prefix C-Right resize-pane -R
That -r
option to bind-key
means they support repeat -- you can keep hitting C-Arrow or M-Arrow until you've finished resizing, without entering the prefix sequence again. The amount of time before this repeat mode times out is controlled by the repeat_time
option (default 500ms).
Binding with no prefix
If you want to avoid the prefix key entirely, you can use a different bind
table. From the bind-key section of the manpage:
By default (without -T), the key is bound in the prefix key
table. This table is used for keys pressed after the prefix key (for example, by default 'c' is bound to new-window in the prefix table, so 'C-b c' creates a new window). The root table is used for keys pressed without the prefix key: binding 'c' to new-window in the root table (not recommended) means a plain 'c' will create a new window. -n is an alias for -T root.
To bind directly into the root table:
bind-key -n C-Up resize-pane -U 5
bind-key -n C-Down resize-pane -D 5
bind-key -n C-Left resize-pane -L 5
bind-key -n C-Right resize-pane -R 5
Binding in copy mode
You suggested a dedicated mode for resizing. tmux
has no support for such custom modes, but it already has copy mode (by default, entered with prefix-[
and left with q
) in which keypresses can have different bindings, typically without the prefix. Unfortunately, binding multiword commands (including commands with arguments) in this mode isn't supported (see tmux issue 215). However, there is a workaround of testing #pane_in_mode
before doing anything. Based on the comments on that issue, and the above "bind with no prefix" solution:
bind-key -n C-Up if-shell -F "#pane_in_mode" "resize-pane -U 5" "send-keys C-Up"
bind-key -n C-Down if-shell -F "#pane_in_mode" "resize-pane -D 5" "send-keys C-Down"
bind-key -n C-Left if-shell -F "#pane_in_mode" "resize-pane -L 5" "send-keys C-Left"
bind-key -n C-Right if-shell -F "#pane_in_mode" "resize-pane -R 5" "send-keys C-Right"
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Using existing keys
You might not need to add anything to your configuration at all. Here are the default bindings for resizing the panes (from :list-keys
):
bind-key -r -T prefix M-Up resize-pane -U 5
bind-key -r -T prefix M-Down resize-pane -D 5
bind-key -r -T prefix M-Left resize-pane -L 5
bind-key -r -T prefix M-Right resize-pane -R 5
bind-key -r -T prefix C-Up resize-pane -U
bind-key -r -T prefix C-Down resize-pane -D
bind-key -r -T prefix C-Left resize-pane -L
bind-key -r -T prefix C-Right resize-pane -R
That -r
option to bind-key
means they support repeat -- you can keep hitting C-Arrow or M-Arrow until you've finished resizing, without entering the prefix sequence again. The amount of time before this repeat mode times out is controlled by the repeat_time
option (default 500ms).
Binding with no prefix
If you want to avoid the prefix key entirely, you can use a different bind
table. From the bind-key section of the manpage:
By default (without -T), the key is bound in the prefix key
table. This table is used for keys pressed after the prefix key (for example, by default 'c' is bound to new-window in the prefix table, so 'C-b c' creates a new window). The root table is used for keys pressed without the prefix key: binding 'c' to new-window in the root table (not recommended) means a plain 'c' will create a new window. -n is an alias for -T root.
To bind directly into the root table:
bind-key -n C-Up resize-pane -U 5
bind-key -n C-Down resize-pane -D 5
bind-key -n C-Left resize-pane -L 5
bind-key -n C-Right resize-pane -R 5
Binding in copy mode
You suggested a dedicated mode for resizing. tmux
has no support for such custom modes, but it already has copy mode (by default, entered with prefix-[
and left with q
) in which keypresses can have different bindings, typically without the prefix. Unfortunately, binding multiword commands (including commands with arguments) in this mode isn't supported (see tmux issue 215). However, there is a workaround of testing #pane_in_mode
before doing anything. Based on the comments on that issue, and the above "bind with no prefix" solution:
bind-key -n C-Up if-shell -F "#pane_in_mode" "resize-pane -U 5" "send-keys C-Up"
bind-key -n C-Down if-shell -F "#pane_in_mode" "resize-pane -D 5" "send-keys C-Down"
bind-key -n C-Left if-shell -F "#pane_in_mode" "resize-pane -L 5" "send-keys C-Left"
bind-key -n C-Right if-shell -F "#pane_in_mode" "resize-pane -R 5" "send-keys C-Right"
Using existing keys
You might not need to add anything to your configuration at all. Here are the default bindings for resizing the panes (from :list-keys
):
bind-key -r -T prefix M-Up resize-pane -U 5
bind-key -r -T prefix M-Down resize-pane -D 5
bind-key -r -T prefix M-Left resize-pane -L 5
bind-key -r -T prefix M-Right resize-pane -R 5
bind-key -r -T prefix C-Up resize-pane -U
bind-key -r -T prefix C-Down resize-pane -D
bind-key -r -T prefix C-Left resize-pane -L
bind-key -r -T prefix C-Right resize-pane -R
That -r
option to bind-key
means they support repeat -- you can keep hitting C-Arrow or M-Arrow until you've finished resizing, without entering the prefix sequence again. The amount of time before this repeat mode times out is controlled by the repeat_time
option (default 500ms).
Binding with no prefix
If you want to avoid the prefix key entirely, you can use a different bind
table. From the bind-key section of the manpage:
By default (without -T), the key is bound in the prefix key
table. This table is used for keys pressed after the prefix key (for example, by default 'c' is bound to new-window in the prefix table, so 'C-b c' creates a new window). The root table is used for keys pressed without the prefix key: binding 'c' to new-window in the root table (not recommended) means a plain 'c' will create a new window. -n is an alias for -T root.
To bind directly into the root table:
bind-key -n C-Up resize-pane -U 5
bind-key -n C-Down resize-pane -D 5
bind-key -n C-Left resize-pane -L 5
bind-key -n C-Right resize-pane -R 5
Binding in copy mode
You suggested a dedicated mode for resizing. tmux
has no support for such custom modes, but it already has copy mode (by default, entered with prefix-[
and left with q
) in which keypresses can have different bindings, typically without the prefix. Unfortunately, binding multiword commands (including commands with arguments) in this mode isn't supported (see tmux issue 215). However, there is a workaround of testing #pane_in_mode
before doing anything. Based on the comments on that issue, and the above "bind with no prefix" solution:
bind-key -n C-Up if-shell -F "#pane_in_mode" "resize-pane -U 5" "send-keys C-Up"
bind-key -n C-Down if-shell -F "#pane_in_mode" "resize-pane -D 5" "send-keys C-Down"
bind-key -n C-Left if-shell -F "#pane_in_mode" "resize-pane -L 5" "send-keys C-Left"
bind-key -n C-Right if-shell -F "#pane_in_mode" "resize-pane -R 5" "send-keys C-Right"
answered Aug 17 at 14:40
JigglyNaga
2,666623
2,666623
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f463169%2fbeter-pane-resizing-mapping-for-tmux%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password