Last active
June 16, 2021 00:30
-
-
Save jmoyers/101302f09632df908d84b3f79d7d54aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remap C-b to C-a | |
unbind C-b | |
set-option -g prefix C-a | |
bind-key C-a send-prefix | |
# reload the conf file on the fly | |
bind r source-file ~/.tmux.conf | |
# who knows what this does, but I can now scroll in a tmux pane | |
set -g terminal-overrides 'xterm*:smcup@:rmcup@' | |
set -g mode-mouse on | |
# repeat last shell command on right pane (if it happens to be a shell) | |
bind-key s select-pane -t 1 \; send-keys C-c Up C-m \; last-pane | |
# swap right pane in window 0 with default pane in window 1 | |
# | |
# make sure our current window is listed as 0 | |
# create a second window if it doesn't exist | |
# select our 0 window again in case we created a new one | |
# select our second pane in 0 window | |
# join that pane to window 1 | |
# select the pane above the one we just moved there | |
# move that pane to window 0 | |
# send the up arrow and enter to that pane (run last shell command) | |
# switch to last pane, which will be window 0, pane 0 (primary left) | |
# make sure we are horiontal-even | |
# redraw vim -- since it gets fucked up in this build when selecting | |
# layout programmatically. This whole thing assumes vim in left pane. | |
bind-key d \ | |
if-shell 'tmux select-window -t :0' '' 'move-window -t :0' \; \ | |
if-shell 'test $(tmux list-panes | wc -l) -gt 1' '' 'split-window -h' \; \ | |
if-shell 'tmux select-window -t :1' '' 'new-window' \; \ | |
select-window -t 0 \; \ | |
select-pane -t 1 \; \ | |
join-pane -t 1.0 \; \ | |
select-pane -U \; \ | |
join-pane -h -t 0.0 \; \ | |
last-pane |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment