forked from W4ngatang/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
81 lines (65 loc) · 2.7 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
set -g history-limit 30000
# tmux >= 2.1
# Change prefix key to backtick (`)
unbind C-b
set-option -g prefix C-a
bind C-a send-prefix
# turn the mouse on
set-option -g -q mouse on
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# resize pane 20 units right and left
bind H resize-pane -L 20
bind L resize-pane -R 20
# more colors
set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",screen-256color:Tc"
#set -g default-terminal "xterm-256color"
#set-option -ga terminal-overrides ",xterm-256color:Tc"
# status bar appearance
set -g status-bg black
set -g status-fg white
set-option -g status-justify centre
set-option -g status-left '#[bg=black,fg=green][#[fg=cyan]#S#[fg=green]]'
set-option -g status-left-length 20
set-window-option -g window-status-format '#[dim]#I:#[default]#W#[fg=grey,dim]'
set-window-option -g window-status-current-format '#[fg=cyan,bold]#I#[fg=blue]:#[fg=cyan]#W#[fg=dim]'
set -g status-right '#[fg=green][#[fg=cyan]%Y-%m-%d#[fg=green]]'
# set inactive/active window styles
# set -g window-style 'bg=colour236'
# set -g window-active-style 'bg=black'
# alert on activity
set -g visual-activity on
setw -g monitor-activity on
# vi copying
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'y' send-keys -X copy-selection
bind p paste-buffer # the default for this is `]`
# don't automatically rename windows based on activity
set-option -g allow-rename off
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind-key -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R
# bind-key -T copy-mode-vi C-\ select-pane -l
# Neovim likes this...
set-option -sg escape-time 10
# be sure to see note* below
set -g window-status-format '#I:#(pwd="#{pane_current_path}"; echo ${pwd####*/})#F'
set -g window-status-current-format '#I:#(pwd="#{pane_current_path}"; echo ${pwd####*/})#F'
# status bar updates every 15s by default**, change to 1s here
# (this step is optional - a lower latency might have negative battery/cpu usage impacts)
set -g status-interval 3