-
Notifications
You must be signed in to change notification settings - Fork 2
/
.tmux.conf
153 lines (117 loc) · 3.34 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
# -g means global for all sessions
# -r means the command is repeatable
#
# ------- General configuration
#
# Use C-a as prefix for all sessions
set -g prefix C-a
# Unbind C-b for a later usage
unbind C-b
# Set small delay for commands
set -sg escape-time 1
# Set window index starts at 1
set -g base-index 1
# Set panel index starts at 1
setw -g pane-base-index 1
# Pass xterm keys through its terminals
setw -g xterm-keys on
# Bind PREFIX r to reload config file
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Send C-a to an application running within tmux pressing twice
bind C-a send-prefix
# Split panes using | and -
bind | split-window -h
bind - split-window -v
# Automatic-rename window disabled
setw -g automatic-rename off
# Enable vim-mode
setw -g mode-keys vi
# Vim-like pane movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Remap window movement keys
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# Vim-like pane resize keys
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# Vim-like buffer manipulation keys
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
# Using Linux system clipboard
bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"\; display "Buffer copied!"
bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
# Disable mouse options
setw -g mode-mouse off
#
# ------- Colors customization
#
# Enable 256 colors support
set -g default-terminal "screen-256color"
# Set status bar foreground and background color
set -g status-fg white
set -g status-bg black
# Set window list colors
# -- inactive windows
setw -g window-status-fg cyan
setw -g window-status-bg default
setw -g window-status-attr dim
# -- active window
setw -g window-status-current-fg white
setw -g window-status-current-bg red
setw -g window-status-current-attr bright
# Set pane divider colors
# -- inactive panes
set -g pane-border-fg green
set -g pane-border-bg black
# -- active pane
set -g pane-active-border-fg white
set -g pane-active-border-bg yellow
# Set command line colors
set -g message-fg white
set -g message-bg black
set -g message-attr bright
#
# ------- Status bar customization
#
# Set status left panel
set -g status-left-length 40
set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P"
# Set status right panel
set -g status-right "#(~/bin/battery Discharging) | #[fg=cyan]%d %b %R"
# Support for UTF-8
set -g status-utf8 on
# Set status bar refresh time
set -g status-interval 60
# Set window list configuration
set -g status-justify centre
# Visual notification for window activity
set -g visual-activity off
set -g visual-bell off
set -g visual-content off
set -g visual-silence off
setw -g monitor-activity off
setw -g monitor-content on
set -g bell-action none
#
# ------- Advanced stuff
#
# Bind up arrow to Maximize pane
unbind Up
bind Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp
# Bind down arrow to Minimize pane
unbind Down
bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp
# Set zsh as default shell
set -g default-command /bin/zsh
set -g default-shell /bin/zsh
# Set fish as default shell
# set-option -g default-shell "/usr/bin/fish"