-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.tmux.conf
128 lines (97 loc) · 4.11 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
115
116
117
118
119
120
121
122
123
124
125
126
127
# enable xterm keys
set-option -gw xterm-keys on
# enable setting clipboard via OSC 52
set -g set-clipboard on
# use 256 colors
set -g default-terminal "screen-256color"
# enable mouse support
set -g mouse on
# set Ctrl-a as the default prefix key combination
# and unbind C-b to free it up
set -g prefix C-a
unbind C-b
#use send-prefix to pass C-a through to application
bind C-a send-prefix
# shorten command delay
set -sg escape-time 1
set -g set-titles on
set -g set-titles-string '#H > #{session_name} > #T'
bind r source-file ~/.tmux.conf \; display "[reloaded]"
# use PREFIX | to split window horizontally and PREFIX - to split vertically
bind | split-window -hc '#{pane_current_path}'
bind - split-window -vc '#{pane_current_path}'
bind c new-window -c '#{pane_current_path}'
# Make the current window the first window
bind T swap-window -t 1
# map Vi movement keys as pane movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# cycle thru windows
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# resize panes using PREFIX H, J, K, L
bind H resize-pane -L 5
bind J resize-pane -D 5
bind K resize-pane -U 5
bind L resize-pane -R 5
# C-i for even-vertical arrangement and C-o to zoom current pane
bind-key C-i select-layout even-vertical
bind-key C-v select-layout even-horizontal
bind-key C-o resize-pane -y 1000
# Sync panes
bind C-s set-window-option synchronize-panes
# ----------------------
# set some pretty colors
# ----------------------
# set pane colors - hilight the active pane
set-option -g pane-border-style fg=brightblack
set-option -g pane-active-border-style fg=cyan
# colorize messages in the command line
set-option -g message-style bg=black,fg=cyan
# ----------------------
# Status Bar
# -----------------------
set-option -g status on # turn the status bar on
set -g status-interval 5 # set update frequencey (default 15 seconds)
set -g status-justify centre # centre window list
# set-option -g status-position top # position the status bar at top of screen
# set color for status bar
set-option -g status-style bg=black,fg=cyan
# set window list color
set-window-option -g window-status-style fg=white,bg=black
set-window-option -g window-status-current-style fg=cyan,bg=black,bright
# set window list format
set-window-option -g window-status-format " #W#{window_flags} "
set-window-option -g window-status-current-format " #W#{window_flags} "
set-window-option -g window-status-separator "#[fg=brightblack,bg=black]"
# visual notification of activity in other windows
set-window-option -g monitor-activity on
set-window-option -g window-status-activity-style bright,underscore
# align window list to left
set -g status-justify left
# show session name and pane title on left side of status bar
set -g status-left-length 40
set -g status-left "#{?client_prefix,#[fg=black]#[bg=cyan],#[fg=cyan]#[bg=black]} #h #{?client_prefix,#[fg=cyan],#[fg=black]}#[bg=brightblack]#[fg=white] #{session_name} #[fg=brightblack,bg=black]"
# show date and time on right side of status bar
set -g status-right-length 100
set -g status-right "#[fg=cyan,bg=black] #{pane_title} #[fg=brightblack]#[fg=white,bg=brightblack] %H:%M:%S "
# unbind Tab
unbind Tab
# 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
# macOS specific config
if-shell "uname | grep -q 'Darwin'" "source-file ~/.tmux.darwin.conf"