-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmux.conf
65 lines (55 loc) · 1.93 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
# hint:
# "set synchronize-panes" to execute a command in all visible panes
bind-key C-b last-window
bind-key C-v last-pane
bind-key R respawn-window
# splits open in same working directory
bind '"' split-window -c "#{pane_current_path}"
bind '%' split-window -h -c "#{pane_current_path}"
# set global r-o-e so that initial window of initial session gets it
## legacy: set -g set-remain-on-exit on
set -g remain-on-exit on
# Set status bar
set -g status-bg white
set -g status-fg black
set -g status-left "#[bg=black,fg=white,bold]#h #[default]"
set -g status-right "#[fg=magenta]#(~/.tmux-status.sh)#[default]"
# tmux 2.3+ pwd as window title https://stackoverflow.com/questions/28376611/how-to-automatically-rename-tmux-windows-to-the-current-directory
set-option -g status-interval 5
set-option -g automatic-rename on
set-option -g automatic-rename-format '#{b:pane_current_path}'
# Highlight active window
# version <2.9: set-window-option -g window-status-current-bg magenta
set-window-option -g window-status-current-style bg=magenta
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# vim key bindings to switch panes
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
unbind p
bind p paste-buffer
## legacy: bind -t vi-copy v begin-selection
## legacy: bind -t vi-copy y copy-selection
bind-key -T copy-mode-vi 'y' send-keys -X copy-selection
# change panes with Ctrl+Arrow keys
bind -n C-Left select-pane -L
bind -n C-Right select-pane -R
bind -n C-Up select-pane -U
bind -n C-Down select-pane -D
# close pane on shell exit
set -g remain-on-exit off
# version <2.4: set -g set-remain-on-exit off
# make mouse usable
#setw -g mode-mouse on
#setw -g mouse-select-window on
#setw -g mouse-select-pane on
# send prefix to embedded tmux session
bind C-a send-prefix
# notify on window activity
setw -g monitor-activity on
# key codes like xterm
set-option -g xterm-keys on