-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
executable file
·156 lines (118 loc) · 4.25 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
setw -g monitor-activity on
setw -g visual-activity off
set -s escape-time 100
set -sa terminal-features ',*:RGB'
# set -sa terminal-overrides ',xterm*:Tc'
set -g default-terminal "screen-256color"
set -g focus-events on
set -g default-shell $SHELL
# windows numbers start at 1
set -g base-index 1
setw -g mode-keys vi
setw -g mouse on
# Bindings setup
# Also useful commands
# <prefix> :new - create new session
# <prefix> :kill-* - kill server, session, window, or pane
# <prefix> s - switch beetwen sessions
# Change prefix to Alt-S
unbind C-b
set -g prefix M-s
bind-key M-s send-prefix
# Fast config reloading
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
# Maximize current pane
bind m resize-pane -Z
unbind z
# Switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Switch panes using Alt-hjkl without prefix
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# Vim like
bind -n M-v copy-mode
# Creating window
bind -n C-t new-window -c "#{pane_current_path}"
bind -n C-M-t new-window
# Horizontal spliting
bind \\ split-window -h -c "#{pane_current_path}"
bind | split-window -h
unbind '"'
# Vertical spliting
bind - split-window -v -c "#{pane_current_path}"
bind '_' split-window -v
unbind %
# Window switching
bind -n 'M-[' previous-window
bind -n 'M-]' next-window
# Window swapping
bind -r 'M-/' swap-window -t -1\; select-window -t -1
bind -r 'M-\' swap-window -t +1\; select-window -t +1
# Vim copy and paste
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
bind P paste-buffer
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel
# set -g @plugin 'tmux-plugins/tpm'
# set -g @plugin 'tmux-plugins/tmux-cpu'
# Status line setup
set -g status on
set -g status-interval 15
set -g status-justify left
set -g status-keys vi
set -g status-position bottom
set -g status-left-length 100
set -g status-left-style default
set -g status-left ""
# set -ga status-left "#[default]#H #[fg=green,bright]• "
set -g status-right-length 100
set -g status-right-style default
set -g status-right ""
# Show CPU usage in percentage
# set -ga status-right '#[default] Cpu: #[fg=green]#{cpu_percentage}'
# Show memory usage in "Used/Total" format
# set -ga status-right "#[default] Mem: #[fg=green]#(free -m -h | awk '/Mem/{printf $3\"/\"$2}')"
# Show uptime in "days hours:minutes" format
# set -ga status-right "#[default] Up: #[fg=green]#(uptime | awk -F'( |,|:)+' '{d=h=m=0; if ($7==\"min\") m=$6; else {if ($7~/^day/) {d=$6;h=$8;m=$9} else {h=$6;m=$7}}} {print d+0 \"d\", h+0 \":\" m+0}')"
# Show user and host info
set -ga status-right "#[default] #(whoami)@#H"
# Show current mode:
# preseed prefix - green background
# in copy-mode - orange (colour166) background
# or nothing - green foreground
currModeChar="•"
set -ga status-right "#[default] #[fg=green]
#{?client_prefix,#[reverse]
$currModeChar,
#{?pane_in_mode,#[reverse]#[fg=darkOrange3]
$currModeChar,
$currModeChar}}"
# Colors setup - Solarized 256
# Statusbar
set -g status-style fg=colour136,bg='#1c1c1c' # yellow and base02
# Window title
setw -g window-status-current-style fg=colour166,bg=default # active - orange and default
setw -g window-status-style fg=colour244,bg=default # non active - base0 and default
# Pane border
set -g pane-active-border-style fg=colour240 # active - base01
set -g pane-border-style fg=colour235 # non active - base02
# Pane number display
set -g display-panes-active-colour colour33 # active - blue
set -g display-panes-colour colour166 # non active - orange
# Message text
set -g message-style fg=colour166,bg=colour235 # orange and base02
# Clock
setw -g clock-mode-colour colour64 # green
# Bell
setw -g window-status-bell-style fg=colour235,bg=colour160 # base02, red
# run '~/.tmux/plugins/tpm/tpm'
# Disable status line when suspended
set -g @suspend_suspended_options "status::off,"
# Download from:
# https://github.com/MunifTanjim/tmux-suspend
run-shell ~/.tmux/plugins/tmux-suspend/suspend.tmux