diff options
| -rwxr-xr-x | executables/bin/tmux-toggle-term | 2 | ||||
| -rw-r--r-- | tmux/.config/tmux/key-remappings.tmux | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/executables/bin/tmux-toggle-term b/executables/bin/tmux-toggle-term index 7012392..6d6cbd7 100755 --- a/executables/bin/tmux-toggle-term +++ b/executables/bin/tmux-toggle-term @@ -1,9 +1,11 @@ #!/usr/bin/env bash set -uo pipefail + FLOAT_TERM="${1:-}" LIST_PANES="$(tmux list-panes -F '#F')" PANE_ZOOMED="$(echo "${LIST_PANES}" | grep Z)" PANE_COUNT="$(echo "${LIST_PANES}" | wc -l | bc)" + if [ -n "${FLOAT_TERM}" ]; then if [ "$(tmux display-message -p -F "#{session_name}")" = "popup" ]; then tmux detach-client diff --git a/tmux/.config/tmux/key-remappings.tmux b/tmux/.config/tmux/key-remappings.tmux index 65318d7..d0a32cc 100644 --- a/tmux/.config/tmux/key-remappings.tmux +++ b/tmux/.config/tmux/key-remappings.tmux @@ -5,7 +5,7 @@ unbind C-b set-option -g prefix C-a bind-key C-a send-prefix -# Remap pane splits. +# Remap pane splits to something more sane than the default. # # Split panes using | for horizontal splits and - for vertical splits bind-key | split-window -h @@ -13,9 +13,11 @@ bind-key - split-window -v unbind '"' unbind % +# Easier configuration reloading and pane killing bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "Config reloaded!" bind-key x kill-pane +# Add key bindings for toggling terminal windows bind-key -n 'C-t' run-shell -b "${HOME}/bin/tmux-toggle-term" bind-key -n 'C-f' run-shell -b "${HOME}/bin/tmux-toggle-term float" |