-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
139 lines (110 loc) · 4.26 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
set -g prefix C-g
bind C-g send-prefix
unbind C-b
# Relax!
set -sg escape-time 10
set -sg repeat-time 600
# Focus
set -g focus-events on
# Mouse
set -g mouse on
# This is hilariously absurd. How many nerds use tmux on OS X every day and
# it's still fundamentally broken?
set -g default-command "myreattach-to-user-namespace -l bash"
# Less stretching to get to the first item.
set -g base-index 1
setw -g pane-base-index 1
# Reload the config.
bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"
# Killing made easy
bind x kill-pane
bind X kill-session
# Saner splitting.
bind v split-window -h -c '#{pane_current_path}'
bind s split-window -v -c '#{pane_current_path}'
bind C-n display-popup -E -E -d '#{pane_current_path}'
# Pane movement
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Layouts
set -g main-pane-width 260
bind M select-layout main-vertical
bind = select-layout even-horizontal
# Pane resizing
bind -r < resize-pane -L 5
bind -r > resize-pane -R 5
bind -r _ resize-pane -D 5
bind -r - resize-pane -U 5
# Window movement
# Only really makes sense if you have your parens bound to shifts like me.
bind -r ( select-window -t :-
bind -r ) select-window -t :+
bind-key -r H swap-window -t -1
bind-key -r L swap-window -t +1
# 256 colors please
set -g default-terminal "xterm-256color"
# tell Tmux that outside terminal supports true color
set -ga terminal-overrides ",xterm-256color*:Tc"
# Re-set SSH_CONNECTION
# Re-evaluate the following env variables, when re-attaching
# This makes sure `cb` keeps on working, across different SSH sessions
set -g update-environment "SSH_CONNECTION SSH_CLIENT SSH_TTY"
# Bad Wolf
set -g status-style fg=white,bg=colour234
set -g window-status-activity-style bold
set -g pane-border-style fg=colour245
set -g pane-active-border-style fg=colour39
set -g message-style fg=colour16,bg=colour221,bold
# Custom status bar
set -g status-left-length 32
set -g status-right-length 150
set -g status-interval 5
set -g status-left '#[fg=colour16,bg=colour254] #S #[fg=colour254,bg=colour234]'
set -g status-right "#[fg=colour245] #[fg=colour221]#(date +%%H:%%M)#[fg=colour245] %d %b #[fg=colour254,bg=colour234]#[fg=colour16,bg=colour254] #h "
set -g window-status-format "#[fg=white,bg=colour234,nobold] #I #W "
set -g window-status-current-format "#[fg=colour234,bg=colour39]#[fg=colour16,bg=colour39,noreverse] #I #W #[fg=colour39,bg=colour234]"
# Activity
setw -g monitor-activity on
set -g visual-activity off
# Autorename sanely.
setw -g automatic-rename on
# Better name management
bind c new-window -a
bind , command-prompt "rename-window '%%'"
# bind < command-prompt "rename-session '%%'"
# Copy mode
setw -g mode-keys vi
bind N copy-mode
unbind [
unbind p
bind p paste-buffer
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "myreattach-to-user-namespace cb"
bind -T copy-mode-vi Escape send -X cancel
bind -T copy-mode-vi H send -X start-of-line
bind -T copy-mode-vi L send -X end-of-line
bind -T copy-mode-vi C-d send -X halfpage-down
bind -T copy-mode-vi C-u send -X halfpage-up
bind ` split-window sh -c "edit-pasteboard"
bind BSpace switch-client -l
bind S choose-tree
# Use `ta` to switch sessions
bind C-P popup -E -E ta
bind @ split-window -v "bash -lc 'cal -3 && press-enter-to-exit'"
bind p split-window -h "bash -lc 'ep'"
# The following can be used to quickly run a command / application
# in a split pane
bind ! command-prompt -p "Shell command:" "split-window -v -c '#{pane_current_path}' bash -lc '%%; press-enter-to-exit'"
bind V command-prompt -p "Shell command:" "split-window -h -l 120 -c '#{pane_current_path}' bash -lc '%%; press-enter-to-exit'"
bind W command-prompt -p "w3m search:" "run-shell \"w3mw-tmux '%%'\""
if-shell '[ -n "$TMPDIR" ]' \
'TMP=$TMPDIR' \
'TMP=/tmp'
bind y capture-pane -J \; save-buffer "$TMP/tmux-buffer" \; delete-buffer \; split-window sh -c "cat $TMP/tmux-buffer | vim -R + -"
bind Y capture-pane -J -S - \; save-buffer "$TMP/tmux-buffer" \; delete-buffer \; split-window sh -c "cat $TMP/tmux-buffer | vim -R + -"
# tmux-externalpipe
set -g @externalpipe-cg-cmd 'cg-fzf'
set -g @externalpipe-cg-key 'Enter'
run-shell ~/.tmux-plugins/tmux-externalpipe/externalpipe.tmux