blob: 27af0969be1ff8c846fb335087c340cc00bdf2d1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
#
# SETTINGS
#
# 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 "#{user}@#H | %F | %R "
set -g status-right-length 150
set -g status-interval 5
# Pane
set -g pane-border-status top
set -g pane-border-lines single
set -g pane-border-format " [ ###P #{pane_current_command} ]"
set -g base-index 1
set -g pane-base-index 1
set -g display-panes-time 2000
set -g display-time 2000
# Other
set -g mouse on
#
# 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
|