-
Notifications
You must be signed in to change notification settings - Fork 5
/
tmux.conf
138 lines (106 loc) · 4.63 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
##############################################################################
# _ __
# | |_ _ __ ___ _ ___ __ ___ ___ _ __ / _|
# | __| '_ ` _ \| | | \ \/ / / __/ _ \| '_ \| |_
# | |_| | | | | | |_| |> < | (_| (_) | | | | _|
# \__|_| |_| |_|\__,_/_/\_(_)___\___/|_| |_|_|
#
##############################################################################
# Status configuration {{{
# ========================
STATUS_DEFAULT_COLOR=blue
# Update the status bar every interval seconds. By default, updates will occur
# every 15 seconds. A setting of zero disables redrawing at interval.
set -g status-interval 5
# Set the position of the window list component of the status line: left,
# centre or right justified.
set -g status-justify centre
set -g status-style "bg=default fg=$STATUS_DEFAULT_COLOR"
# Status left
# -----------
set -g status-left-length 40
# Command mode indicator:
set -g status-left '#{?client_prefix,#[reverse]<C-b>#[noreverse] ,}'
# Hostname:
set -ag status-left "[ h:#[fg=blue,bold]#h #[fg=default,default]]"
# Session name:
set -ag status-left '[s:#[fg=blue,bold]#S#[fg=default,default]]'
set -ag status-left '['
# Status right
# ------------
set -g status-right-length 55
set -g status-right ']'
set -ag status-right '[#[fg=white,bold]RAM:#(~/.tmux_scripts/used_ram_pct)#[fg=default,default]]'
set -ag status-right '[#[fg=yellow,bold]#(~/.tmux_scripts/load_avg)#[fg=default,default]]'
set -ag status-right '[#[fg=cyan,bold]%d/%m %H:%M#[fg=default,default]]'
setw -g window-status-current-format '#[fg=red,bold](#[fg=white,bold]#I:#W#F#[fg=red,bold])#[fg=default,default]'
setw -g window-status-current-style bright
setw -g window-status-style fg=white
setw -g window-status-last-style fg=cyan
setw -g window-status-activity-style fg=yellow,bold
setw -g window-status-bell-style fg=yellow,bold
# }}}
# Mouse configuration {{{
# =======================
# If on, tmux captures the mouse and allows panes to be resized by dragging on
# their borders.
#set-option -g mouse-resize-pane on
# If on, tmux captures the mouse and when a window is split into multiple panes
# the mouse may be used to select the current pane. The mouse click is also
# passed through to the application as normal.
#set-option -g mouse-select-pane on
# If on, clicking the mouse on a window name in the status line will select
# that window.
#set-option -g mouse-select-window on
# }}}
# Other Config {{{
# ================
# Set the base index from which an unused index should be searched when a new
# window is created.
set -g base-index 1
set -g pane-base-index 1
setw -g aggressive-resize on
# Do not wrap on searches (I added this feature :D )
setw -g wrap-search off
# Set the maximum number of lines held in window history. This setting applies
# only to new windows - existing window histories are not resized and retain
# the limit at the point they were created.
set -g history-limit 50000
# Set the default terminal for new windows created in this session - the
# default value of the TERM environment variable. For tmux to work correctly,
# this must be set to ‘screen’ or a derivative of it.
set -g default-terminal "screen-256color"
# Enable truecolor where available
set-option -ga terminal-overrides ",xterm-256color:Tc"
# }}}
# Key Bindings {{{
# ===============
# Bind the R key to reload this file
bind-key R run-shell -b ' \
tmux source-file ~/.tmux.conf > dev/null; \
tmux display-message "Sourced ~/.tmux.conf"'
# Use Vim-like keys to resize panes
unbind-key C-Left; bind-key -r < resize-pane -L 1
unbind-key C-Right; bind-key -r > resize-pane -R 1
unbind-key C-Up; bind-key -r + resize-pane -U 1
unbind-key C-Down; bind-key -r - resize-pane -D 1
# Use Vim-like keys to switch panes
unbind-key Up; bind-key -r k select-pane -U
unbind-key Down; bind-key -r j select-pane -D
unbind-key Left; bind-key -r h select-pane -L
unbind-key Right; bind-key -r l select-pane -R
# Use | and _ for vertical and horizontal splits
unbind-key '"'; bind-key _ split-window -c "#{pane_current_path}"
unbind-key %
bind-key | split-window -h -c "#{pane_current_path}"
# Use Vim-like keys to start selection, copy it and paste it
# unbind p
# bind p paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel --clipboard --input"
# Send all history to a file
bind-key P command-prompt -p 'save history to filename:' -I '~/.tmux.history' 'capture-pane -S -32768 ; save-buffer %1 ; delete-buffer'
# Use b to go to the last active window
bind-key b last
# }}}
# vim: fdm=marker :