-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
131 lines (102 loc) · 3.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
122
123
124
125
126
127
128
129
130
131
set -g prefix Home
unbind C-b
bind-key Home send-prefix
bind r source-file ~/.tmux.conf \; display 'Tmux reloaded'
set -g default-terminal "screen-256color"
set -s escape-time 0
set -g mouse on
set -g status-keys emacs
set-option -g status-position top
# synchronize panes toggle
bind C-s set-window-option synchronize-panes
bind q switch-client -t'{marked}'
# copy mode
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
unbind P
bind P paste-buffer
# split panes using | and -
bind | split-window -h
bind _ split-window -v
unbind '"'
unbind %
# window navigation
setw -g automatic-rename off
setw -g mode-keys vi
setw -g pane-base-index 1
setw -g aggressive-resize on
setw -g pane-base-index 1
set -g base-index 1
set -g status-interval 10
# switch panes
bind l select-pane -L
bind h select-pane -R
bind k select-pane -U
bind j select-pane -D
# quick switch window
bind -r C-h select-window -t:-
bind -r C-l select-window -t:+
# resize pane
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# Bind Alt+j to move to the window
bind -n M-h previous-window
bind -n M-l next-window
# kill pane, window
unbind-key x
bind-key x kill-pane
bind-key X kill-session
# tmux session switch
set -g @fzf-goto-session 'F'
set-option -g @fzf-goto-session-only 'true'
# jump config
set -g @jump-key 's'
# link open
set -g @fzf-url-bind 'u'
# session wizard
set -g @session-wizard 't'
# thumb config
set -g @thumbs-key f
# set -g @thumbs-command 'echo -n {} | wl-copy'
# Floating key bind
set -g @floax-bind '-n M-p'
# decide whether we're in a Vim process
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -n 'C-Space' if-shell "$is_vim" 'send-keys C-Space' 'select-pane -t:.+'
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
bind-key -T copy-mode-vi 'C-Space' select-pane -t:.+
# clear screen
bind C-l send-keys 'C-l'
# plugins
set -g @plugin 'laktak/extrakto'
set -g @plugin 'schasse/tmux-jump'
set -g @plugin 'thuanOwa/tmux-fzf-session-switch'
set -g @plugin 'wfxr/tmux-fzf-url'
set -g @plugin 'fcsonline/tmux-thumbs'
set -g @plugin '27medkamal/tmux-session-wizard'
set -g @plugin 'omerxx/tmux-floax'
set -g @plugin 'niksingh710/minimal-tmux-status'
# theme config
set -g @minimal-tmux-status "top"
run-shell ~/.tmux/plugins/tmux-thumbs/tmux-thumbs.tmux
# install tmp for new machine
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'