-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.base.conf
93 lines (76 loc) · 3.21 KB
/
tmux.base.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
setw -g mode-keys vi
unbind C-b
unbind r
unbind h
unbind j
unbind k
unbind l
unbind '"'
unbind %
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind -T copy-mode-vi C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-vi C-WheelDownPane send-keys -X halfpage-down
bind -T copy-mode-emacs C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down
# To copy, left click and drag to highlight text in yellow,
# once you release left click yellow text will disappear and will automatically be available in clibboard
# # Use vim keybindings in copy mode
setw -g mode-keys vi
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",*256col*:Tc"
set -g xterm-keys on
set-option -g prefix C-a
set-option -sg escape-time 10
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
bind-key C-a last-window
bind r source-file ~/.tmux.conf
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind v split-window -h -c '#{pane_current_path}'
bind s split-window -v -c '#{pane_current_path}'
bind c new-window -c '#{pane_current_path}'
bind - resize-pane -D 10
bind = resize-pane -U 10
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
## set status bar
set -g status on
set -g status-interval 2
set -g status-fg colour231
set -g status-bg colour23
set -g status-left-length 20
set -g status-position bottom
set -ga terminal-overrides ",*256col*:Tc"
set -g status-left '#[fg=colour121,bg=colour23,bold] %l:%M %p #[fg=colour236,bg=colour234,nobold]'
set -g window-status-format "#[fg=colour23,bg=colour23]#[fg=colour72,bg=colour23] #I #[fg=colour72]#[fg=colour72] #W #[fg=colour23,bg=colour23,nobold]"
set -g window-status-current-format "#[fg=colour23,bg=colour121]#[fg=colour23,bg=colour121] #I #[fg=colour121,bg=colour72,bold] #[fg=colour23]#W #[fg=colour72,bg=colour23,nobold]"
set -g base-index 1
## Remote nested session
bind -T root F12 \
set prefix None \;\
set key-table off \;\
set -g status off \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off F12 \
set -g status on \;\
set -u prefix \;\
set -u key-table \;\
refresh-client -S
wg_is_keys_off="#[fg=colour8,bg=colour9,bold]#([ $(tmux show-option -qv key-table) = 'off' ] && echo '| OFF |')#[default]"
set -g status-right "$wg_is_keys_off DONE IS BETTER THAN PERFECT"
set-option -ga terminal-overrides ",xterm-256color:Tc"
new-session -s main