-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathtmux.conf
66 lines (54 loc) · 2.74 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
# Set sensible TERM
set-option -g default-terminal "tmux-256color"
# Enable 24-bit color support
set-option -as terminal-features ",*-256color:RGB"
# I need this way bigger than default 2000
set-option -g history-limit 10000
# Start indexing at 1 to match keyboard order with tmux order
set-option -g base-index 1
set-option -g pane-base-index 1
# Renumber windows sequentially after closing any of them
set-option -g renumber-windows on
# Enable windows titles rename
set-option -g set-titles on
set-option -g set-titles-string "#T"
set-option -g allow-rename on
set-option -g automatic-rename off
# Better support for modern options and iTerm2 integrated mode
set-option -g extended-keys on
set-option -g focus-events on
set-option -g allow-passthrough on
set-option -g mouse on
# Fancy status bar
set-option -g @colors-solarized dark
run-shell "$DOTFILES/tmux/plugins/colors-solarized/tmuxcolors.tmux"
set-option -g status-justify centre
set-option -g status-position top
set-option -g status-left "#{pane_index}:#{pane_current_command}"
set-option -g status-left-length 20
set-option -g status-right "#{prefix_highlight} #(uptime | rev | cut -f1-5 -d ' ' | rev)"
set-option -g status-right-length 50
# Indicate active prefix/copy mode
set-option -g @prefix_highlight_show_copy_mode on
set-option -g @prefix_highlight_copy_mode_attr fg=black,bg=yellow
set-option -g @prefix_highlight_show_sync_mode on
set-option -g @prefix_highlight_sync_mode_attr fg=black,bg=green
run-shell "$DOTFILES/tmux/plugins/prefix-highlight/prefix_highlight.tmux"
# Bind some 'global' keys
bind-key -n M-t new-window
bind-key -n M-Left previous-window
bind-key -n M-Right next-window
bind-key -n M-\\ split-window -h -c "#{pane_current_path}"
bind-key -n M-\- split-window -v -c "#{pane_current_path}"
bind-key -n M-c copy-mode
bind-key -n M-f copy-mode \; send-key \/
bind-key -T copy-mode-vi Escape send-keys -X cancel
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?\.?(view|n?vim?x?)(-wrapped)?(diff)?$'"
bind-key -n S-Left if-shell "$is_vim" "send-keys S-Left" { if-shell -F "#{pane_at_left}" "" "select-pane -L" }
bind-key -n S-Down if-shell "$is_vim" "send-keys S-Down" { if-shell -F "#{pane_at_bottom}" "" "select-pane -D" }
bind-key -n S-Up if-shell "$is_vim" "send-keys S-Up" { if-shell -F "#{pane_at_top}" "" "select-pane -U" }
bind-key -n S-Right if-shell "$is_vim" "send-keys S-Right" { if-shell -F "#{pane_at_right}" "" "select-pane -R" }
bind-key -T copy-mode-vi S-Left if-shell -F "#{pane_at_left}" "" "select-pane -L"
bind-key -T copy-mode-vi S-Down if-shell -F "#{pane_at_bottom}" "" "select-pane -D"
bind-key -T copy-mode-vi S-Up if-shell -F "#{pane_at_top}" "" "select-pane -U"
bind-key -T copy-mode-vi S-Right if-shell -F "#{pane_at_right}" "" "select-pane -R"