-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_tmux.conf
138 lines (98 loc) · 4.5 KB
/
dot_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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# vim style tmux config
# to reset tmux use tmux kill-server
# to start use tmux new-session -s <name>
#
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
# Easy config reload
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
# vi is good
setw -g mode-keys vi
# mouse behavior
setw -g mouse on
set-option -g default-terminal screen-256color
bind-key : command-prompt
bind-key r refresh-client
bind-key L clear-history
bind-key space next-window
bind-key bspace previous-window
bind-key enter next-layout
# use vim-like keys for splits and windows
bind-key v split-window -h -c '#{pane_current_path}'
bind-key s split-window -v -c '#{pane_current_path}'
bind-key \\ select-pane -l
# Enable switching between zoomed panes without unzooming using Ctrl+Alt+hjkl
bind -n C-M-h if-shell "[[ #{window_zoomed_flag} -eq 1 ]]" "resize-pane -Z ; select-pane -L ; resize-pane -Z" "select-pane -L"
bind -n C-M-j if-shell "[[ #{window_zoomed_flag} -eq 1 ]]" "resize-pane -Z ; select-pane -D ; resize-pane -Z" "select-pane -D"
bind -n C-M-k if-shell "[[ #{window_zoomed_flag} -eq 1 ]]" "resize-pane -Z ; select-pane -U ; resize-pane -Z" "select-pane -U"
bind -n C-M-l if-shell "[[ #{window_zoomed_flag} -eq 1 ]]" "resize-pane -Z ; select-pane -R ; resize-pane -Z" "select-pane -R"
# to reasize without using bind key
bind -n S-Up run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys 'C-W' '+' 'k') || tmux resize-pane -U 5"
bind -n S-Down run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys 'C-W' '+' 'j') || tmux resize-pane -D 5"
bind -n S-Left run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys 'C-W' '+' 'h') || tmux resize-pane -L 5"
bind -n S-Right run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys 'C-W' '+' 'l') || tmux resize-pane -R 5"
bind -n C-M-S-n swap-window -t +1 \; next-window
bind -n C-M-S-b swap-window -t -1 \; previous-window
bind -n C-M-n next-window
bind -n C-M-b previous-window
bind -n C-M-p previous-window
bind-key C-o rotate-window
bind-key + select-layout main-horizontal
bind-key = select-layout main-vertical
# set-window-option -g other-pane-height 25
# set-window-option -g other-pane-width 81
# set-window-option -g display-panes-time 1500
# set-window-option -g window-status-current-style fg=magenta
bind-key a last-pane
bind-key q display-panes
# bind-key c new-window -c '#{pane_current_path}'
# Bind 'c' to create a new window in the home directory
bind-key c new-window -c "$HOME"
bind-key n next-window
bind-key N previous-window
bind-key [ copy-mode
bind-key ] paste-buffer
# Setup 'v' to begin selection as in Vim
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"
# 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"
# Set window notifications
setw -g monitor-activity on
set -g visual-activity on
# Enable native Mac OS X copy/paste
set-option -g default-command "/bin/bash -c 'which reattach-to-user-namespace >/dev/null && exec reattach-to-user-namespace $SHELL -l || exec $SHELL -l'"
# Allow the arrow key to be used immediately after changing windows
set-option -g repeat-time 0
set -g @plugin 'tmux-plugins/'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/sensible'
# theme
run-shell "~/tmux-power/tmux-power.tmux"
# set -g @plugin 'wfxr/tmux-power'
# set -g @tmux_power_theme 'everforest'
# for restore and save
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# save every 10 min
set -g @continuum-restore 'on'
set -g @continuum-save-interval '10'
set -g @resurrect-dir '~/.tmux/resurrect'
set -g @continuum-save-script '~/.tmux/plugins/tmux-continuum/scripts/continuum_save.sh'
# set -g @plugin 'tmux-plugins/tmux-urlview'
set -g @plugin 'tmux-plugins/tmux-fpp'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-save-shell-history 'on'
run '~/.tmux/plugins/tpm/tpm'
# renumber-windows
set-option -g renumber-windows on
# Toggle
bind-key h set-option status
bind-key e set-option -g status-position