-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.tmux.conf
155 lines (120 loc) · 5.99 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# -- general -------------------------------------------------------------------
set -g default-terminal "screen-256color" # colors!
set -as terminal-features ",xterm-256color:RGB"
set-option -sa terminal-overrides ',xterm-256color:RGB'
set -s escape-time 0 # fastest command sequences
set -sg repeat-time 600 # increase repeat timeout
set-option -g prefix C-a
bind-key C-a last-window
# Rather than constraining window size to the maximum size of any client
# # connected to the *session*, constrain window size to the maximum size of any
# # client connected to *that window*. Much more reasonable.
set-window-option -g aggressive-resize on
# Open new window in the current working directory
bind-key '"' split-window -v -c "#{pane_current_path}"
bind-key '%' split-window -h -c "#{pane_current_path}"
bind-key 'c' new-window -c "#{pane_current_path}"
# Allows us to use C-a a <command> to send commands to a TMUX session inside
# another TMUX session
bind-key a send-prefix
# uncomment to force vi-style key bindings
# emacs is the default unless $EDITOR or $VISUAL contain 'vi'
set -g status-keys vi
set -g history-limit 50000 # boost history limit
# edit configuration
bind-key e new-window -n '~/.tmux.conf' '${EDITOR:-vim} ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display "~/.tmux.conf sourced"'
# reload configuration
bind-key r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
# -- display -------------------------------------------------------------------
set -g base-index 1 # start windows numbering at 1
set-window-option -g pane-base-index 1 # make pane numbering consistent with windows
set-window-option -g automatic-rename on # rename window to reflect current program
set-window-option -g clock-mode-style 24 # 24 hour clock
# highlight the current window in the status bar (blue background) #I - window index #W - window title #F - window flag
set-window-option -g window-status-current-format '#I:#[fg=white]#W#[fg=dim]#F'
#set-window-option -g monitor-activity on
set -g monitor-activity on
# default window title colors
set-window-option -g window-status-style fg=white,bg=default,dim
# active window title colors
set-window-option -g window-status-current-style fg=white,bg=default,bright
set-window-option -g mode-keys vi
set-window-option -g xterm-keys on
# renumber windows when a window is closed
set -g renumber-windows on
# Enable focus events for tmux
set-option -g focus-events on
# Force tmux to use ascii drawing characters vs x and p
#set-option -ga terminal-overrides ',*:enacs@:smacs@:rmacs@:acsc@'
# -- navigation ----------------------------------------------------------------
# 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)?$'"
# Pane navigation. No prefix key (-n) and Allow repeat (-r).
# bind-key -r -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" # move left
# bind-key -r -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" # move down
# bind-key -r -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" # move up
# bind-key -r -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R" # move right
bind-key -r i run-shell "tmux neww tmux-cht.sh"
bind-key -r f run-shell "tmux neww tmux-sessionizer"
bind-key -r s run-shell "tmux neww tmux-sessionizer -a"
# Override pane vim check C-a C-h
bind-key C-h select-pane -L
bind-key C-j select-pane -D
bind-key C-k select-pane -U
bind-key C-l select-pane -R
# Don't allow repeat for swaps
bind-key > swap-pane -D # swap current pane with the next one
bind-key < swap-pane -U # swap current pane with the previous one
# Window Navigation. Allow repeat.
bind-key -r h previous-window # select previous window
bind-key -r l next-window # select next window
# Don't allow repeat for swaps
bind-key L swap-window -t +1 # Swap left
bind-key H swap-window -t -1 # Swap right
bind-key T swap-window -t 1 # Swap to top
# -- copy mode -----------------------------------------------------------------
bind-key Enter copy-mode # enter copy mode
bind-key b list-buffers # list paster buffers
bind-key p paste-buffer # paste from the top pate buffer
bind-key P choose-buffer # choose which buffer to paste from
# Kill session
bind-key K kill-session
# ----------------------
# Status Bar
# -----------------------
set-option -g status on # turn the status bar on
set -g status-style fg=white,bg=default
set -g status-justify centre # center window list for clarity
# status
#set -g status-interval 15 # status update frequency
#set -g display-panes-time 800 # slightly longer pane indicators display time
#set -g display-time 1000 # slightly longer status messages display time
# visual notification of activity in other windows
set -g visual-activity on
# set color for status bar
# show host name and IP address on left side of status bar
set -g status-left-length 60
set -g status-left '#[fg=green](#S) #(whoami)#[fg=brightblue]@#h#[default]'
# put useful info in the status bar
set-option -g set-titles on
set-option -g set-titles-string '#H:#S.#I.#P #W #T' # window number,program name, active(or not)
# Right side of status bar
set -g status-right-length 60
# Window : Pane : Date : Time: Zulu
set -g status-right "#[fg=colour160]#I:#P #[fg=white]| #[fg=colour82]#(date '+%%Y-%%m-%%d %%I:%%M %%p')"
set -g pane-border-style bg=black,fg=white
set -g pane-active-border-style bg=green,fg=black
# default statusbar colors
set -g status-style fg=white,bg=default,dim
# command/message line colors
set -g message-style fg=white,bg=black,bright
# set the pane border colors
set -g pane-border-style fg=colour250,bg=colour233
set -g pane-active-border-style fg=colour250,bg=colour250
# Direnv
set-option -g update-environment "DIRENV_DIFF DIRENV_DIR DIRENV_WATCHES"
set-environment -gu DIRENV_DIFF
set-environment -gu DIRENV_DIR
set-environment -gu DIRENV_WATCHES
set-environment -gu DIRENV_LAYOUT