-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
132 lines (106 loc) · 4.14 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#
# Welcome to Neil Traft's .tmux.conf
#
# Helpful sources:
# https://gist.github.com/spicycode/1229612
# https://dev.to/krishnam/tmux-13-cool-tweaks-to-make-it-personal-and-powerful-487p
# https://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
#
# Convenient for when you are editing this file and you want to see the result.
bind r source-file ~/.tmux.conf \; display "Config reloaded."
# Change the prefix key to F12.
set -g prefix F12
unbind C-b
bind F12 send-prefix
# Set key bindings to be vim-like by default.
set -g mode-keys vi
set -g status-keys vi
# Turn mouse mode on, to be able to resize panes with the mouse.
# NOTE: Turning off because it doesn't allow you to copy to the system
# clipboard, so it's really more harmful than useful.
#set -g mouse on
# NOTE: This is the command for tmux <v2.9.
#set -g mode-mouse on
# No delay for escape key press. Not sure exactly what this does but it seems
# to be popular for resolving some issue with vim.
set -sg escape-time 0
# By default, message display time is too short (.75s). Change to 2s.
set -g display-time 2000
set -g display-panes-time 2000
# We want WAY more history than the default 2000. Maybe even more than this.
set -g history-limit 50000
# Set counting to start at 1 so window ordering matches order on the keyboard.
set-option -g base-index 1 # window index will start with 1
set-window-option -g pane-base-index 1 # pane index will start with 1
set-option -g renumber-windows on
#
# KEY BINDINGS
#
# Just kill the pane instead of asking for confirmation. Because it's pretty
# hard to hit this key accidentally.
unbind x
bind x kill-pane
# More sensible split-window bindings.
bind h split-window -h
bind v split-window -v
# Sadly hard to find a good cross-platform option here. Mac captures all
# meta-key shortcuts. Many control-keys aren't good for Linux/Windows.
bind -n F5 last-window
bind -n F11 last-window
bind -n M-w last-window # Doesn't work on Mac, maybe still useful for PC?
# Other key bindings. Some of these are similar to byobu defaults.
bind -n F2 new-window
bind -n F3 previous-window
bind -n F4 next-window
bind -n S-Left previous-window
bind -n S-Right next-window
bind -n C-Left swap-window -t -1
bind -n C-Right swap-window -t +1
bind k kill-window
bind -n F6 detach
bind -n F7 copy-mode
#
# THEME
#
# NOTE: A lot of this won't work on an older version of tmux (like before v3).
#
# Automatically set terminal window title.
set-window-option -g automatic-rename on
set-option -g set-titles on
# Status Text
set -g status-interval 60
set -g status-left-length 30
set -g status-left '#[fg=green](#S) #(whoami) '
# Shows (1) Avg CPU+IO load of the past 1, 5, and 15 minute periods; (2) system time.
set -g status-right '#[fg=colour232,bg=colour245] #(cut -d " " -f 1-3 /proc/loadavg) #[fg=colour232,bg=colour249] %H:%M '
# modes
setw -g clock-mode-colour colour5
setw -g mode-style 'fg=colour88 bg=colour16 bold'
# bell
set-window-option -g window-status-bell-style fg=colour235,bg=colour160 #base02, red
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none
#### COLOUR (Solarized 256)
# default statusbar colors
set -g status-style fg=colour136,bg=colour232 #yellow and base02
# message text
set -g message-style fg=colour166,bg=colour235 #orange and base02
# default window title colors
#setw -g window-status-style fg=colour244,bg=default #base0 and default
setw -g window-status-style 'fg=colour244 bg=colour234'
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W #[fg=colour244]#F '
#setw -g window-status-style dim
# active window title colors
#setw -g window-status-current-style fg=colour166,bg=default,bold #orange and default
setw -g window-status-current-style 'fg=colour166 bg=colour238 bold'
setw -g window-status-current-format ' #[fg=colour45]#I#[fg=colour249]:#[fg=colour255]#W #[fg=colour45]#F '
#setw -g window-status-current-style bright
# pane border
set -g pane-border-style fg=colour235 #base02
set -g pane-active-border-style fg=colour240 #base01
# pane number display
set -g display-panes-active-colour colour33 #blue
set -g display-panes-colour colour166 #orange