-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
110 lines (90 loc) · 3.59 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
# Tmux settings, with vim-like options from:
# https://github.com/tony/tmux-config/blob/public/.tmux.conf
# and Tmux customization with plugins from:
# https://github.com/tmux-plugins/
# prefix
unbind C-b
set -g prefix C-o
# Allows for faster key repetition
set -s escape-time 0
# Scroll back
set-option -g history-limit 5000
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
bind-key enter command-prompt -p "Name of new window: " "new-window -n '%%'"
bind-key c-y run-shell "tmux send-keys `pass show pushgithub.com | head -1`"
# Avoid swapping panes or layouts on accident
unbind c-o
unbind space
# break-pane
unbind !
# reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# auto window rename
set-window-option -g automatic-rename
set-option -g allow-rename off
# Name xterm window
set-option -g set-titles on
set-option -g set-titles-string 'tmux [#W] #H'
# color
set -g default-terminal "screen-256color"
# -- multi-version handling of options
# https://github.com/tmux/tmux/issues/754#issuecomment-303156000
# based on https://stackoverflow.com/a/40902312/1046584
run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6-)"
# In version 2.1 "mouse" replaced the previous 4 mouse options
if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.1" | bc)" = 1 ]' \
"set -g mouse off"
# UTF8 is autodetected in 2.2 onwards, but errors if explicitly set
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.2" | bc)" = 1 ]' \
"set -g utf8 on; set -g status-utf8 on; set -g mouse-utf8 off"
# vi based movement
set-window-option -g mode-keys vi
# copy/paste
#set -g set-clipboard external
# if-shell -b '[ "$(echo "$TMUX_VERSION >= 1.4" | bc)" = 1 ]' \
# 'bind-key -T copy-mode-vi 'v' send-keys -X begin-selection; \
# bind-key -T copy-mode-vi 'y' send-keys -X copy-selection'
# if-shell -b '[ "$(echo "$TMUX_VERSION < 2.4" | bc)" = 1 ]' \
# 'bind-key -t vi-copy 'v' begin-selection; \
# bind-key -t vi-copy 'y' copy-selection'
# tmux plugins
# prefix-I -- install plugins
# prefix-U -- update 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'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-urlview'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'Morantron/tmux-fingers'
set -g @resurrect-capture-pane-contents 'on'
set -g @fingers-compact-hints 0
run-shell '~/.tmux/plugins/tpm/tpm'
# Old settings
# # Adjust window position in a session
# bind-key -n C-S-Left swap-window -t -1
# bind-key -n C-S-Right swap-window -t +1
#
# # hjkl pane traversal
# bind h select-pane -L
# bind j select-pane -D
# bind k select-pane -U
# bind l select-pane -R
#
# # set window split
# bind-key v split-window -h
# bind-key b split-window
#
# # Updates for tmux 1.9's current pane splitting paths.
# if-shell "[[ `tmux -V` == *1.9* ]]" 'unbind c; bind c new-window -c "#{pane_current_path}"'
# if-shell "[[ `tmux -V` == *1.9* ]]" 'unbind s; bind s split-window -v -c "#{pane_current_path}"'
# if-shell "[[ `tmux -V` == *1.9* ]]" "unbind '\"'; bind '\"' split-window -v -c '#{pane_current_path}'"
# if-shell "[[ `tmux -V` == *1.9* ]]" 'unbind v; bind v split-window -h -c "#{pane_current_path}"'
# if-shell "[[ `tmux -V` == *1.9* ]]" 'unbind %; bind % split-window -h -c "#{pane_current_path}"'
#