summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2024-02-21 23:57:00 +0100
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2024-02-21 23:57:00 +0100
commit09709c2055390ee035347b5c350cbfc5a471af1a (patch)
treee48df6838aa35a3182130c1f34772524c9698f3b
parenteb6c1d06f8a74b3fd3d903781f511936c49d07de (diff)
Add toggle floating tmux term
-rw-r--r--.config/tmux/tmux.conf15
1 files changed, 11 insertions, 4 deletions
diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf
index 1b72573..8226b39 100644
--- a/.config/tmux/tmux.conf
+++ b/.config/tmux/tmux.conf
@@ -23,7 +23,7 @@ set-option -g status-style bg=#151515,fg=white
set-option -g automatic-rename on
set-option -g renumber-windows on
set-option -g status-left ""
-set -ga status-left '#[bg=#151515]#[fg=white] #{?window_zoomed_flag,, }'
+set -ga status-left '#[bg=#151515]#[fg=white] #{?window_zoomed_flag,, }'
set-option -g status-right ""
set-option -g window-status-format " #[fg=#E1E1E1] #{window_index}#(echo ':')#{window_name}#{window_flag} "
set-option -g window-status-current-format " #[bold bg=#151515] > #{window_index}#(echo ':')#{window_name}#{window_flag} "
@@ -36,10 +36,11 @@ setw -g mode-keys vi
setw -g mouse off
# split panes
-bind s split-window -h
-bind t split-window -v
+bind h split-window -h
+bind v split-window -v
unbind '"'
unbind %
+bind s list-sessions
bind-key N resize-pane -D 5
bind-key E resize-pane -U 5
@@ -71,4 +72,10 @@ set -g base-index 1
set -sg escape-time 0
# Fire up a floating terminal
-bind -n M-g display-popup -E "tmux new-session -A -s scratch"
+bind-key -n -N 'Toggle popup window' M-g if-shell -F '#{==:#{session_name},popup}' {
+ detach-client
+} {
+ display-popup -d "#{pane_current_path}" \
+ -xC -yC -w 80% -h 75% \
+ -E 'tmux attach-session -t popup || tmux new-session -s popup'
+}