-
Notifications
You must be signed in to change notification settings - Fork 16
/
.tmux-1.8.conf
73 lines (56 loc) · 1.92 KB
/
.tmux-1.8.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
# Set that stupid Esc-Wait off, so VI works again
set -sg escape-time 0
# All commands start with C-a
set -g prefix C-a
# Use 256 colors
set -g default-terminal "screen-256color"
# Use mouse
setw -g mode-mouse on
set -g mouse-select-window on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-utf on
# Start numbering at 1
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
set -g allow-rename off
set -g history-limit 5000
# Bindings
unbind %
bind | split-window -h
bind _ split-window -v
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
bind -t vi-copy 'V' rectangle-toggle
# move x clipboard into tmux paste buffer
bind C-p run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer"
# move tmux copy buffer into x clipboard
bind C-y run "tmux save-buffer - | xclip -i"
bind C-a send-prefix
bind a last-window
# Smart pane switching with awareness of vim splits
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)(g?(view|n?vim?)(diff)?|git)$"'
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"
bind C-l send-keys 'C-l'
bind -n M-h previous-window
bind -n M-l next-window
bind -n M-Left previous-window
bind -n M-Right next-window
# Reload the config.
bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"
# Set panel title
bind t command-prompt -p "Panel title:" "send-keys 'printf \"'\\033]2;%%\\033\\\\'\"' C-m"
# Do not load them if remote, since it's probably a nested tmux and I want an
# easy way to differentiate the two
if-shell 'test -z "$SSH_CLIENT"' \
"source-file ~/.tmux-theme.conf"
set -g display-panes-time 1500