diff options
| author | Blake Romero <blake@developercraft.com> | 2025-10-20 21:44:21 +0100 |
|---|---|---|
| committer | Blake Romero <blake@developercraft.com> | 2025-10-20 21:44:21 +0100 |
| commit | de41f9a0ced89e73d3837d7d69f49132d7607798 (patch) | |
| tree | 4ac7d4bcfb7f3170cf04bbf848e02492c66e52be | |
| parent | 12040f32f7d693d1736310d21b1ceb16ad757519 (diff) | |
Add keybindings & restructure config
| -rw-r--r-- | tmux.conf | 77 |
1 files changed, 73 insertions, 4 deletions
@@ -1,7 +1,6 @@ -# Prefix key -unbind C-b -set -g prefix C-Space -bind C-Space send-prefix +# +# SETTINGS +# # Status bar set -g status-position top @@ -23,3 +22,73 @@ set -g pane-base-index 1 set -g display-panes-time 2000 set -g display-time 2000 + +# +# KEYBINDINGS +# + +# Prefix key +unbind C-b +set -g prefix C-Space +bind C-Space send-prefix + +# Reload config +bind g source-file ~/.config/tmux/tmux.conf\; display "Tmux reloaded" + +# Display window & pane info +bind i "display-message; display-panes" + +# Command prompt +bind Enter command-prompt + +# Prompt for a name when creating a new window +bind c command-prompt -p " New window name:" "new-window; rename-window %%" + +# Toggle zoom +bind m resize-pane -Z + +# Copy mode +bind y copy-mode + +# Switch to next window +bind C-w next-window + +# Rename session +bind R command-prompt "rename-session %%" + +# Rename window +bind r command-prompt "rename-window %%" +# Close session +bind C-q confirm-before -p "Kill session '#S'? (y/n)" kill-session + +# Close window +bind C-x confirm-before -p "Kill window '#W'? (y/n)" kill-window + +# Close pane +bind BSpace kill-pane + +# Split pane +bind - split-window -v +bind \\ split-window -h + +# Select pane +bind j run "if [ #{pane_at_top} -eq 0 ]; then tmux select-pane -U; fi" +bind k run "if [ #{pane_at_bottom} -eq 0 ]; then tmux select-pane -D; fi" +bind l run "if [ #{pane_at_left} -eq 0 ]; then tmux select-pane -L; fi" +bind \; run "if [ #{pane_at_right} -eq 0 ]; then tmux select-pane -R; fi" + +# Swap pane +bind u run "if [ #{pane_at_top} -eq 0 ]; then tmux swap-pane -U; fi" +bind d run "if [ #{pane_at_bottom} -eq 0 ]; then tmux swap-pane -D; fi" +bind [ run "if [ #{pane_at_left} -eq 0 ]; then tmux swap-pane -s '{left-of}'; fi" +bind ] run "if [ #{pane_at_right} -eq 0 ]; then tmux swap-pane -s '{right-of}'; fi" + +# Detach session +bind C-d detach + +# Choose session/window +bind s choose-session +bind w choose-window + +# Next session +bind C-s switch-client -n |
