-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
102 lines (77 loc) · 3.08 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
94
95
96
97
98
99
100
101
102
# reset prefix to CTRL-A
set -g prefix C-a
bind-key a send-prefix
set-window-option -g allow-rename off
# 256 colors for vim
set -g default-terminal "screen-256color"
# Cycle panes with C-b C-b
unbind ^B
bind ^B select-pane -t :.+
# Reload config with a key
bind-key r source-file ~/.tmux.conf \; display "Config reloaded!"
# Mouse works as expected
set -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
# Scrolling works as expected
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Use the system clipboard
# set-option -g default-command "reattach-to-user-namespace -l zsh"
# Clear the pane and it's history
bind -n C-k send-keys C-l \; clear-history
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
# C-l is taken over by vim style pane navigation
bind C-l send-keys 'C-l'
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# Status bar
# colors
set -g status-bg colour240
set -g status-fg white
# alignment
set-option -g status-justify centre
# spot at left
set-option -g status-left '#[bg=colour240,fg=grey][#[fg=grey]#S#[fg=grey]]'
set-option -g status-left-length 20
# window list
setw -g automatic-rename on
set-window-option -g window-status-format '#[dim]#I:#[default]#W#[fg=grey,dim]'
set-window-option -g window-status-current-format '#[fg=grey,bold]#I#[fg=grey]:#[fg=grey]#W#[fg=dim]'
# spot at right
set -g status-right '#[fg=grey][#[fg=grey]%Y-%m-%d %H:%M#[fg=grey]]'
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
# Highlight active window
set-window-option -g window-status-current-bg blue
# hl for window navigation
unbind-key h
bind -r h previous-window
unbind-key l
bind -r l next-window
bind-key C-a last-window
# start window numbering at 1
set -g base-index 1
# set escape key delay to 0
set -sg escape-time 0
# increase scrollback lines
set -g history-limit 10000
# set vertical split to C-\
unbind '"'
bind-key \ split-window -h
# set horizontal split to C--
unbind %
bind-key - split-window -v