-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
108 lines (94 loc) · 3.47 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
set -g prefix C-a # Prefix is Ctrl-a
bind C-a send-prefix # Ensure that we can send Ctrl-A to other apps
unbind C-b
# visual notification of activity in other windows
set -g visual-activity off
setw -g monitor-activity on
set -g base-index 1 # 0 is on the other side of keyboard
set -g default-terminal "tmux-256color"
set -g focus-events on
set -g history-limit 1000
set -g mode-keys vi
set -sg escape-time 0
set-option -g mouse on
set-option -g set-titles on
set-option -sa terminal-overrides ",xterm-256color:RGB"
set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g -a terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
set -g status-style bg=default
set -g status-left '#(cat #{socket_path}-\#{session_id}-vimbridge)'
set -g status-left-length 90
set -g status-right '#(cat #{socket_path}-\#{session_id}-vimbridge-R)'
set -g status-right-length 90
set -g status-justify absolute-centre
setw -g xterm-keys on
setw -g automatic-rename on
# y and p as in vim
set -g set-clipboard on
bind Escape copy-mode
unbind p
bind-key p paste-buffer
unbind -Tcopy-mode-vi Enter
bind-key -Tcopy-mode-vi v send -X begin-selection
bind-key -Tcopy-mode-vi y send -X copy-pipe-and-cancel "pbcopy"
bind-key -Tcopy-mode-vi Enter send -X copy-pipe-and-cancel "pbcopy"
bind-key -Tcopy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
bind -T copy-mode-vi MouseDown1Pane select-pane \;\
send-keys -X clear-selection
# easy-to-remember split pane commands
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
# moving between panes with vim movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resize panes with vim movement keys
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
#setw -g aggressive-resize on # Switching between small and big screens
# Smart pane switching with awareness of vim splits
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n 'C-\' if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind -n "C-\\" run-shell 'tmux-vim-select-pane -l'
# Quick pane selection
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# Bring back clear screen under tmux prefix
bind C-l send-keys 'C-l'
# =====================================
# === Renew environment ===
# =====================================
set -g update-environment \
"DISPLAY\
SSH_ASKPASS\
SSH_AUTH_SOCK\
SSH_AGENT_PID\
SSH_CONNECTION\
SSH_TTY\
WINDOWID\
XAUTHORITY"
set -g @resurrect-save-bash-history 'on'
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-strategy-nvim 'session'
# set -g @resurrect-capture-pane-contents 'on' # switches to vanilla Bash
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-logging'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'schasse/tmux-jump'
set -g @continuum-boot-options 'iterm,fullscreen'
set -g @continuum-restore 'on'
set -g @open-S 'https://www.google.com/search?q='
run '~/.tmux/plugins/tpm/tpm'
#source ~/tmuxline.conf