-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
93 lines (76 loc) · 3.62 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
# Vi mode
set-window-option -g mode-keys vi
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-selection
# Set the time in milliseconds for which tmux waits after an escape is input
# to determine if it is part of a function or meta key sequences.
set-option -sg escape-time 10
# Enable focus-events
set-option -g focus-events on
# Make it use C-a, similar to screen
unbind C-b
set -g prefix C-a
bind -r C-a send-prefix
# Enable mouse usage
set -g mouse on
# Some nice screen bindings
# bind-key C-a last-window
bind-key Space next-window
bind-key C-Space previous-window
# Smart pane switching with awareness of vim splits
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n C-\\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind-key -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R
bind-key -T copy-mode-vi C-\\ select-pane -l
# Restore clear screen keybind mapped over by tmux-navigator
bind C-l send-keys 'C-l'
# toggle activity/silence monitoring
bind m setw monitor-activity \; display-message "monitor activity: #{monitor-activity}"
bind M command-prompt -p "monitor-silence (seconds)" "setw monitor-silence %% \; display-message 'montior silence: #{monitor-silence} seconds'"
# Reload key
bind r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# Some sane defaults
set -g history-limit 100000
set -g base-index 1
set-option -ga terminal-overrides ",tmux-256color:Tc"
set -g default-terminal tmux-256color
set -g lock-command vlock
set-window-option -g xterm-keys on
set -g set-titles on
set -g set-titles-string '[#S:#I #H] #W'
set -g renumber-windows on
# THEME
set -g status-left-length 50
set -g status-left '#[fg=green]#{?session_name,,(#{session_name})} #(whoami)@#{host_short}#[default] '
set -g status-right "#[fg=yellow]#(uptime | awk '{print $(NF-2)\" \"$(NF-1)\" \"$(NF-0)}' | sed s/,//g)#[default] #[fg=blue]%H:%M#[default]"
# Status bar has a dim gray background
set-option -g status-style 'bg=colour234,fg=colour0'
# Left shows the session name, in blue
set-option -g status-left-style 'bg=default,fg=colour74'
# Right is some CPU stats, so terminal green
set-option -g status-right-style 'bg=default,fg=colour71'
# Windows are medium gray; current window is white
set-window-option -g window-status-style 'fg=colour244'
set-window-option -g window-status-current-style 'fg=#ffffff,bg=#000000'
# Beeped windows get a blinding orange background
set-window-option -g window-status-bell-style 'fg=#000000,bg=#d78700,none'
# Trim window titles to a reasonable length
set-window-option -g window-status-format '#[fg=yellow]#{window_flags}#{window_index}#[fg=colour244] #{=32:window_name} '
set-window-option -g window-status-current-format '#[fg=yellow] #{window_flags}#{window_index}#[fg=colour254] #{=32:window_name} '
# Commands for new splits, fixed so they make sense
bind | split-window -h -c '#{pane_current_path}'
bind \\ split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
bind _ split-window -v -c '#{pane_current_path}'
# Break out the current pane to a window
bind b break-pane -d
# Bypass the default shell on systems where it cannot be changed
# set -g default-shell /usr/local/bin/zsh