-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
77 lines (56 loc) · 2.65 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
## Change the default prefix key.
set-option -g prefix C-j
unbind-key C-b
bind-key C-j send-prefix
## Let interactive applications (such as less or vim) preserve their content
## on exit.
set-window-option -g alternate-screen off
bind-key R source-file ~/.tmux.conf
set-option -g default-terminal tmux-256color
set-option -g focus-events on
## Enable scrolling with mouse.
set-option -g mouse on
# macOS uses `C-Space` to switch input sources.
# We can either 1)
#bind-key -T copy-mode Space send-keys -X begin-selection
# or 2)
set-option -g mode-keys vi
set-option -g status-keys emacs
# Show abbreviated weekday name (%a, e.g. `Tue`) near the clock.
set-option -g status-right '#{?window_bigger,[#{window_offset_x}#,#{window_offset_y}] ,}"#{=21:pane_title}" %a %H:%M %d-%b-%y'
if-shell '[ $(uname) = Linux ]' \
'set-option -g status-bg magenta ; set-option -g status-fg white' \
'set-option -g status-bg cyan'
bind-key C-l last-window # in addition to the default `l' binding
# Remap `<prefix> "` and `<prefix> %` to open panes in the current directory.
bind-key '"' split-window -v -c '#{pane_current_path}'
bind-key '%' split-window -h -c '#{pane_current_path}'
set-option -g renumber-windows on
set-option -g history-limit 50000
set-option -g display-time 4000
#set-option -g allow-rename off
## Don't wait 500 ms to determine if Escape is part of a meta key sequence.
## It's not. Now quickly pressed `ESC k` combination will do the right thing
## in Doom Emacs' evil mode (which is "switch to Normal mode and move up")
## instead of being treated as `M-k` ("kill the sentence").
##
## See https://stackoverflow.com/a/28062492
set-option -g escape-time 0
# Old tmux doesn't support `%if "#{<:#{version},3}"` syntax.
if-shell '[ $(tmux -V) \< "tmux 3" ]' 'setenv -g OLD_TMUX_P 1'
if-shell '[ ${OLD_TMUX_P:-0} = 1 ]' \
'bind-key -n S-Left swap-window -t -1' \
'bind-key -n S-Left swap-window -t -1 \; previous-window'
if-shell '[ ${OLD_TMUX_P:-0} = 1 ]' \
'bind-key -n S-Right swap-window -t +1' \
'bind-key -n S-Right swap-window -t +1 \; next-window'
if-shell '[ $(tmux -V) \< "tmux 1.9" ]' \
'set -g default-path "~"' # `default-path` has been removed in tmux 1.9
bind-key H \
run-shell '~/bin/tmux-cmd toggle-window-prefix tmuxlog.#I "#S" "#W"' \; \
pipe-pane -o 'cat >>~/tmuxlog.#I'
## http://www.economyofeffort.com/2013/07/29/reattach-to-user-namespace-the-fix-for-your-tmux-in-os-x-woes/
if-shell '[ `uname` = Darwin ] && which reattach-to-user-namespace >&/dev/null'\
'set-option -g default-command "reattach-to-user-namespace -l $SHELL"'
if-shell '[ `uname` != Darwin ]' \
'set-option -g status-right " \"#H\" %H:%M %d-%b-%y"'