-
Notifications
You must be signed in to change notification settings - Fork 22
/
tmux.conf
58 lines (46 loc) · 1.92 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
# ^F is easier to press
unbind C-b
set -g prefix C-f
bind C-f send-prefix
# use good colors
set -g default-terminal screen-256color-italic
# Tmux has been breaking backwards compability a lot lately.
if-shell "[[ `tmux -V | awk '{if ($2 < 2.1) print 1; else print 0}'` -eq 1 ]]" 'source $XDG_CONFIG_HOME/tmux/tmux-1.x.conf'
if-shell "tmux -V | grep -q 2.1" 'source $XDG_CONFIG_HOME/tmux/tmux-2.1.conf'
if-shell "tmux -V | grep -q 2.2" 'source $XDG_CONFIG_HOME/tmux/tmux-2.2.conf'
if-shell "tmux -V | grep -q 2.3" 'source $XDG_CONFIG_HOME/tmux/tmux-2.3.conf'
# act like vim
setw -g mode-keys vi
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
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"
# restore overwritten C-l binding (clear screen)
bind C-l send-keys 'C-l'
# ease of use (prefer visual splits)
unbind %
unbind '"'
bind % split-window
bind '"' split-window -h
# 12 hour clock
set-window-option -g clock-mode-style 12
# Start numbering at 1 (easier to switch between a few screens)
set -g base-index 1
setw -g pane-base-index 1
# toggle status line
bind T set-option -g status
# distribute panes
unbind =
bind = select-layout even-horizontal
# put statusline on top
set-option -g status-position top
# tmuxline integration
tmuxline_theme="solarized-$SOLARIZED"
if-shell "test -f $XDG_CONFIG_HOME/tmux/$tmuxline_theme.tmuxline" "source $XDG_CONFIG_HOME/tmux/$tmuxline_theme.tmuxline"
# lower ESC timeout so that ESC is not interpreted as a modifier
set -g escape-time 20