-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.tmux.conf
171 lines (136 loc) · 5.02 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# List wanted plugins
# set -g @plugin 'tmux-plugins/tpm'
# set -g @plugin 'tmux-plugins/tmux-resurrect'
# Set terminal name
# Tmux FAQ instructs to only use screen-256color or tmux-256color inside tmux
set -g default-terminal "tmux-256color"
# True colors (signal that the outside terminal supports RGB colors)
set -ga terminal-features ",alacritty:RGB"
set -ga terminal-features ",*256col*:RGB"
# Set escape time for emacs inside tmux
set -s escape-time 0
# Set the scroolback buffer size
set-option -g history-limit 100000
# Change prefix key to `
unbind C-b
set-option -g prefix `
if-shell 'test -n "$SSH_CONNECTION"' 'set-option -g prefix C-b'
# Allow for nested sessions
# C-z (which is C-b in QWERTY) to send the default prefix
# normal C-b is very hard to press on colemak
bind -n C-z send C-b
# Send backtick literal with keybind
bind b send-key -l `
# Default repeat time is 500ms, lower to 125ms (time while prefix is active)
# otherwise hitting up arrow right after moving to new window counts
# as moving back to window above
set -g repeat-time 125
# Enable pass through, this is needed for image previews
set -g allow-passthrough all
# Switch to last window
bind ` last-window
# Reload tmux config file
bind r source-file ~/.config/tmux/tmux.conf \; display-message "Config reloaded..."
# Count from 1
set -g base-index 1
# More straight forward key bindings for splitting
unbind %
bind | split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
bind d new-window -c '#{pane_current_path}'
# create new session bind
bind D new-session -c '#{pane_current_path}'
# vim style movement & resize window
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind y resize-pane -L 5
bind u resize-pane -D 5
bind i resize-pane -U 5
bind o resize-pane -R 5
# Colemak
bind m select-pane -L
bind n select-pane -D
bind e select-pane -U
bind i select-pane -R
bind j resize-pane -L 5
bind l resize-pane -D 5
bind u resize-pane -U 5
bind y resize-pane -R 5
# vim key in copy mode
setw -g mode-keys vi
# Copy mode movements -- colemak
bind -T copy-mode-vi C-l send-keys -X halfpage-up
bind -T copy-mode-vi C-s send-keys -X halfpage-down
bind -T copy-mode-vi k send-keys -X search-again
bind -T copy-mode-vi K send-keys -X search-reverse
bind -T copy-mode-vi m send-keys -X cursor-left
bind -T copy-mode-vi n send-keys -X cursor-down
bind -T copy-mode-vi e send-keys -X cursor-up
bind -T copy-mode-vi i send-keys -X cursor-right
bind -T copy-mode-vi d send-keys -X rectangle-toggle
bind -T copy-mode-vi D send-keys -X select-line \; send-keys -X cursor-left
bind -T copy-mode-vi v send-keys -X previous-word
bind -T copy-mode-vi f send-keys -X next-word
# I don't want trailing whitespace to trigger command on pasting
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "cat | tmux_copy"
# move windows
bind < swap-window -t -1 \; previous-window
bind > swap-window -t +1 \; next-window
# Terminal emulator window title
set -g set-titles on
set -g set-titles-string '#S:#I.#P #W'
# Status bar configuration
#
# Background
set -g status-bg default
# Foreground
# set -g status-fg white
set -g status-fg colour4
# Auto refresh interval
set -g status-interval 60
# Lengths
set -g status-left-length 30
set -g status-right-length 90
# set -g status-right-length 50
# set -g status-left-length 50
# Status bar position
set -g status-justify centre
set -g status-position bottom
# Status style
set -g status-style bg=default
# Status left
# set -g status-left '[#I:#P]' # Panes info
# set -g status-left '#[fg=green]#I:#P' # Colored
set -g status-left '#[fg=default]#h ' # Hostname
# Status right
set -g status-right '#[default]%d %b %R' # Simple
# set -g status-right '#[fg=white]%a%l:%M %p #[fg=blue]%Y-%m-%d'
# set -g status-right '#[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S '
# set -g status-right '#[fg=cyan]#(/usr/bin/gcalcli --nc --ignore-started agenda "$(date\)"| head -2 | tail -1) #[fg=green]#(/usr/bin/dstat --battery-remain --nocolor 1 0 | tail -1) #[fg=yellow]#(cut -d " " -f 1 /proc/loadavg) #[default]%a %d %b %R'
# Window format
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F '
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour246]#W#[fg=colour244]#F '
# Notifying if other windows has activities
#setw -g monitor-activity on
set -g visual-activity on
# Message/command input colors
set -g message-command-style "bg=default bold"
set -g message-style "bg=default,fg=colour14 bold"
# Enable mouse support
set -g mouse on
# Window status colors
# setw -g window-status-bg black
# setw -g window-status-fg colour248
# setw -g window-status-alert-attr underscore
# setw -g window-status-alert-bg colour235
# setw -g window-status-alert-fg colour248
# setw -g window-status-current-attr bright
# setw -g window-status-current-bg colour235
# setw -g window-status-current-fg colour248
# Clock
setw -g clock-mode-colour colour14
setw -g clock-mode-style 24
# Start tmux plugin manager
# run '~/.tmux/plugins/tpm/tpm'