-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdot_tmux.conf
87 lines (65 loc) · 3.02 KB
/
dot_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
source ~/.config/powerline/tmuxline.sh
set exit-empty off
# set inactive/active window styles
set -g window-style 'bg=colour254'
set -g window-active-style 'bg=colour255'
#pane border
set -g pane-border-style 'bg=colour254'
set -g pane-active-border-style 'bg=colour254'
#set -g pane-border-fg colour238
#set -g pane-active-border-bg colour236
#set -g pane-active-border-fg colour51
set -g default-command "zsh -l"
set -g default-terminal "screen-256color"
set -g renumber-windows on
set -g base-index 1
set -g mouse on
setw -g mode-keys vi
setw -g clock-mode-style 12
set -g focus-events on
set-option -g status-interval 5
set-option -g automatic-rename on
set-option -g automatic-rename-format '#{b:pane_current_path}'
# Bind Keys
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
## Splits
bind-key | split-window -h -c '#{pane_current_path}'
bind-key - split-window -v -c '#{pane_current_path}'
bind-key j swap-pane -D
bind-key k swap-pane -U
bind-key h swap-window -d -t -1
bind-key l swap-window -d -t +1
bind c new-window -a -c "#{pane_current_path}"
#bind C confirm-before -p "kill-window #W? (y/n)" kill-window
#bind o confirm-before -p "kill-window #W? (y/n)" kill-window
# kill-window -t #W -a
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi 'C-v' send -X begin-selection \; send -X rectangle-toggle
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
## Navigation
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 -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
## Resize
# Edit values if you use custom resize_count variables
bind-key -n M-h if-shell "$is_vim" "send-keys M-h" "resize-pane -L 10"
bind-key -n M-j if-shell "$is_vim" "send-keys M-j" "resize-pane -D 5"
bind-key -n M-k if-shell "$is_vim" "send-keys M-k" "resize-pane -U 5"
bind-key -n M-l if-shell "$is_vim" "send-keys M-l" "resize-pane -R 10"
bind-key -T copy-mode-vi M-h resize-pane -L 10
bind-key -T copy-mode-vi M-j resize-pane -D 5
bind-key -T copy-mode-vi M-k resize-pane -U 5
bind-key -T copy-mode-vi M-l resize-pane -R 10