-
Notifications
You must be signed in to change notification settings - Fork 3
/
tmux.conf
57 lines (44 loc) · 1.82 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
set -g prefix C-@
# switch to copy mode with mouse wheel
setw -g mode-keys vi
set -g mouse on
bind a choose-session
bind s copy-mode
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'V' send -X rectangle-toggle
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe "xclip -selection clipboard -i"
bind-key -Tcopy-mode enter send -X copy-pipe "xclip -selection clipboard -i"
#bind-key -tvi-copy enter copy-pipe "xclip -selection clipboard -i"
bind b paste-buffer
bind y run "tmux show-buffer | xclip -selection clipboard -i"
# Pane movement with vim-like movements
bind j select-pane -D
bind k select-pane -U
bind h select-pane -L
bind l select-pane -R
# pane splitting
bind | split-window -h
bind - split-window -v
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# First window should be 1 (easier access on number row)
set -g base-index 1
set -g pane-base-index 1
set -sg escape-time 1
set-option -g history-limit 10000
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Status bar and general style
set -g status-position top
set -g status-bg default # same as terminal bg
set -g status-fg white
set -g status-left-length 30
set -g status-left '#[fg=colour248]#I:#P #[fg=colour45]#H'
set -g status-justify centre
set -g status-right-length 70
set -g status-right '#[fg=yellow]CPU: #[default]#(cut -d " " -f 1 /proc/loadavg) #[fg=yellow]Mem: #[default]#(~/.tmux/memstats.sh)'
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n 'C-\' if-shell "$is_vim" "send-keys 'C-\\'" "select-pane -l"