/
.tmux.conf
138 lines (119 loc) · 4.97 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
131
132
133
134
135
136
137
138
#{{{ General Settings
set -g status-keys vi
set -g history-limit 10000
setw -g mode-keys vi
setw -g mouse off
set -g default-terminal "screen-256color"
set -sg escape-time 0
set -g display-time 1000
set -g focus-events on
set -g clock-mode-style 12
set -g allow-rename off
set -g automatic-rename off
set -g renumber-windows on
#}}}
#{{{ Bindings
# set Ctrl-s as the default prefix key combination
# and unbind C-b to free it up
set -g prefix C-s
unbind C-b
unbind '"'
unbind %
# Resource
bind R source-file ~/.tmux.conf
# Hide status bar
bind-key a set -g status
# Toggle last window
bind Enter last-window
# Send C-s to application
bind C-s send-prefix
bind c new-window -c '#{pane_current_path}' -n ''
bind C-n next-window
bind C-p previous-window
bind S choose-session
bind-key P swap-window -t -1
bind-key N swap-window -t +1
bind C break-pane
#{{{ Vi like
# Resize panes
bind-key H resize-pane -L 10
bind-key J resize-pane -D 10
bind-key K resize-pane -U 10
bind-key L resize-pane -R 10
# Selection/copy
bind-key -Tcopy-mode-vi v send -X begin-selection
bind-key -Tcopy-mode-vi C-v send -X rectangle-toggle
bind-key -Tcopy-mode-vi y send -X copy-pipe-and-cancel "xclip -selection clipboard"
bind-key u copy-mode -u
bind-key C-u copy-mode -u
bind-key C-b copy-mode -u
bind ] run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
# Split
bind-key s split-window -c '#{pane_current_path}'
bind-key v split-window -h -c '#{pane_current_path}'
# Windows
bind Q kill-window
bind ^ last-window
bind r rotate-window
#}}}
#}}}
#{{{ Color
set-option -g status-bg white
set-option -g status-fg yellow
set-option -g status-attr default
set-window-option -g window-status-fg brightyellow
set-window-option -g window-status-bg default
set-window-option -g window-status-current-fg default
set-window-option -g window-status-current-bg default
set-option -g pane-border-fg white
set-option -g pane-active-border-fg brightyellow
set-option -g message-bg white
set-option -g message-fg brightred
set-option -g display-panes-active-colour blue
set-option -g display-panes-colour brightred
set-window-option -g clock-mode-colour green
set -g pane-active-border-style fg=default
#}}}
#{{{ Status Bar
set-option -g status on
set -g window-status-format " #I "
set -g window-status-current-format " #I "
set -g window-status-activity-style fg=magenta
set -g window-status-bell-style fg=magenta
set -g window-status-current-attr reverse
set -g window-status-activity-attr reverse
set -g window-status-bell-attr reverse
set -g status-right-length 20
set -g status-left-length 20
set -g status-left '#(~/.scripts/echo_info.sh --no-date)'
set -g status-right '#(~/.scripts/echo_info.sh --date-only)'
set -g status-interval 5
set -g status-justify centre
#}}}
#{{{ Plugin manager
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'dequis/tmux-url-select'
run-shell '~/.tmux/plugins/tpm/tpm'
#}}}
#{{{ Plugins configuration
bind o run '~/.tmux/plugins/tmux-url-select/tmux-url-select.pl'
bind C-o run '~/.tmux/plugins/tmux-url-select/tmux-url-select.pl'
#}}}
#{{{ vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key C-h if-shell "$is_vim" "send-keys C-h" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux left'"
bind-key C-j if-shell "$is_vim" "send-keys C-j" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux down'"
bind-key C-k if-shell "$is_vim" "send-keys C-k" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux up'"
bind-key C-l if-shell "$is_vim" "send-keys C-l" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux right'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux left'"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux down'"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux up'"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux right'"
bind-key h if-shell "$is_vim" "send-keys C-h" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux left'"
bind-key j if-shell "$is_vim" "send-keys C-j" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux down'"
bind-key k if-shell "$is_vim" "send-keys C-k" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux up'"
bind-key l if-shell "$is_vim" "send-keys C-l" "run '~/.scripts/ratpoison/rat_tmux-navigator.sh tmux right'"
#}}}
# vim:fdm=marker