-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
97 lines (82 loc) · 3.04 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
# enable mouse support to scroll up and down
#set -g mouse-resize-pane on
#set -g mouse-select-pane on
#set -g mouse-select-window on
#set -g mode-mouse on
#if-shell '[ $(echo "$(tmux -V | cut -d" " -f2) >= 2.1" | bc) -eq 1 ]' \
# 'set -g mouse on; set -g mouse-utf8 on;' \
# 'set -g mode-mouse on; set -g mouse-resize-pane on; set -g mouse-select-pane on; set -g mouse-select-window on'
# Enable mouse for different versions of tmux
# (If 'awk' exits with status 0, 'if-shell' evaluates to true)
# tmux < v2.1:
if-shell "tmux -V | awk '{exit !($2 < \"2.1\")}'" \
"setw -g mode-mouse on ; set -g mouse-select-pane on ; set -g mouse-resize-pane on ; set -g mouse-select-window on ;"
# tmux >= v2.1:
if-shell "tmux -V | awk '{exit !($2 >= \"2.1\")}'" \
"set -g mouse on ;"
# disable repeat time for keys to eliminate wait time
# for bash history after switching panes
set-option -g repeat-time 0
# keep tmux history in a file
set -g history-file ~/.tmux_history
# index naturally
set -g base-index 1
setw -g pane-base-index 1
# more history please
set -g history-limit 100000
# evenly split windows
bind e select-layout even-vertical
bind E select-layout even-horizontal
# resize panes easily
# bind -r S-Up resize-pane -U 5
# bind -r S-Down resize-pane -D 5
# bind -r S-Left resize-pane -L 5
# bind -r S-Right resize-pane -R 5
# patches for truecolor and vim
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# ditch ctrl-b for grave (`) as the prefix key
unbind C-b
set -g prefix `
bind ` send-prefix
# splitting (new panes take current PWD)
bind '\' split-window -h -c '#{pane_current_path}'
#bind \ split-window -h -c $PWD
bind - split-window -v -c '#{pane_current_path}'
#bind - split-window -v -c $PWD
bind c new-window -c '#{pane_current_path}'
#bind c new-window -c $PWD
unbind '"'
unbind |
set -g status on
set -g status-bg colour0
set -g status-fg colour8
set -g status-right '#H %b %d %l:%M'
set -g status-left-length 18
set -g status-left '[#[fg=white]#S#[fg=colour8]] '
#set -g message-style fg=colour1
# nice purple highlight for the active window
setw -g window-status-current-style fg=white,bold,bg=colour89
# pane border styling
setw -g pane-border-style fg=green,bg=black
setw -g pane-active-border-style fg=white,bg=colour89,dim
# dim inactive panes
#setw -g window-style fg=colour240,bg=colour235
#setw -g window-active-style fg=white,bg=black
# identify activity in other windows
setw -g monitor-activity on
set -g visual-activity on
# bind Escape to copy-mode, v to visual and y/p to vim-like yank/put
bind Escape copy-mode
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-selection
unbind p
bind p paste-buffer
# other ideas we had
#set -g status-right '#H:#(~/dotfiles/.tmux_path.sh #{pane_current_path}) %l:%M'
#set -g status-right "#75T"
#set -g status-right-length 70
#set -g status-right ""#22T""
#set -g message-style bg=colour0
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf \; display "Reloaded config"