-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
72 lines (58 loc) · 2.54 KB
/
tmux.conf
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
# Status bar theming
set -g status-interval 1
set-option -g status-bg colour18
set-option -g window-status-bg colour20
set -g status-justify centre # center align window list
set -g status-left-length 20
set -g status-right-length 140
set -g status-left '#[fg=green,bright]#H #[fg=blue]| #[fg=red]♥ #(upower -i /org/freedesktop/UPower/devices/DisplayDevice | egrep "percentage:" | sed -r "s/^.*percentage:\s*([0-9]+)\.?.*$/\1/g")%'
set -g status-right '#[fg=red,bright]#(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") #[fg=blue]| #[fg=green]%a %l:%M:%S %p #[fg=blue]| #[fg=red]%Y-%m-%d'
set -g window-status-current-format " #I #W "
set -g window-status-format " #I #W "
set -g window-status-current-attr bold
set -g window-status-current-bg colour9
set -g window-status-current-fg colour18
set -g message-bg blue
set -g message-fg white
set -g window-status-bell-fg white
set -g window-status-bell-bg red
set -g window-status-bell-attr bold
# Remap C-b to C-a
set-option -g prefix C-a
# Go to previous window using C-a
bind-key C-a last-window
# Start window numbering at 1
set -g base-index 1
# Allow for faster key repetition
set -s escape-time 0
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
# Jump to start of line using C-a a
bind-key a send-prefix
# Activity monitoring
setw -g monitor-activity on
set -g visual-activity on
# Vim copypaste mode
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
# Traverse panes using hjkl
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Bind C-a m to "editor, server, commandline"-layout
is_single_pane="test $(tmux list-panes | wc -l) -eq 1"
bind m if-shell "$is_single_pane" "set-window-option main-pane-width 125\; split-window\; split-window\; select-layout main-vertical \; select-pane -L"
# C-a C will create a new new window and prompt for a name
bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
# Reload .tmux.conf using C-a r
bind r source-file ~/.tmux.conf \; display-message "Config reloaded ..."
# Window renaming
set-option -g allow-rename off
# Use current directory for new panes and windows
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"