-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
47 lines (36 loc) · 1.66 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
# Pane resizing
bind-key -n ^up resize-pane -U 5
bind-key -n ^down resize-pane -D 5
bind-key -n ^left resize-pane -L 5
bind-key -n ^right resize-pane -R 5
set-window-option -g mode-keys vi
bind-key -n ^space copy-mode
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe "xclip -se c -i"
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
set -g status off
set -g pane-border-style fg=colour238
set -g pane-active-border-style "bg=default fg=colour238"
# Pane switching
bind-key -n ^h if-shell "$is_vim" "send-keys ^h" "select-pane -L"
bind-key -n ^j if-shell "$is_vim" "send-keys ^j" "select-pane -D"
bind-key -n ^k if-shell "$is_vim" "send-keys ^k" "select-pane -U"
bind-key -n ^l if-shell "$is_vim" "send-keys ^l" "select-pane -R"
bind-key -n ^\ if-shell "$is_vim" "send-keys ^\\" "select-pane -l"
# Misc window bindings
bind-key -n ^_ split-window
bind-key -n ^\ split-window -h
bind-key -n ^q confirm kill-pane
# Copy/Paste
bind-key -n ^y if-shell "$is_vim" "send-keys ^y" "run \"tmux save-buffer - | xclip -i -sel clip > /dev/null\""
bind-key -n ^p if-shell "$is_vim" "send-keys ^p" "run \"xclip -o -sel clip | tmux load-buffer - ; tmux paste-buffer\""
# Enable selection of pane and scrolling with mouse
set -g mouse on
# Fix printing garbage characters to the screen after mouse selection
set -g set-clipboard off
bind-key -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "xclip -se c -i"
# No delay after pressing escape
set -sg escape-time 0
set -g default-terminal "screen-256color"
# enable 24 bit support
set -g terminal-overrides ",xterm-256color:Tc"