-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
61 lines (49 loc) · 2.1 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
# prefix
unbind C-b
set -g prefix 'C-\'
# make sure colors look right
set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",*-256color*:Tc"
# Enable RGB colour if running in xterm(1)
set-option -sa terminal-overrides ",xterm*:Tc"
# navigation via vim shortcuts
setw -g mode-keys vi
# let mouse scrolling move up history
#set -g mouse on
#bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
#bind -n WheelDownPane select-pane -t= \; send-keys -M
# let highlight copying work
set -g mouse off
# 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"
# make escape key in vim react immediately
set -s escape-time 0
# window notifications
setw -g monitor-activity on
set -g visual-activity on
set -g display-time 4000
# handle fiddling with windows
set -g renumber-windows on
set -g allow-rename off
bind h swap-window -t -1
bind l swap-window -t +1
set -g base-index 1
set -g pane-base-index 1
bind _ split-window -v -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
bind-key C command-prompt -p "window name:" "new-window -n '%%' -c\"#{pane_current_path}\""
# resize panes
bind J resize-pane -D 5
bind K resize-pane -U 5
# resizing the pane right causes the divider to move left
bind L resize-pane -R 10
# resizing the pane left causes the divider to move right
bind H resize-pane -L 10
# toggle zoom of pane
bind Z resize-pane -Z
# re-source tmux.conf
bind ` source-file ~/.tmux.conf \; display 'sourced ~/.tmux.conf'