-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
119 lines (98 loc) · 3.94 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
# set prefix command to ctrl a
unbind-key C-b
set-option -g prefix C-a
#
#
# 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"
# remap ctrl t to open a new window and ctrl w to close it
bind -n C-t "new-window"
bind -n C-w "kill-window"
set -g status-bg colour40
setw -g window-status-current-style bg=colour40
bind -n M-F11 set -qg status-bg colour25
bind -n M-F12 set -qg status-bg colour40
bind -n S-up \
send-keys M-F12 \; \
set -qg status-bg colour25 \; \
unbind -n C-h \; \
unbind -n C-j \; \
unbind -n C-k \; \
unbind -n C-l \; \
unbind -n C-t \; \
unbind -n C-w \; \
set -qg prefix C-b
bind -n S-down \
send-keys M-F11 \; \
set -qg status-bg colour40 \; \
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-t "new-window" \; \
bind -n C-w "kill-window" \; \
set -qg prefix C-a
# set the base index to 1 for panes or windows
set -g base-index 1
set-window-option -g pane-base-index 1
set -s escape-time 0
# Mouse
set -g mouse on
# allow 256 colors in terminal
# set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",tmux-256color:Tc"
# set-window-option -g utf8 on
# v and y like vi in copy-mode
setw -g mode-keys vi
set -g status-keys vi
# New windows/pane in $PWD
# bind c new-window -c "#{pane_current_path}"
# commented because provided by tmux-sensible
# No delay for escape key press
# set -sg escape-time 0
# commented because provided by tmux-sensible
# Copy-paste integration
# set-option -g default-command "reattach-to-user-namespace -l zsh"
# # Setup 'v' to begin selection as in Vim
# bind-key -t vi-copy v begin-selection
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
#
# # Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi 'Enter' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
#
# # Bind ']' to use pbpaste
bind ] run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
source-file ~/.tmuxstatus.conf
set -g @prefix_highlight_show_copy_mode 'on'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-urlview'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# for vim
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-capture-pane-contents 'on'
set -g @continuum-boot 'on'
set -g @continuum-boot-options 'iterm,fullscreen'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin '[email protected]/user/plugin'
# set -g @plugin '[email protected]/user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'