-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
142 lines (121 loc) · 4.96 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
139
140
141
142
# visual
set -g default-shell /bin/zsh
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
set -g allow-passthrough on
set -g status-fg blue
set -g status-bg black
# set-window-option -g window-status-current-style fg=brightred,bg=default,bright
set -g status-style bg=default
source ~/.tmuxline_snapshot
set -g @prefix_highlight_show_copy_mode 'on'
set -g @prefix_highlight_bg 'colour5'
set -g @prefix_highlight_fg 'black'
set -g @prefix_highlight_option_scope 'g'
# settings
set -g mouse on
set -g focus-events on
set -g history-limit 100000
set -s escape-time 0
set -g status-interval 10
set -g display-time 4000
set-window-option -g automatic-rename on
set -g renumber-windows on
set-option -g set-titles on
set-option -g status-position bottom
set-window-option -g aggressive-resize on
# vim bindings
set-window-option -g mode-keys vi
set -g status-keys vi
# plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-open'
# set -g @plugin 'tmux-plugins/tmux-urlview'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'schasse/tmux-jump'
run '~/.tmux/plugins/tpm/tpm'
set -g @scroll-without-changing-pane "on"
set -g @emulate-scroll-for-no-mouse-alternate-buffer "on"
set -g @scroll-speed-num-lines-per-scroll "2"
set -g @yank_selection_mouse 'clipboard'
set -g @yank_with_mouse off
set -g @override_copy_command 'xclip -selection clipboard -i'
# set -g @yank_action 'copy-pipe'
bind-key r source-file ~/.tmux.conf
bind-key M split-window -h "nvim ~/.tmux.conf"
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'V' send-keys -X select-line
bind-key -T copy-mode-vi 'r' send-keys -X rectangle-toggle
# bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe "xclip -selection clipboard -i"
# unbind -T copy-mode-vi MouseDragEnd1Pane
# bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "xclip -selection clipboard -i"
# bind-key -T copy-mode-vi MouseDown3Pane send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -i"
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -i"
bind-key -T copy-mode-vi Escape send-keys -X cancel
# bind-key Escape copy-mode
bind -T copy-mode-vi i switch-client -T text-object
bind -T text-object w if -F '#{selection_present}' { send -X select-word }
bind -T text-object l if -F '#{selection_present}' { send -X select-line }
bind -T copy-mode-vi v if -F '#{selection_present}' { send -X clear-selection } { send -X begin-selection }
bind-key v split-window -h -c '#{pane_current_path}'
unbind h
bind-key h split-window -v -c '#{pane_current_path}'
bind c new-window -c "#{pane_current_path}"
bind-key b last-window
bind-key Space switch-client -l
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key H resize-pane -L 5
bind-key L resize-pane -R 5
# Close panes/windows without confirmation
# bind-key & kill-window
# bind-key x kill-pane
# bind-key q kill-pane
# bind-key o kill-window -a
# Smart pane switching with awareness of vim splits
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"
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
bind C-p previous-window
bind C-n next-window
bind C-c new-session
bind C-f command-prompt -p find-session 'switch-client -t %%'
# # Double LMB Select & Copy (Word)
# bind-key -T copy-mode-vi DoubleClick1Pane \
# select-pane \; \
# send-keys -X select-word-no-clear \; \
# send-keys -X copy-pipe-no-clear "xclip -selection clipboard -i"
# bind-key -n DoubleClick1Pane \
# select-pane \; \
# copy-mode -M \; \
# send-keys -X select-word \; \
# send-keys -X copy-pipe-no-clear "xclip -selection clipboard -i"
#
# # Triple LMB Select & Copy (Line)
# bind-key -T copy-mode-vi TripleClick1Pane \
# select-pane \; \
# send-keys -X select-line \; \
# send-keys -X copy-pipe-no-clear "xclip -selection clipboard -i"
# bind-key -n TripleClick1Pane \
# select-pane \; \
# copy-mode -M \; \
# send-keys -X select-line \; \
# send-keys -X copy-pipe-no-clear "xclip -selection clipboard -i"
#
# # Middle click to paste from the primary buffer
# unbind-key MouseDown2Pane
# bind-key -n MouseDown2Pane run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer"