summaryrefslogtreecommitdiff
path: root/dotfiles/tools/tmux.conf
blob: a2ec113f8b05c0f8b3d035d2335eb136089754d7 (plain) (blame)
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
# Pour les nostalgiques de screen
# comme les raccourcis ne sont pas les mêmes, j'évite
set-option -g prefix C-a
unbind-key C-b
bind-key a send-prefix

bind-key C-d detach
unbind-key C-z
bind-key C-z resize-pane -Z
bind-key h switch-client -t remote

unbind-key )
unbind-key (
bind-key -r ( switch-client -p
bind-key -r ) switch-client -n

bind-key -n M-Left previous-window
bind-key -n M-Right next-window
bind-key -n M-PageDown switch-client -n
bind-key -n M-PageUp switch-client -p

bind-key M set-window-option monitor-activity
bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlview" '$SHELL -c "urlview < /tmp/tmux-buffer; rm -f /tmp/tmux-buffer"'

bind-key C-c run-shell -b "tmux save-buffer - | xclip -i -sel clipboard"
bind-key C-v run-shell "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"

bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-selection-and-cancel \; run-shell -b "tmux save-buffer - | xclip -i -selection primary"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-selection-and-cancel \; run-shell -b "tmux save-buffer - | xclip -i -selection primary"
bind-key -T root MouseUp2Pane run-shell "tmux set-buffer \"$(xclip -o -selection primary)\"; tmux paste-buffer"

# même hack que sur screen lorsqu'on veut profiter du scroll du terminal
# (xterm ...)
set-option -g terminal-overrides 'xterm*:smcup@:rmcup@:Tc'

# Renumeroter les fenetres quand on en ferme une
set-option -g renumber-windows on

#Pour les ctrl+arrow
set-option -g xterm-keys on

# c'est un minimum (defaut 2000)
set-option -g history-limit 10000

# lorsque j'ai encore un tmux ailleurs seule
# sa fenetre active réduit la taille de ma fenetre locale
set-window-option -g aggressive-resize on

# Pour etre alerté sur une alerte dans une autre fenêtre
set-option -g visual-activity off
set-option -g visual-bell off

# numéroter a partir de 1, pratique pour l'accès direct
set-option -g base-index 1

# repercuter le contenu de la fenetre dans la barre de titre
# reference des string : man tmux (status-left)
set-option -g set-titles on
set-option -g set-titles-string '#H #W #T' # host window command

set-option -g update-environment "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY XDG_VTNR"

set-window-option -g window-status-bell-style fg=yellow,bold,underscore

set -g default-terminal screen-256color

set -g mouse on

{%@@ if role.get(profile) == "fretlink" @@%}
new-session -A -c "$HOME/workdir/admin-root" -s admin-root
send-keys "../start" C-m
rename-window "running"
new-window
new-session -A -c "$HOME/workdir/carrier-directory" -s carrier-directory
send-keys "../start" C-m
rename-window "running"
new-window
new-session -A -c "$HOME/workdir/notifier" -s notifier
send-keys "../start" C-m
rename-window "running"
new-window
new-session -A -c "$HOME/workdir/geodata" -s geodata
new-session -A -c "$HOME/workdir/app" -s app
send-keys "../start" C-m
rename-window "running"
new-window
select-window -t 1
{%@@ endif @@%}