-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
95 lines (80 loc) · 2.75 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
set -g default-terminal "screen-256color"
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded config!"
# Save current vim buffer and return to previous pane
bind ^W send ^[ ":w! | bd" C-m \; last-pane \; send C-m
# Discard current buffer and return to previous pane
bind ^Q send ^[ ":bd!" C-m \; last-pane \; send C-m
# vi mode
set -g status-keys vi
unbind [
bind ^A copy-mode
unbind p
bind p paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
bind -t vi-copy 'Space' page-down
# basic global settings:
set -s escape-time 1
set -g base-index 1
set -g pane-base-index 1
set -g status-justify centre
setw -g mode-keys vi
setw -g utf8 on
setw -g history-limit 10000
# kill the rat
setw -g mode-mouse off
setw -g mouse-select-pane off
# current window navigation:
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# moving and swapping:
bind N swap-pane -D
bind P swap-pane -U
# resizing:
bind -r C-h resize-pane -L
bind -r C-j resize-pane -D
bind -r C-k resize-pane -U
bind -r C-l resize-pane -R
# window title:
set -g set-titles on
set -g set-titles-string '[#S:#I.#P] #W'
setw -g automatic-rename on
# messages:
setw -g mode-bg colour009
setw -g mode-fg black
set -g message-bg colour009
set -g message-fg black
# panes:
set -g pane-border-fg colour237
set -g pane-border-bg default
set -g pane-active-border-fg colour074
set -g pane-active-border-bg default
# status bar:
set -g status-utf8 on
set -g status-bg colour237
set -g status-fg colour009
set -g status-interval 5
set -g status-left-length 60
set -g status-left '#[fg=colour074,bold]> #h#[default]'
set -g status-right '#[fg=colour074,bold]#S:#W.#P #[fg=white]|#[fg=colour221,bold]%R#[fg=white]| #[default]'
set -g visual-activity off
setw -g monitor-activity off
setw -g window-status-current-fg black
setw -g window-status-current-bg colour009
setw -g window-status-fg colour074
setw -g window-status-bg colour237
# Smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys Escape C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys Escape C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys Escape C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys Escape C-l) || tmux select-pane -R"
# Remap VIM's clear screen
bind -r C-l send-keys ':redraw!' C-m