aboutsummaryrefslogtreecommitdiff
path: root/dot-config/tmux/tmux.conf
diff options
context:
space:
mode:
Diffstat (limited to 'dot-config/tmux/tmux.conf')
-rw-r--r--dot-config/tmux/tmux.conf86
1 files changed, 86 insertions, 0 deletions
diff --git a/dot-config/tmux/tmux.conf b/dot-config/tmux/tmux.conf
new file mode 100644
index 0000000..f0f5510
--- /dev/null
+++ b/dot-config/tmux/tmux.conf
@@ -0,0 +1,86 @@
+# Prefix key
+unbind C-b
+set -g prefix C-Space
+bind C-Space send-prefix
+
+# Status bar
+set -g status-position top
+set -g status-left " #S : "
+set -g window-status-format "[#W]"
+set -g window-status-current-format "[#W]"
+set -g status-left-length 30
+set -g status-right "#(acpi | cut -f 2-3 -d,) | #{user}@#H | %F | %T "
+set -g status-right-length 150
+set -g status-interval 1
+
+# Enable mouse
+set -g mouse on
+
+# Start windows & panes on 1
+set -g base-index 1
+set -g pane-base-index 1
+
+# Pane
+set -g pane-border-status top
+set -g pane-border-lines single
+set -g pane-border-format " [ ###P #{pane_current_command} ]"
+
+# Display info duration
+set -g display-panes-time 2000
+set -g display-time 2000
+
+# Reload config
+bind r source-file ~/.config/tmux/tmux.conf\; display "Tmux reloaded"
+
+# Command prompt
+bind Enter command-prompt
+
+# Display window & pane info
+bind i "display-message; display-panes"
+
+# 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 Tab next-window
+
+# Rename session
+bind S command-prompt "rename-session %%"
+
+# Rename window
+bind W command-prompt "rename-window %%"
+
+# Close session
+bind Escape confirm-before -p "Kill session '#S'? (y/n)" kill-session
+
+# Close window
+bind q confirm-before -p "Kill window '#W'? (y/n)" kill-window
+
+# Close pane
+bind BSpace kill-pane
+bind 0 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 _ detach