-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
57 lines (47 loc) · 1.63 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
# tmux
# Ctrl-b is the default prefix key for tmux
# Ctrl-a, Ctrl-Space, Ctrl-\
unbind-key C-b
set -g prefix C-Space
bind r source-file ~/.tmux.conf \; display-message "Configuration reloaded."
setw -g mode-keys vi
# we are indeed using a 256 capable terminal
# needed so that VIM knows to render prettier colors :)
set -g default-terminal "screen-256color"
# mouse mode on
# NB: Terminal.app needs some help with mouse events :(
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
# Vim movements for switching between panes
unbind-key Up
unbind-key Down
unbind-key Left
unbind-key Right
bind-key -r k select-pane -U
bind-key -r j select-pane -D
bind-key -r h select-pane -L
bind-key -r l select-pane -R
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
# NB: Enter to copy
# NB: <prefix> ] to paste
# Status bar
set -g status-bg black
set -g status-fg white
set -g status-interval 10
set -g status-left-length 50
set -g status-left '#[fg=green][#I:#P #W] #(whoami)@#(hostname -s) '
set -g status-right ""
# Message bar
set -g message-attr bright
set -g message-bg black
set -g message-fg colour3
# Smart pane switching with awareness of vim splits
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"