-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
115 lines (94 loc) · 3.2 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
###
### Status Bar
###
# Left Element
set -g status-left "#[fg=white,bg=brightgreen]#{?client_prefix,#[bg=blue],} #S #{?window_zoomed_flag,🔍,❐ } #[fg=brightgreen,bg=black]#{?client_prefix,#[fg=blue],}"
set -g status-left-length 50
# Right Element
set -g status-right "#[fg=brightgreen,bg=black]#[fg=white,bg=brightgreen] %F %R "
# Centre (window) Elements
set -g status on
set -g status-style bg=black
set -g status-justify absolute-centre
set -g window-status-separator " "
set -g window-status-format "#[fg=white,bg=black] #I:#W "
set -g window-status-current-format "#[fg=brightgreen,bg=black]#[fg=white,bg=brightgreen] #I:#W #[fg=brightgreen,bg=black]"
set -g message-style fg=brightred,bg=black
###
### Other Visual Changes
###
# Messages from Tmux
set -g message-style fg=yellow,bg=black
# increase scrollback buffer size
set -g history-limit 50000
# tmux messages are displayed for 2 seconds
set -g display-time 1000
# refresh 'status-left' and 'status-right' more often
set -g status-interval 1
# focus events enabled for terminals that support them
set -g focus-events on
# don't rename windows automatically
set -g allow-rename off
# set base index for windows and panes
set -g base-index 1
setw -g pane-base-index 1
# terminal titles will match the tmux session/window/pane
set -g set-titles on
set -g set-titles-string '#W'
# highlight windows with activity
setw -g monitor-activity on
set -g visual-activity on
# TERM
# Default to below first
set -g default-terminal "screen-256color"
# If host complains that profile doesn't exist, try "screen-256" or "screen-color" (but you lose italics)
# To fix some neovim error force Tmux to use color regardless of what the terminal reports
#set-option -sa terminal-overrides ',XXX:RGB'
# Finally try with `-2` to force Tmux to use colour regardless
###
### Functional changes
###
# address vim mode switching delay
# http://superuser.com/a/252717/65504
# https://github.com/tmux/tmux/wiki/FAQ#what-is-the-escape-time-option-is-zero-a-good-value
set -s escape-time 0
# turn on mouse mode
set -g mouse on
setw -g mode-keys vi
set -g repeat-time 500
###
### Key bindings
###
# change the prefix combo
set -g prefix C-a
unbind C-b
# allow C-a to go through to other apps by pressing twice
bind C-a send-prefix
# edit tmux config and reload
unbind e
bind e new-window -n '~/.config/tmux/tmux.conf' "sh -c 'nvim ~/.config/tmux/tmux.conf && tmux source ~/.config/tmux/tmux.conf'"
# reload config
unbind r
bind r source-file ~/.config/tmux/tmux.conf \; display "tmux.conf reloaded"
# Session operations
unbind C
bind C new-session
# Send same command to all Panes
bind s setw synchronize-panes
# memorable pane operations that open in current path
bind c new-window -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# vim style bindings to move between panes
bind -r h select-pane -L
bind -r j select-pane -D
bind -r k select-pane -U
bind -r l select-pane -R
# vim style bindings to move between windows
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# vim style bindings to resize panes
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5