-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
82 lines (68 loc) · 3.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
78
79
80
81
82
# improve colors
set -g default-terminal 'screen-256color'
#set -g default-terminal "xterm"
# act like vim
#setw -g mode-keys vi
#bind h select-pane -L
#bind j select-pane -D
#bind k select-pane -U
#bind l select-pane -R
#bind-key -r C-h select-window -t :-
#bind-key -r C-l select-window -t :+
# act like GNU screen
unbind C-b
set -g prefix C-a
# start window numbers at 1 to match keyboard order with tmux window order
set -g base-index 1
set-window-option -g pane-base-index 1
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# increase scrollback lines
set -g history-limit 10000
# switch to last pane
#bind-key C-a last-pane
# Scrolling in tmux
set -g mouse on
#bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M; send-keys -M; send-keys -M; send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M; send-keys -M; send-keys -M; send-keys -M' 'copy-mode -e; send-keys -M; send-keys -M; send-keys -M; send-keys -M'"
#bind -n WheelDownPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M; send-keys -M; send-keys -M; send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M; send-keys -M; send-keys -M; send-keys -M' 'copy-mode -e; send-keys -M; send-keys -M; send-keys -M; send-keys -M'"
set -g @scroll-speed-num-lines-per-scroll 1
bind-key -T copy-mode-vi WheelUpPane send -N1 -X scroll-up
bind-key -T copy-mode-vi WheelDownPane send -N1 -X scroll-down
# reattach-to-user-namespace, specify zssh or any other shell
#set-option -g default-command "reattach-to-user-namespace -l zsh"
#bind-key -T copy-mode C-\ send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode C-w send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode Enter send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# Toggle mouse on with ^B m
bind m \
set -g mouse on \;\
display 'Mouse: ON'
# Toggle mouse off with ^B M
bind M \
set -g mouse off \;\
display 'Mouse: OFF'
# copy/paste enhancements
# https://gist.github.com/brendanhay/1769870
#setw -g mode-keys vi
#bind-key -T edit-mode-vi Up send-keys -X history-up
#bind-key -T edit-mode-vi Down send-keys -X history-down
#unbind-key -T copy-mode-vi Space ; bind-key -T copy-mode-vi v send-keys -X begin-selection
unbind-key -T copy-mode-vi Enter ; bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
#unbind-key -T copy-mode-vi C-v ; bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
#unbind-key -T copy-mode-vi [ ; bind-key -T copy-mode-vi [ send-keys -X begin-selection
#unbind-key -T copy-mode-vi ] ; bind-key -T copy-mode-vi ] send-keys -X copy-selection
# disable preview while switching sessions
bind-key w choose-tree -N
# TPM
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
#set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
#set -g @plugin 'tmux-plugins/tmux-continuum'
# 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'
#set -g @continuum-restore 'on'