-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
104 lines (77 loc) · 3.18 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
# allow copying from nvim to system keyboard
set-option -g default-command "reattach-to-user-namespace -l zsh"
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind '\' split-window -h
bind - split-window -v
unbind '"'
unbind %
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
# allow copying to system clipboard with y
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" \; display-message "Copied to clipboard."
# switch window using Shift-arrow without prefix
bind ] next-window
bind [ previous-window
# Enable/disable mouse mode (tmux 2.1 and above)
set -g mouse on
# don't rename windows automatically
set-option -g allow-rename off
# set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g status-keys vi
set -g history-limit 10000
setw -g mode-keys vi
setw -g monitor-activity on
set -sg escape-time 10
set -sg repeat-time 10
unbind-key -T root Escape # escape shouldn't go to previous window
# THEME
set -g visual-activity off
# COLOUR (base16)
# default window title colors
set -g window-status-style fg="#cdd3de",bg="default"
# active window-title colors
set -g window-status-current-style fg="#d8dee9",bg="#4F5B66"
# default statusbar colors
set -g status-style fg="#A7ADBA",bg="#1d2433"
# pane border
set -g pane-border-style fg="#4F5B66",bg="#131924"
set-option -g pane-active-border-style fg="#4F5B66",bg="#080c14"
# message text
set-option -g message-style fg="#C0C5CE",bg="#1d2433"
# pane number display
set-option -g display-panes-active-colour "#99C794"
set-option -g display-panes-colour "#FAC863"
# clock
set-window-option -g clock-mode-colour "#99C794"
# copy mode highligh
set-window-option -g mode-style fg="#A7ADBA",bg="#4F5B66"
# bell
set-window-option -g window-status-bell-style fg="#1d2433",bg="#EC5f67"
set -g window-status-format " #I: #W "
set -g window-status-current-format " #I: #W "
set -g status-interval 60
set -g status-left-length 30
set -g status-left ''
run-shell ~/.config/tmux/tmux-resurrect/resurrect.tmux