-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
109 lines (86 loc) · 3.31 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
# tmux.conf of Patrick Winter <[email protected]>
# Sets the default terminal
set -g default-terminal "xterm-24bit"
set -g terminal-overrides ',xterm-24bit:Tc'
# Set reload key to r
bind r source-file ~/.tmux.conf
# Respawn pane
bind R respawn-pane -k
# Set sane prefix key
unbind C-b
set -g prefix M-a
bind-key M-a send-prefix
# Count sessions start at 1
set -g base-index 1
# Set history scroll length
set-option -g history-limit 10000
# Auto renumber windows to avoid gaps
set-option -g renumber-windows on
# Set the title bar
set -g set-titles on
set -g set-titles-string '#h:#(echo "#{pane_current_path}" | rev | cut -d'/' -f-3 | rev)'
# Show activity
setw -g monitor-activity on
set -g visual-activity on
# Vim keybinds
setw -g mode-keys vi
# Enable mouse mode (tmux 2.1 and above)
# set -g mouse on
# Quick window switching
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
# Launch frequently used cli tools
bind-key -n M-e new-window -t 1 -b "emacsclient -nw"
bind-key -n M-0 new-window "bash ~/shared/parashift/bin/paradb.sh"
bind-key -n M-9 new-window "bash ~/shared/parashift/bin/besh.sh"
bind-key -n M-k new-window "k9s"
bind-key -n M-K new-window "kubectx"
bind-key -n M-p new-window "ipython"
bind-key -n M-i new-window -t 1 -b
# Vim navigation keybindings
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind d killp
bind D detach-client
# Pass escape through really quick
set -s escape-time 0
# Copy the copy buffer to system clipboard
#
# NOTE: It is important to unbind default rectangle-toggle binding:
# https://superuser.com/questions/395158/tmux-copy-mode-select-text-block
unbind-key -T copy-mode-vi v
bind -T copy-mode-vi 'v' send -X begin-selection
bind -T copy-mode-vi 'C-v' send -X rectangle-toggle
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
# Move pane between windows
bind-key J command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key S command-prompt -p "send pane to:" "join-pane -t '%%'"
# Write pan to logfile
bind-key H pipe-pane -o "exec cat >>$HOME/'#W-tmux.log'"
# Status bar
set -g message-style bg=yellow,fg=black
set-option -g status-style bg=default
set -g status-fg default
set -g status-left "#[fg=green,bold] λ #[fg=white,nobold]"
set -g status-justify left
set -g status-right "#[fg=cyan]#S#[fg=green]@#[fg=white]#(hostname -f) #[fg=default] %d/%m/%Y %H:%M:%S "
set -g window-status-current-style "fg=yellow"
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-dark.conf#L14
set-option -g pane-border-style fg=black # base02
set-option -g pane-active-border-style fg=brightgreen # base01
# Bell
set -g window-status-bell-style fg=red
# Activity indicator
set -g window-status-activity-style bg=black,fg=colour166
# Rename emacsclient to emacs
set -wg automatic-rename-format "#{?pane_in_mode,[tmux],#{s/emacsclient/emacs/:pane_current_command}}#{?pane_dead,[dead],}"