-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_tmux.conf
166 lines (119 loc) · 5.13 KB
/
dot_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
157
158
159
160
161
162
163
164
165
166
# tmux settings
# http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/tmux.1#x4f5054494f4e53
# ----------------------------------------------------------------------
# | General Settings |
# ----------------------------------------------------------------------
# Use zsh as default shell
set-option -g default-shell /opt/homebrew/bin/zsh
# Set mouse node on
set-option -g mouse on
# Make window index start at 1
set -g base-index 1
# Make pane index start at 1
setw -g pane-base-index 1
# Remove delay when sending commands
# (default is 500 milliseconds)
set -sg escape-time 1
# ----------------------------------------------------------------------
# | Key Mappings |
# ----------------------------------------------------------------------
# Change the key combination for the PREFIX key to `ctrl-a`
# set -g prefix C-a
set -g prefix `
unbind-key C-b
# Make tmux send the PREFIX to an application running
# within tmux simply by pressing PREFIX key twice
# bind C-a send-prefix
bind ` send-prefix
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# # Use vim keybindings in copy mode
# setw -g mode-keys vi
# Workaround for accessing macOS' pasteboard
# no need after tmux 2.1+?
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
# if-shell \
# 'test "$(uname -s)" = Darwin' \
# 'set-option -g default-command "exec reattach-to-user-namespace -l $SHELL"'
# # Remap the copy & paste keys to work as in vim
# unbind [
# bind Escape copy-mode
# 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-selection
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# [ PREFIX + - ] Split window horizontally
bind - split-window -v
# [ PREFIX + | ] Split window vertically
bind | split-window -h
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# [ PREFIX + h/j/k/l ] Move from pane to pane
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# [ PREFIX + H/J/K/L ] Resize pane
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
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# [ PREFIX + r ] Reload tmux config
bind r source-file ~/.tmux.conf \; display "tmux configs reloaded"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# bind K to kill session after confirm
# bind k to soft kill session (move to another active session)
bind K confirm-before -p "kill-session #S? (y/n)" kill-session
bind-key k confirm-before -p "Kill #S (y/n)?" "run-shell 'tmux switch-client -n \\\; kill-session -t \"\$(tmux display-message -p \"#S\")\"'"
# ----------------------------------------------------------------------
# | Status bar |
# ----------------------------------------------------------------------
# Notified when something happens in one of the other windows
setw -g monitor-activity on
set -g visual-activity on
# Periodically refresh the status bar
set -g status-interval 60
# # Customize what is displayed
# set -g status-justify left
# set -g status-left-length 50
# set -g status-left " #S / "
# # └─ current session name
# set -g status-right " %R "
# # └─ current time
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Default colors
set -g status-style fg=black,bg=blue
# Colors for window list
setw -g window-status-style fg=black,bg=blue,dim
# Colors for active window
setw -g window-status-current-style fg=black,bg=orange,dim
# ----------------------------------------------------------------------
# | Visual Styling |
# ----------------------------------------------------------------------
# Keep windows name fixed
set-option -g allow-rename off
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Display things in 256 colors
set -g default-terminal "screen-256color"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Command Line
set -g message-style fg=black,bg=blue,dim
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Pane divider
set -g pane-active-border-style fg=blue,bg=default
set -g pane-border-style fg=colour244,bg=default
# ----------------------------------------------------------------------
# | Plugins (`prefix + I` to fetch and source) |
# ----------------------------------------------------------------------
# Continuum auto start after reboot
set -g @continuum-boot 'on'
set -g @continuum-boot-options 'iterm,fullscreen'
# Plugins
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'nhdaly/tmux-scroll-copy-mode'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'