-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
90 lines (76 loc) · 2.92 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
# set shell
set -g default-shell $SHELL
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set -g prefix C-q
bind-key C-q send-prefix
# unbind sesh killer
unbind C-d
unbind C-w
# split panes using | and -
unbind '"'
unbind %
bind '\' split-window -h
bind - split-window -v
# quick config reload
unbind r
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
unbind C-z
bind -n C-k clear-history
set -g history-limit 20000
set -g focus-events on
setw -g mode-keys vi
bind -r -T prefix C-h resize-pane -L 5
bind -r -T prefix C-k resize-pane -U 5
bind -r -T prefix C-j resize-pane -D 5
bind -r -T prefix C-l resize-pane -R 5
set -g status off
set -sg escape-time 10
# vim keybindings for copy mode
set -g mouse on
setw -g mode-keys vi
set -s set-clipboard off
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X rectangle-toggle
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -se c -i'
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -se c -i'
# block/beam cursor in normal/insert mode
set -g terminal-overrides ',xterm*:Ss=\E[%p1%d q:Se=\E[ q'
# switch panes using Alt+vi-arrows without prefix
# disable cycling/overflowing
# also, don't allow reapeating `-r` to avoid interfering with vim
unbind Up
unbind Down
unbind Right
unbind Left
bind h run-shell "if [ $(tmux display-message -p '#{pane_at_left}') -ne 1 ]; then tmux select-pane -L; fi"
bind l run-shell "if [ $(tmux display-message -p '#{pane_at_right}') -ne 1 ]; then tmux select-pane -R; fi"
bind k run-shell "if [ $(tmux display-message -p '#{pane_at_top}') -ne 1 ]; then tmux select-pane -U; fi"
bind j run-shell "if [ $(tmux display-message -p '#{pane_at_bottom}') -ne 1 ] ; then tmux select-pane -D; fi"
# fuzzy find a session by name
bind e display-popup -E 'tmux list-sessions | sed "s/:.*//" | fzf --reverse | xargs -I {} tmux switch-client -t {}'
# color
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
set -g pane-border-style fg=colour8
set -g pane-active-border-style fg=colour5
########################################
# List of plugins:
# <prefix>+I => install
# <prefix>+U => update
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# <prefix>+Ctrl+s/r => save/reload
set -g @plugin 'tmux-plugins/tmux-continuum'
# Plugin config
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-strategy-vim 'session'
set -g @continuum-save-interval '2' # in minutes
set -g @continuum-restore 'on'
########################################
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'