-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
64 lines (48 loc) · 2.37 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
# tmux configuration file
# Bind r to reload this file.
bind r source-file ~/.tmux.conf\; display "Configuration file reloaded."
# Set utf-8
setw -g utf8 on
# Set terminal emulator to display 256 colors under tmux
set-option -g default-terminal "xterm-256color"
# Set terminal emulator to receive xterm keys
set-window-option -g xterm-keys on
# Sets preferred binding for prefix and viewing windows
# (if you have used screen, this might be useful)
set-option -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
unbind '"'
bind '"' choose-window
# Binding to clear shell
bind C-l send-keys 'C-l'
# New windows on the same current directory
bind c new-window -c "#{pane_current_path}"
# Intuitive pane partitions and on the same current directory
unbind %
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# 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"
# Increases length of status-left
set -g status-left-length 32
# Load status bar conf
if-shell "test -f ~/.tmux_statusbar.conf" "source ~/.tmux_statusbar.conf"
# Enable mouse support (works in iTerm)
set-option -g -q mouse on
# make mousewheel work when not in copy mode
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
bind-key -t vi-copy WheelUpPane halfpage-up
bind-key -t vi-copy WheelDownPane halfpage-down
# Sets Aggresive Resize for grouped-sessions
set-window-option -g aggressive-resize on
# Set escape time to 0, faster command sequences.
set -s escape-time 0
# Start indexes at 1
set -g base-index 1