-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
138 lines (102 loc) · 3.75 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
set-option -g prefix C-q
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'brokenricefilms/tmux-fzf-session-switch'
set -g @jump-key 'f'
set -g @fzf-goto-session 'f'
set-option -g mouse on
#tmux-resurrect
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-processes 'irb pry "~rails server" "~rails console"'
set -g @resurrect-save 'S'
set -g @resurrect-restore 'R'
set-option -g default-shell /bin/zsh
set-option -g default-command /bin/zsh
set-option -s escape-time 0
bind-key C-q send-prefix
unbind-key C-b
bind-key C-n switch-client -n
bind-key C-p switch-client -p
bind-key | split-window -h -c "#{pane_current_path}"
bind-key - split-window -c "#{pane_current_path}"
bind-key c new-window -c "~" -a
# Change active window
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# Resize pane
bind-key -r H resize-pane -L 5
bind-key -r J resize-pane -D 5
bind-key -r K resize-pane -U 5
bind-key -r L resize-pane -R 5
# Change active pane
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# Break or kill pane
bind-key x kill-pane
bind-key Q kill-session
bind-key d kill-window
bind-key w choose-window -Z -O creation
bind-key s choose-session -Z -O name
# Display pane
# bind-key i display-panes
# Key-bindings
# Reload config file
bind-key r source-file ~/.tmux.conf\; display-message "[tmux] ~/.tmux.conf reloaded!"
bind-key C-r source-file ~/.tmux.conf\; display-message "[tmux] ~/.tmux.conf reloaded!"
bind-key v copy-mode \; display "Copy mode!"
bind-key C-v copy-mode \; display "Copy mode!"
bind-key C-t copy-mode \; display "Copy mode!"
set-option -g history-limit 7500
bind-key -T edit-mode-vi Up send-keys -X history-up
bind-key -T edit-mode-vi Down send-keys -X history-down
unbind-key -T copy-mode-vi Space
bind-key -T copy-mode-vi v send-keys -X begin-selection
unbind-key -T copy-mode-vi Enter
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
# System window by supported OS
set-option -g set-titles on
set-option -g set-titles-string "[tmux] #T @ #H"
# Display time
set-option -g display-time 3500
## Window
# Start window index 1 origin
set-option -g base-index 1
# Start pane index 1 origin
set-window-option -g pane-base-index 1
# Appearance
set-option -g status-position top
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
## Customize statusline
# Length left
set-option -g status-left-length 90
set-option -g status-right-length 90
# Contents right
set-option -g status-right '#[fg=white]#(~/.tmux/bin/wifi)#[default] #(~/.tmux/bin/battery --tmux) [%Y-%m-%d(%a) %H:%M]'
# Centerize
set-option -g status-justify centre
# Enable statusbar top
set-option -g status-position top
set-window-option -g mode-keys vi
bind-key -T prefix C-e split-window \
"$SHELL --login -i -c 'navi --print | ghead -c -1 | tmux load-buffer -b tmp - ; tmux paste-buffer -p -t {last} -b tmp -d'"
set -g pane-border-style fg=magenta
set -g pane-active-border-style fg=green
set -g pane-active-border-style bg=default
set -g status-bg colour238
set -g status-fg white
set -g window-status-current-style bg=colour92
set-option -g renumber-windows on
bind-key -r -T prefix Up run-shell 'tmux list-windows | head -n 1 | grep -q active || tmux swap-window -d -t -1'
bind-key -r -T prefix Down run-shell 'tmux list-windows | tail -n 1 | grep -q active || tmux swap-window -d -t +1'
set-option -g status-interval 1
set-option -g automatic-rename on
set-option -g automatic-rename-format '#{b:pane_current_path}'
# disable all notifications
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-option -g bell-action none
run '~/.tmux/plugins/tpm/tpm'