-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
146 lines (123 loc) · 5.39 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
# Time in milliseconds for which tmux waits after an escape.
#
# See https://mutelight.org/practical-tmux
# See https://github.com/neovim/neovim/issues/2017#issuecomment-75140861
set-option -g escape-time 0
set-option -g repeat-time 325
# Keep quiet and don't display warnings.
### set -q
# Interact with xterm clipboard.
set-option -g set-clipboard on
# Window numbering starts from '1', '0' is too far away.
set-option -g base-index 1
# Ring the terminal bell from any window, in URxvt this is disabled, but activity is recorded.
set-option -g bell-action any
### set-option -g bell-on-alert on
# Pretend to be 'screen', easier as many scripts already recognise the $TERM string.
set -g default-terminal "tmux-256color"
# The maximum number of lines held in history, mirror URxvt configuration.
set-option -g history-limit 102400
# Mouse is useful so just go with it.
set-option -g mouse on
# Redraw the status line more frequently than the default.
set-option -g status-interval 5
# Use Vi key bindings on the tmux command line.
set-option -g status-keys vi
## Cursor shape and true colors
#set -ga terminal-overrides ',alacritty:RGB'
# See https://github.com/tmux/tmux/pull/1771#issuecomment-500906522
set -as terminal-overrides ',alacritty:RGB'
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours
# https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda?permalink_comment_id=4412251#gistcomment-4412251
set -ga terminal-features "*:hyperlinks"
# Disable annoying visual bells.
set-option -g visual-bell off
# Don't choose a window title for me, thank you.
set-window-option -g automatic-rename off
# Preserve any output before running interactive commands, such as Vim.
set-window-option -g alternate-screen on
# Use Vi key bindings for copy/paste operations.
set-window-option -g mode-keys vi
# Watch for activity in windows and highlight on the status line.
set-window-option -g monitor-activity on
# Numbering for panes is same as numbering for windows.
set-window-option -g pane-base-index 1
# Enable xterm-style key sequences and modifiers such as Ctrl, Alt and Shift.
set-window-option -g xterm-keys on
# Allow each window to take up the maximum monitor width/height without forcing others.
set-window-option -g aggressive-resize on
# Turn on window titles.
set -g set-titles on
# See https://github.com/tmux/tmux/blob/5b13dafbab2bc6c3b2aac1af1198df018dd720a1/options-table.c#L295
# See http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/tmux.1?query=tmux&sec=1#x464f524d415453
set -g set-titles-string '#T - #S:#I:#W #{session_alerts}'
# Key bindings.
set-option -g prefix C-s
bind-key C-s send-prefix
unbind-key C-b
unbind-key C-z
# Clipboard manipulation.
bind-key C-c run "tmux save-buffer - | xclip -in -selection clipboard >/dev/null"
bind-key C-v run "tmux set-buffer -- \"$( xclip -out -selection clipboard )\"; tmux paste-buffer"
#bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
# Copy and pasting
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-selection
### unbind-key -T copy-mode-vi Enter
### unbind-key -T copy-mode-vi Space
# Quick pane cycling with Ctrl-S.
bind-key C-s select-pane -t :.+
unbind-key o
# Move around panes like in Vim (only in tmux 1.6).
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key h select-pane -L
unbind-key Up
unbind-key Down
unbind-key Left
unbind-key Right
# Resize panes using Vi-style key bindings.
bind-key -r C-k resize-pane -U
bind-key -r C-j resize-pane -D
bind-key -r C-h resize-pane -L
bind-key -r C-l resize-pane -R
bind-key -r C-M-k resize-pane -U 5
bind-key -r C-M-j resize-pane -D 5
bind-key -r C-M-h resize-pane -L 5
bind-key -r C-M-l resize-pane -R 5
unbind-key M-Up
unbind-key M-Down
unbind-key M-Left
unbind-key M-Right
unbind-key C-Up
unbind-key C-Down
unbind-key C-Left
unbind-key C-Right
# Split window horizontally and vertically.
bind-key | split-window -h -c '#{pane_current_path}'
bind-key _ split-window -v -c '#{pane_current_path}'
unbind-key '"'
unbind-key %
# Formatting & Colours.
set-option -g mode-style bg=colour220,fg=colour16
set-option -g status-style fg=colour247
set-option -g pane-border-style fg=colour238
set-option -g pane-active-border-style fg=colour248
set-option -g message-style bg=colour232,fg=colour220,bold
set-window-option -g window-status-activity-style fg=colour251,bold
set-window-option -g window-status-bell-style fg=colour251,bold
set-window-option -g status-left '#[fg=colour252,bg=colour244] #S #[fg=colour244,bg=colour232] '
set-window-option -g status-right ' #[fg=colour244,bg=colour232]#[fg=colour252,bg=colour244] #h '
set-window-option -g window-status-format " #I│ #W "
set-window-option -g window-status-current-format "#[fg=colour232,bg=colour39]#[fg=colour16,bg=colour39] #I│ #W #[fg=colour39,bg=colour232]"
set-option -g status-left-length 64
set-option -g status-right-length 64
# See https://github.com/tmux-plugins/tpm
#
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-open'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'