-
Notifications
You must be signed in to change notification settings - Fork 2
/
tmux.conf
132 lines (96 loc) · 4.39 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
120
121
122
123
124
125
126
127
128
129
130
131
132
set-option -g prefix C-a
bind-key C-a last-window
set -g base-index 1
set -s escape-time 0
#sane scrolling
#set -g terminal-overrides 'xterm*:XT:smcup@:rmcup@'
#set-option -ga terminal-overrides ",xterm-256color:Tc"
#set-option -g default-shell /bin/zsh
set -g default-terminal "tmux-256color"
set -g terminal-overrides ",xterm-256color:RGB,xterm-256color:sixel"
# following three options help with yazi image preview (sixel)
set -g allow-passthrough on
set -ga update-environment TERM
set -ga update-environment TERM_PROGRAM
set -g set-titles on
set -g set-titles-string '#{pane_current_command} (#T:#{b:pane_current_path})'
set -g allow-rename off
set-option -g automatic-rename on
#set-option -g automatic-rename-format '#{pane_current_command}:#(~/dotfiles/tmuxdirname.sh "#{pane_current_path}")' #for older tmuxes
set-option -g automatic-rename-format '#{pane_current_command}:#{b:pane_current_path}'
#switching with alt-arrow
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
bind -n -T prefix / swap-pane -U
#.. or alt + vimkeys
bind-key h select-pane -L
bind-key l select-pane -R
bind-key k select-pane -U
bind-key j select-pane -D
#switch windows with alt-pageup/down
bind -n M-Pageup previous-window
bind -n M-Pagedown next-window
set-option -g status on
set-option -g status-interval 2
#set-option -g status-utf8 on
set-option -g status-justify "centre"
set-option -g status-fg colour230
set-option -g status-bg colour235
set-option -g status-left-length 60
set-option -g status-right-length 90
set-option -g status-left "#[bg=colour235] #S #[bold]$USER@#h #[default]"
set-option -g status-right "#[default, bg=colour235] #[fg=colour139, bg=colour235] #(cat /proc/loadavg | cut -d ' ' -f 1) #[default, bg=colour235] #[fg=normal, bg=colour235] %H:%M:%S#[default]"
# Control rate limit for a pane
#set-window-option -g c0-change-interval 100
#set-window-option -g c0-change-trigger 250
set-window-option -g aggressive-resize on
setw -g window-status-format '#[fg=colour244]#I #[fg=colour250]#W#[fg=colour244]#F '
#set-window-option -g window-status-activity-style attr=bold
#set-window-option -g window-status-content-fg yellow
#set-window-option -g window-status-content-bg colour235
#set-window-option -g window-status-content-attr bold
#set-window-option -g window-status-bell-style attr=bold
#highlight current window
set-window-option -g window-status-current-format '#[fg=colour71,bold]#I #[fg=colour255,bg=colour65,bold] #W#[fg=colour50]#F '
#activity
set -g monitor-activity on
set -g monitor-silence 0
set -g visual-activity off
#pane switching using mouse
if-shell "if [[ `tmux -V | cut -d' ' -f2` -lt 2.1 ]]; then true; else false; fi" 'set -g mode-mouse on; set -g mouse-resize-pane on; set -g mouse-select-pane on; set -g mouse-select-window on'
if-shell "if [[ `tmux -V | cut -d' ' -f2` -ge 2.1 ]]; then true; else false; fi" 'set -g mouse on'
set -g pane-border-style fg=colour4
set -g pane-active-border-style fg=black
set -g pane-active-border-style bg=colour4
# Copy paste from X clipboard
# http://unix.stackexchange.com/questions/15715/getting-tmux-to-copy-a-buffer-to-the-clipboard
# Reload conf
bind-key r source ~/.tmux.conf \; display-message 'Configuration reloaded.'
bind-key J command-prompt -p "join pane from:" "join-pane -s '%%'"
# Split window
bind-key t split-window -v -p 12
bind-key T clock-mode
bind-key v copy-mode
bind-key P paste-buffer
setw -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection # Begin selection in copy mode.
bind-key -T copy-mode-vi 'C-v' send -X rectangle-toggle # Begin selection in copy mode.
bind-key -T copy-mode-vi 'y' send -X copy-selection # Yank selection in copy mode.
# Swap/move pane
bind-key W choose-tree -w "swap-window -t '%%'"
bind-key Q choose-tree -w "swap-pane -t '%%'"
bind-key M choose-tree -w "move-pane -t '%%'"
set-option -g history-limit 25000
bind-key -n C-l if-shell -F '#{alternate_on}' 'send-keys C-l' 'send-keys -R C-l; clear-history'
# List of plugins
#set -g @plugin 'tmux-plugins/tpm'
#set -g @plugin 'tmux-plugins/tmux-sensible'
#set -g @plugin 'Morantron/tmux-fingers'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
#run -b '~/.tmux/plugins/tpm/tpm'