/
tmux.conf
154 lines (113 loc) · 4.5 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
# ======================================================================================================================
# Basic config
# ======================================================================================================================
# Unset ruby version so it respects .ruby-version files
set-environment -gu RBENV_VERSION
# Fastest command sequences (http://superuser.com/a/252717/65504)
set -s escape-time 0
# For nice colors
set -g default-terminal "screen-256color"
# Prevent user namespace problems
set-option -g default-command "reattach-to-user-namespace -l zsh"
# XTerm compatibility
set -g xterm-keys on
# Vi keys in copy mode
set -g mode-keys vi
# History boost
set -g history-limit 50000
# Enable mouse
set -g mouse on
# Emacs key bindings in command prompt (prefix + :) are better than vi keys, even for vim users
set -g status-keys emacs
# Focus events enabled for terminals that support them
set -g focus-events on
# Super useful when using "grouped sessions" and multi-monitor setup
setw -g aggressive-resize on
# Messages are displayed for 3 seconds
set -g display-time 3000
# Color setting as recommended by neovim's :checkhealth command
# set-option -sa terminal-overrides ',screen-256color:RGB'
set-option -ga terminal-overrides ',screen-256color:Tc'
# ======================================================================================================================
# Key bindings and mappings
# ======================================================================================================================
# Prefix
unbind C-b
set -g prefix §
bind-key § send-prefix
# Reload the file with Prefix r
bind R source-file ~/.tmux.conf \; display "Sourced tmux.conf"
# Next and prev window like in vim
bind -r - previous-window
bind -r = next-window
# New windows and panes in the same dir
bind-key n new-window -c "#{pane_current_path}"
bind-key i split-window -h -c "#{pane_current_path}"
bind-key v split-window -c "#{pane_current_path}"
# Pane switching
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# Resize panes with arrows
bind-key -r Left resize-pane -L 1
bind-key -r Down resize-pane -D 1
bind-key -r Up resize-pane -U 1
bind-key -r Right resize-pane -R 1
# <prefix> r to rename window
bind-key r command-prompt 'rename-window %%'
# <prefix> p to paste buffer
unbind p
bind p paste-buffer
# <prefix> P to choose which buffer to paste
bind P choose-buffer
# ======================================================================================================================
# Status bar settings
# ======================================================================================================================
# Set status position
set-option -g status-position bottom
# Set the base index for windows and panes to 1 instead of 0
set -g base-index 1
setw -g pane-base-index 1
# Renumber when window is closed
set -g renumber-windows on
# Activity monitoring
setw -g monitor-activity on
# Default statusbar colors
set -g status-style bg=black
# Default window title colors
setw -g window-status-style fg=white,bg=default
# Active window title colors
setw -g window-status-current-style fg=white,bg=default
# Pane border
set -g pane-border-style fg=white,bg=default
set -g pane-active-border-style fg=white,bg=default
# Command line/message text
set -g message-style bg=black,fg=yellow
# Pane number display
set -g display-panes-active-colour cyan
set -g display-panes-colour brightblue
# Status settings
set -g status on
set -g status-interval 15
set -g status-justify centre
# Status line left side
set -g status-left-length 70
set -g @online_icon "yes"
set -g @offline_icon "no"
set -g status-left "#[fg=white] #S"
# Status line right side
set -g status-right-length 70
set -g status-right "#[fg=white] %d %b %R"
# Activity
set-option -gw window-status-activity-style fg=white,bg=default
# ======================================================================================================================
# Plugins settings
# ======================================================================================================================
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank' # yanking helpers
set -g @plugin 'tmux-plugins/tmux-sessionist' # session helpers prexif + C (new session)
set -g @plugin 'tmux-plugins/tmux-resurrect' # prefix + C-s save, C-r restore
# Initialize plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'