-
Notifications
You must be signed in to change notification settings - Fork 4
/
.tmux.conf
77 lines (68 loc) · 2.21 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
unbind C-b
set -g prefix C-a
unbind %
bind | split-window -h
bind \ split-window -v
set -g set-titles on
set -g set-titles-string "#T"
setw -g automatic-rename on
setw -g monitor-activity on
set -g visual-activity on
set -g default-terminal "xterm-256color"
set-option -g default-shell /bin/zsh
set-option -g renumber-windows-on
set -g status-right " %a %h-%d %H:%M "
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded"
bind C-a send-prefix
# quick pane cycling
#unbind ^A
#bind ^A select-pane -t :.+
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
#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"
# List of plugins
# Supports `github_username/repo` or full git repo URLs
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-sensible \
'
# Other examples:
# github_username/plugin_name \
# [email protected]/user/plugin \
# [email protected]/user/plugin \
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-yank \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-continuum \
'
set -g @continuum-restore 'on'
# for vim
set -g @resurrect-strategy-vim 'session'
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run-shell '~/.tmux/plugins/tpm/tpm'
# to fix the 112 issue in vim
set-option -g terminal-overrides ',xterm*:Cr=\E]12;gray\007'
set -g mouse on
set -s escape-time 1
set -g base-index 1
setw -g pane-base-index 1
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
bind C-c run 'tmux save-buffer - | xclip -i -sel clipboard'
bind C-v run 'tmux set-buffer | \"$(xclip -o -sel clipboard)\"; tmux paste-buffer'