-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
130 lines (101 loc) · 4.28 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
set-option -g default-shell "/bin/zsh"
# enabling 256 color output
set-option -g default-terminal "screen-256color"
# set-option -ga terminal-overrides ",$TERM:Tc"
run-shell '~/dotfiles/tmux/append-option terminal-overrides "$TERM:Tc"'
set-option -g history-limit 99999
# for focus autocommands in vim
set-option -g focus-events on
# pane border color
set-option -g pane-active-border-style "bg=red,fg=yellow"
# allow long press to work as repeated key presses (at least on windows terminal)
set-option -g repeat-time 550
# don't wrap search around the end of pane
set-option -g wrap-search off
# attach to the most recent session when the current one is destroyed
set-option -g detach-on-destroy off
# guess what that does
set-window-option -g mode-keys vi
# vi mode is perfect for navigating large amounts of text lines but for command
# line editing there's nothing better than emacs mode
set-window-option -g status-keys emacs
# allows using modifiers (Shift, Ctrl, Alt) with function keys
set-window-option -g xterm-keys on
# lower esace delay
set-option -g escape-time 10
# fix the garbage output upon yanking
set-option -s set-clipboard off
# statusbar
set-option -g status-bg colour235
set-option -g status-fg colour4
set-option -g status on
set-option -g status-interval 10
set-option -g status-justify "centre"
set-option -g status-left-length 120
set-option -g status-right-length 120
# statusbar
set-option -g status-left "#(~/dotfiles/tmux/status-line-linux left)"
set-option -g status-right "#(~/dotfiles/tmux/status-line-linux right)"
set-option -g message-command-style "bg=red"
set-option -g message-style "bg=black,fg=colour12"
set-option -g mode-style "bg=blue,fg=black"
set-window-option -g window-status-current-format \
"#[bg=colour235,fg=colour8]#{?#I,| ,}#[fg=#{?window_zoomed_flag,colour13,#{?#(echo #F | sed -n 's/.*M.*/1/p'),green,colour6}},bold]#I:#W"
set-window-option -g window-status-format \
"#[bg=colour235,fg=colour8]#{?#I,| ,}#[fg=#{?window_zoomed_flag,colour13,#{?#(echo #F | sed -n 's/.*M.*/1/p'),green,colour8}}]#I:#W"
set-window-option -g display-panes-time 10000
set-window-option -g display-time 0
set-window-option -g pane-border-style "fg=default"
set-window-option -g pane-active-border-style "fg=blue"
set-window-option -g pane-border-format \
'{ (#[fg=cyan]#{pane_id}#[default])[#[fg=green]#{pane_tty}#[default]]\
#[fg=magenta]#{pane_current_command}#[default] #[fg=green]@#[default]\
#[fg=blue]#{pane_current_path}#[default] [#[fg=red]#{pane_mode}#[default]]\
#[default] #{scroll_region_upper}-#{scroll_region_lower} }'
set-option -g word-separators ' -_@/:."({[]})'"'"
# enabling C-s mappings in vim
unbind C-s
unbind -n C-s
# rebing prefix key
unbind C-b
set -g prefix C-q
bind C-Space send-prefix
# this is the default binding, but I unbind it in inner.conf, so it needs to be
# rebound back again
bind-key d detach-client
# switch ; and : key bindings in correspondence to my vim's setup
bind-key \; command-prompt
bind-key : last-pane
# switch "focus" between outer tmux and inner tmux
bind-key O source-file ~/dotfiles/tmux/outter.conf
bind-key I source-file ~/dotfiles/tmux/inner.conf
# these are for highlighting the status bar of the "focused" tmux
bind-key M-F11 set-option -g status-bg colour0\; set-option -g status on
bind-key M-F12 set-option -g status-bg colour8\; set-option -g status off
# load more key-mappings
source-file ~/dotfiles/tmux/common-bindings.conf
# load local config if it's there
if-shell '[ -f ~/.tmux-local.conf ]'\
'source-file ~/.tmux-local.conf'
# load version specific config
if-shell '~/dotfiles/scripts/tmuxversion.sh 2.1'\
'source-file ~/dotfiles/tmux/new.conf'\
'source-file ~/dotfiles/tmux/old.conf'
# load vi copy-mode configuration
if-shell '~/dotfiles/scripts/tmuxversion.sh 2.5'\
'source-file ~/dotfiles/tmux/vi-mode-new.conf'\
'source-file ~/dotfiles/tmux/vi-mode-old.conf'
# set -g @resurrect-save-shell-history 'off'
# set -g @resurrect-save 'M-s'
# set -g @resurrect-restore 'M-r'
# set -g @resurrect-strategy-vim 'session'
# set -g @resurrect-strategy-nvim 'session'
# set -g @resurrect-processes '\
# sqlite3 \
# rtorrent \
# cmus \
# ipython3 \
# ipython \
# '
# run-shell ~/dotfiles/tmux-resurrect/resurrect.tmux
# run-shell ~/dotfiles/tmux-continuum/continuum.tmux