-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmux.conf
59 lines (48 loc) · 2.47 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
# vi: set ft=sh :
# Use Ctrl-a instead of Ctrl-B
set-option -g prefix C-a
unbind-key C-b
# Use Ctrl-a a for nested sessions
bind-key a send-prefix
#Color and terminal settings
set -g base-index 1
set-window-option -g pane-base-index 1
set-option -g status-bg blue
set-option -g status-fg white
set-window-option -g window-status-current-bg black
setw -g mode-mouse on
set -g mouse-select-window on
set -g mouse-select-pane on
set -g visual-activity on
# Use x11 copy/paste integration
# On OS X, use xquartz with "Update pasteboard immediately when new text is selected option"
bind C-c choose-buffer "run \"tmux save-buffer -b %% - | xclip -i -sel primary >/dev/null\" \; run \" tmux display \\\"Clipboard \(+\) filled with: $(tmux save-buffer -b %1 - | dd ibs=1 obs=1 status=noxfer count=80 2> /dev/null)... \\\" \" "
bind C-v run "tmux set-buffer \"$(xclip -o -sel primary)\"; tmux paste-buffer" \; run "tmux display \"Copied from \(+\) $(xclip -o -sel primary | dd ibs=1 obs=1 status=noxfer count=80 2> /dev/null)... \""
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# increase scrollback lines
set -g history-limit 10000
# Set status bar to show system information
set -g status-right '#[fg=white]#(uptime | cut -d "," -f 3-)'
#Keybindings
setw -g mode-keys vi
#Vim style split navigation
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
#Set window split mapping
unbind %
bind | split-window -h
bind - split-window -v
if "[[ `tmux -V` == *1.9* ]] || [[ `tmux -V` == *2.0* ]]" 'unbind |; bind | split-window -h -c "#{pane_current_path}"'
if "[[ `tmux -V` == *1.9* ]] || [[ `tmux -V` == *2.0* ]]" 'unbind -; bind - split-window -v -c "#{pane_current_path}"'
#Move windows with P and N
bind P swap-window -t -1
bind N swap-window -t +1
# 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"