-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
121 lines (88 loc) · 4.53 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
set -g default-terminal "screen-256color" # colors!
# force SHELL ENV variable as shell
set-option -g default-shell ${SHELL}
setw -g xterm-keys on
set -s escape-time 10 # faster command sequences
set -sg repeat-time 600 # increase repeat timeout
set -s focus-events on
set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2)
setw -q -g utf8 on
set -g history-limit 5000 # boost history
set -g prefix2 C-y # Set Control + Y as prefix
bind C-y send-prefix -2
# -- display -------------------------------------------------------------------
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
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 display-panes-time 800 # slightly longer pane indicators display time
set -g display-time 1000 # slightly longer status messages display time
set -g status-interval 10 # redraw status line every 10 seconds
# clear both screen and history
bind -n C-l send-keys C-l \; run 'sleep 0.1' \; clear-history
# activity
set -g monitor-activity on
set -g visual-activity off
# -- navigation ----------------------------------------------------------------
# create session
bind C-c new-session
# find session
bind C-f command-prompt -p find-session 'switch-client -t %%'
# split current window horizontally
bind - split-window -v
# split current window vertically
bind _ split-window -h
# pane navigation
bind -r h select-pane -L # move left
bind -r j select-pane -D # move down
bind -r k select-pane -U # move up
bind -r l select-pane -R # move right
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
bind Tab last-window # move to last active window
# -- copy mode -----------------------------------------------------------------
bind Enter copy-mode # enter copy mode
run -b 'tmux bind -t vi-copy v begin-selection 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi v send -X begin-selection 2> /dev/null || true'
run -b 'tmux bind -t vi-copy C-v rectangle-toggle 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi C-v send -X rectangle-toggle 2> /dev/null || true'
run -b 'tmux bind -t vi-copy y copy-selection 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/null || true'
run -b 'tmux bind -t vi-copy Escape cancel 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi Escape send -X cancel 2> /dev/null || true'
run -b 'tmux bind -t vi-copy H start-of-line 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi H send -X start-of-line 2> /dev/null || true'
run -b 'tmux bind -t vi-copy L end-of-line 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true'
# copy to X11 clipboard
if -b 'command -v xsel > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xsel -i -b"'
if -b '! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xclip -i -selection clipboard >/dev/null 2>&1"'
# copy to Windows clipboard
# -- Status Line --------------------------------------------------------------------
# Length of tmux status line
set -g status-left-length 1000
set -g status-right-length 1000
set -g status-position bottom
set -g status-right-style 'fg=#8a8a8a,bg=#080808'
set -g status-left-style 'fg=#8a8a8a,bg=#080808'
set -g status-style 'fg=#8a8a8a,bg=#080808'
set -g message-command-style 'fg=#ffff00,bg=#000000,bright'
set -g message-style 'fg=#000000,bg=#ffff00,bright'
set -g display-panes-active-colour '#00afff'
set -g display-panes-colour '#00afff'
set -g status-left "#[fg=#000000, bg=#ffff00] ❐ #S \
#[fg=#ffffff, bg=#ff00af] ↑ #(sh ~/.dotfiles/tmux/uptime.sh)#[default] "
set -g status-right "#[fg=#ff00af]|#[default] %R #[fg=#ff00af]|#[default] \
%d.%m.%Y #[fg=#ff00af]|#[default] \
#(cut -d ' ' -f -3 | cut -d ' ' -f -1 /proc/loadavg) \
#[fg=#000000,bg=#5fff00,bold] #(echo $USER)#[fg=#000000,bg=#e4e4e4,bold]@#H "
set -g window-status-current-format "\
#[fg=#000000, bg=#00afff] #I \
#[fg=#000000, bg=#00afff, bold] #W \
#[default]"
set -g window-status-format "\
#[fg=#000000, bg=#838383] #I \
#[fg=#000000, bg=#838383, none] #W "
set -g set-titles-string "#h ❐ #S ● #I #W"
bind R source-file ~/.tmux.conf \; display-message "Config reloaded..."