I'd like to override the bindings for window splitting (prefix + < | > for vert, prefix + < - > for horizontal). Is this possible to do in .tmux.conf.local? I'm concerned about messing up _split_window().
Hello @cagmz,
You can override bindings from .tmux.conf.local but your overrides won't be influenced by tmux_conf_new_pane_retain_current_path nor tmux_conf_new_pane_reconnect_ssh.
If you want auto ssh reconnection, bind your overrides to _split_window() otherwise bind them to tmux's split-window.
If you want to retain current pane path when splitting, bind your overrides along with -c '#{pane_current_path}'.
I have currently no better solution. The best solution would be to parse existing bindings and "augment" them but that's not trivial.
Thanks for info. I prefer these bindings too
@kuba-gaj can you please try the upcoming branch? With this branch you don't need to bind prefix + | to run cut -c3- ~/.tmux.conf | shell -s _split_window ... yourself.
Steps to test:
tmux (clients and server)upcoming branch~/.tmux.conf.local copy to addbind - split-window -v
bind | split-window -h
Hopefully, by now, your own bindings for split-window obey both tmux_conf_new_pane_retain_current_path and tmux_conf_new_pane_reconnect_ssh.
@gpakosz Thank you very much for help.
I gave it a quick try and got:
'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' returned 127
Aw my bad, I forgot to properly escape | when re-injecting commands to tmux bind-key.
I force pushed the branch, can you please do
$ cd ~/.tmux
$ git fetch -p
$ git checkout upcoming
$ git reset --hard origin/upcoming
Then kill tmux (clients and server) and try again?
That fixed the errors but now both binds split window horizontally
Oh right that's because I first made a typo in the comment above but now it's corrected.
That should be
bind - split-window -v
bind | split-window -h
Oh and now I realize both of you @kuba-gaj and @cagmz would be interested in the upcoming enhancements, my bad 馃榾
lol don't know how i missed that. It now works as expected
Most helpful comment
Hello @cagmz,
You can override bindings from
.tmux.conf.localbut your overrides won't be influenced bytmux_conf_new_pane_retain_current_pathnortmux_conf_new_pane_reconnect_ssh.If you want auto ssh reconnection, bind your overrides to
_split_window()otherwise bind them to tmux'ssplit-window.If you want to retain current pane path when splitting, bind your overrides along with
-c '#{pane_current_path}'.I have currently no better solution. The best solution would be to parse existing bindings and "augment" them but that's not trivial.