-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
48 lines (37 loc) · 2.06 KB
/
Copy pathtmux.conf
File metadata and controls
48 lines (37 loc) · 2.06 KB
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
# Smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys 'C-\\') || tmux select-pane -l"
# Set the status bar
set -g status-bg black
set -g status-fg white
set -g status-left '#[fg=green]#H'
set -g status-left ' #[fg=green,bold]#H#[default]'
set -g status-right '#[fg=yellow,bold]#(cut -d " " -f 1-4 /proc/loadavg)#[default] #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default] '
# Make sure tmux knows we ball hard
set -g default-terminal "screen-256color"
# Highlight the active window
set-window-option -g window-status-current-bg yellow
setw -g window-status-current-fg black
# Set mode-keys to vi
set-window-option -g mode-keys vi
setw -g mode-keys vi
# Lemme switch panes with a mouse, if ever this dire need arises
set -g mouse-select-pane on
# Resurect my old habit of using C-a for prefixing commands, from using screen
set-option -g prefix C-a
bind-key a send-prefix
# Base for numbering is 1, not 0
set -g base-index 1
# If it's a MacOS, then run this:
if-shell 'test "$(uname -s)" = "Darwin"' \
'source ~/.tmux.darwin.conf'
# If it's a Linux, then run this:
if-shell 'test "$(uname -s)" = "Linux"' \
'source ~/.tmux.linux.conf'
# Pass mod keys through to xterm
setw -g xterm-keys on
# Bind a reload key for easier reloading of this config
bind-key R source-file ~/.tmux.conf \; display-message "source-file done; Reloaded ~/.tmux.conf"