-
Notifications
You must be signed in to change notification settings - Fork 2
/
.tmux.conf
103 lines (77 loc) · 3.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
# @file .tmux.conf
# @brief Termux configuration file.
# @author clemedon (Clément Vidon)
#------------------------------------------------------------------------------#
# plugins #
#------------------------------------------------------------------------------#
# set -g @plugin 'tmux-plugins/tpm'
# set -g @plugin 'tmux-plugins/tmux-resurrect' # c-s / c-r
#------------------------------------------------------------------------------#
# ui #
#------------------------------------------------------------------------------#
set-option -g default-shell /bin/zsh
# COLORS # tmux termgui colors
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# [ Title ]
# auto-set win title
set-window-option -g automatic-rename on
set -g set-titles on
set -g set-titles-string "#T"
# [ Status bar ]
set -g status off
set -g status-style fg=colour15,bg=colour0
set -g status-left "P#{pane_index} "
set -g status-right "#(uptime | cut -f 2 -d 'p' | cut -f 1 -d ',' ) Up %g%m%d (%a) %R "
bind b set status
# [ Borders colours ]
set -g pane-border-style fg=colour0
set -g pane-active-border-style "bg=default fg=colour0"
#------------------------------------------------------------------------------#
# ergonomic #
#------------------------------------------------------------------------------#
# [ changing prefix ]
if-shell "[ $(hostname) = 'ghost' ]" { unbind C-Space }
if-shell "[ $(hostname) = 'ghost' ]" { set -g prefix C-Space }
if-shell "[ $(hostname) = 'ghost' ]" { bind C-Space send-prefix }
# [ Current path pane ]
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# [ Keymode ]
setw -g mode-keys vi
set -s escape-time 0
# [ Copy mode ]
# prefix + ] to paste
set -g set-clipboard off
# bind -T copy-mode-vi v send-keys -X begin-selection
# bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel
# bind -T copy-mode-vi C-v send-keys -X rectangle-toggle \; send -X begin-selection
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
if-shell -b 'command -v xclip' {
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -sel clip -i"
}
set -g history-limit 5000
# [ Pane management ]
# nav
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R # :last-window
# resize
bind -n C-S-Up resize-pane -U
bind -n C-S-Down resize-pane -D
bind -n C-S-Left resize-pane -L
bind -n C-S-Right resize-pane -R
bind -n C-Up resize-pane -U 5
bind -n C-Down resize-pane -D 5
bind -n C-Left resize-pane -L 5
bind -n C-Right resize-pane -R 5
#------------------------------------------------------------------------------#
# misc #
#------------------------------------------------------------------------------#
bind S setw synchronize-panes
bind R source-file ~/.tmux.conf