-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtmux.conf
More file actions
159 lines (128 loc) · 5.7 KB
/
Copy pathtmux.conf
File metadata and controls
159 lines (128 loc) · 5.7 KB
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
# ── General settings ──────────────────────────────────────────────────────────
# Set a new keybinding to C-t {{{
unbind C-r
unbind C-b
set -g prefix C-t
bind C-t send-prefix
# }}}
# Set a new keybinding for C-l {{{
bind C-l send-keys 'C-l'
# }}}
set-option -sg escape-time 0 # change the escape time in tmux to zero, improves vim responsiveness
set-option -g history-limit 50000 # Increase scrollback history
# smoother paste detection and focus tracking
set-option -g assume-paste-time 1 # assume bracketed paste for 1ms
set-option -g focus-events on # allow applications to detect terminal focus changes
set -g default-terminal "tmux-256color"
set -g default-shell ${SHELL}
set -g default-command ${SHELL}
if-shell "type 'reattach-to-user-namespace' >/dev/null" "set -g default-command 'reattach-to-user-namespace -l $SHELL'"
# set -g default-command ${SHELL}
# Enable true (24bit) colors for version >= 2.2
# See https://deductivelabs.com/en/2016/03/using-true-color-vim-tmux/
# https://medium.com/@dubistkomisch/how-to-actually-get-italics-and-true-colour-to-work-in-iterm-tmux-vim-9ebe55ebc2be
# set -ga terminal-overrides ',tmux-256color-italic:Tc:sitm=\E[3m'
set -as terminal-overrides ',xterm*:Tc:sitm=\E[3m'
set -g base-index 1 # start with window 1 (instead of 0)
set -g pane-base-index 1 # start with pane 1
setw -g mode-keys vi # enable vim mode
# Undercurl
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 - needs tmux-3.0
# vi-copy settings (<prefix> v) {{{
unbind v
bind v copy-mode
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel "pbcopy"
bind-key -Tcopy-mode-vi Escape send -X cancel
bind-key -Tcopy-mode-vi V send -X rectangle-toggle
# }}}
# visual notification of activity in other windows {{{
setw -g monitor-activity on
set -g visual-activity on
# }}}
# reload tmux.conf {{{
unbind r
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
# }}}
# Tmux resurrect / continuum {{{
set -g @resurrect-strategy-nvim 'session' # restore neovim session if Session.vim file is present
set -g @continuum-save-interval '5' # save every 5 minutes
set -g @continuum-restore 'on' # auto restore on boot
# }}}
# ── Pane settings ───────────────────────────────────────────────────────────
# Pane resizing {{{
bind-key -r H resize-pane -L "5"
bind-key -r L resize-pane -R "5"
bind-key -r J resize-pane -D "5"
bind-key -r K resize-pane -U "5"
# }}}
# switch between previous and next pane {{{
bind-key C-n next-window
bind-key C-p previous-window
# }}}
# move panes (cycle) left and right {{{
bind-key -r "<" swap-window -t -1
bind-key -r ">" swap-window -t +1
# }}}
# Panes options {{{
# set -g pane-border-style fg='black',bg='black'
set -g pane-border-style fg='white',bg='default' # space
set -g pane-active-border-style fg='white',bg='default'
set -g display-panes-colour default
set -g display-panes-active-colour yellow
# }}}
# set-option remain-on-exit on # keep new-window 'terminal command' open after the command exits 0
# ── Status/Window settings ────────────────────────────────────────────────────────
setw -g clock-mode-colour brightblue
# Status options {{{
set-option -g status on
set-option -g status-interval 10 # redraw status line every 10 seconds.
set-option -g status-justify "left"
set-option -g status-left-length 100
set-option -g status-right-length 100
set-option -g status-position "top"
set -g status-style bg='default',fg='default' # space
set -g status-left ""
set -g status-right ""
set-option -g status-keys emacs # emacs key bindings in tmux command prompt (prefix + :) are better than vi keys.
set -g pane-border-status "off" # add a empty line below statusline
# }}}
# Messages {{{
set -g message-style fg='#FFFFFF',bg='magenta'
set -g message-command-style fg='#FFFFFF',bg='magenta'
set -g display-time 4000
# }}}
# Window options {{{
# window is only constrained in size if a smaller client is actively looking at it.
# setw -g aggressive-resize on
setw -g automatic-rename on # rename window to reflect current program
set -g renumber-windows on # renumber windows when a window is closed
set -g set-titles on # set terminal title
set -g set-titles-string '#h ❐ #S ● #I #W'
# Format {{{
set -g window-status-separator " "
set -g window-status-format "#I:#W"
# set -g window-status-format "#{=1:#I,A,#I}"
# }}}
# Style {{{
set -g window-status-current-style fg='brightblue, bold'
set -g window-status-activity-style fg='brightyellow'
# }}}
# }}}
# Tmux plugins {{{
set -g @plugin "tmux-plugins/tpm"
set -g @plugin "tmux-plugins/tmux-continuum"
set -g @plugin "tmux-plugins/tmux-yank"
set -g @plugin "tmux-plugins/tmux-copycat"
set -g @plugin "tmux-plugins/tmux-open"
set -g @plugin "tmux-plugins/tmux-pain-control"
set -g @plugin "christoomey/vim-tmux-navigator"
set -g @plugin "tmux-plugins/tmux-sessionist"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
# }}}
# Rebind clock since tmux-sessionist overrides prefix+t {{{
bind T clock-mode # Use prefix + Shift+t for clock
# }}}
# vim: foldmethod=marker:sw=2:foldlevel=10