2015-05-19 22:40:53 +02:00
|
|
|
##############--------------------------------------------------------------
|
2014-08-31 23:59:02 +02:00
|
|
|
##
|
2014-09-11 19:42:12 +02:00
|
|
|
## Fichier de configuration : ~/.tmux/tmux.conf
|
|
|
|
## 1.0: 14-09-11
|
2014-08-31 23:59:02 +02:00
|
|
|
##
|
|
|
|
## By Gardouille
|
|
|
|
##
|
|
|
|
## Ce fichier est lu automatiquement par tmux si il est placé dans le homedir
|
|
|
|
##
|
|
|
|
##
|
|
|
|
## Utilisation:
|
|
|
|
## tmux attach -d -t SESSION_ID
|
|
|
|
##
|
|
|
|
## Dépendances:
|
|
|
|
## vlock : permet de verrouiller tmux en cas d'inactivé ou d'appel (CTRL+b x)
|
2014-09-11 19:42:12 +02:00
|
|
|
## urlview : permet de lister les liens présents dans une fenêtre (CTRL+b u)
|
2015-11-25 22:44:03 +01:00
|
|
|
## cmatrix: simulates the display from "The Matrix" used both with vlock (CTRL+b x)
|
2014-08-31 23:59:02 +02:00
|
|
|
|
2016-01-28 23:54:55 +01:00
|
|
|
### colors {{{
|
|
|
|
black="#000000"
|
|
|
|
lightblack="#151515"
|
|
|
|
blue="#0094cc"
|
|
|
|
grey="#909090"
|
|
|
|
darkgrey="#26221c"
|
|
|
|
lightgreen="#9fbc00"
|
|
|
|
green="#345f0c"
|
|
|
|
pink="#b00a44"
|
|
|
|
lightpink="#FF0675"
|
|
|
|
red="#ff0000"
|
|
|
|
darkred="#8f0000"
|
|
|
|
debianred="#D70A53"
|
|
|
|
white="#efefef"
|
|
|
|
|
|
|
|
### }}}
|
|
|
|
|
|
|
|
### global settings {{{
|
2014-08-31 23:59:02 +02:00
|
|
|
|
|
|
|
#### UTF-8 -------------------------------------------------------------
|
|
|
|
set-option -g status-utf8 on
|
|
|
|
set-window-option -g utf8 on
|
|
|
|
|
2016-01-28 23:54:55 +01:00
|
|
|
set -g default-terminal "screen-256color"
|
|
|
|
|
|
|
|
### }}}
|
|
|
|
|
2016-01-28 01:11:03 +01:00
|
|
|
### statusbar {{{
|
2014-08-31 23:59:02 +02:00
|
|
|
|
|
|
|
# Centrer la liste des terminaux
|
|
|
|
#set -g status-justify centre
|
|
|
|
|
|
|
|
# Partie gauche de la barre
|
|
|
|
# vide
|
|
|
|
set -g status-left ""
|
|
|
|
|
|
|
|
# Si tmux est lancé hors de Xorg, on affiche des informations supplémentaires
|
|
|
|
## Partie gauche de la barre
|
|
|
|
# #H : le nom de la machine en vert
|
2015-09-22 16:24:43 +02:00
|
|
|
#if '[ -z "$DISPLAY" ]' 'set -g status-left "[#[fg=green]#H#[default]]"'
|
|
|
|
|
2014-08-31 23:59:02 +02:00
|
|
|
## Partie droite de la barre
|
|
|
|
# #(cat /proc/loadavg | cut -d \" \" -f 1,2,3) : charge CPU en magenta
|
|
|
|
# %a %Y-%m-%d %H:%M : Le jour, la date d'aujourd'hui et l'heure en cyan et gras
|
2015-09-22 16:24:43 +02:00
|
|
|
if '[ -z "$DISPLAY" ]' 'set -g status-right "[ #[fg=default]#(cat /proc/loadavg | cut -d \" \" -f 1,2,3)#[default] ]"'
|
2014-08-31 23:59:02 +02:00
|
|
|
if '[ -z "$DISPLAY" ]' 'set -g status-right-length 50'
|
|
|
|
|
|
|
|
# Raffraichissement de la barre d'état toutes les X secondes
|
|
|
|
set -g status-interval 1
|
|
|
|
|
2016-01-28 01:11:03 +01:00
|
|
|
### }}}
|
2014-08-31 23:59:02 +02:00
|
|
|
|
2016-01-28 01:11:03 +01:00
|
|
|
### keybindings {{{
|
2014-08-31 23:59:02 +02:00
|
|
|
|
|
|
|
## Redéfinition des raccourcis:
|
|
|
|
# Renommer le terminal courant
|
|
|
|
unbind A
|
|
|
|
bind A command-prompt "rename-window %%"
|
|
|
|
|
|
|
|
# Aller au terminal précédent (CTRL+a)
|
2015-05-19 22:40:53 +02:00
|
|
|
unbind C-a
|
|
|
|
bind-key C-a last-window
|
2014-08-31 23:59:02 +02:00
|
|
|
|
|
|
|
# Aller au terminal suivant (CTRL+n)
|
2015-05-19 22:40:53 +02:00
|
|
|
unbind C-n
|
|
|
|
bind-key C-n next-window
|
2014-08-31 23:59:02 +02:00
|
|
|
|
|
|
|
# Aller au terminal précédent (CTRL+p)
|
2015-05-19 22:40:53 +02:00
|
|
|
unbind C-p
|
|
|
|
bind-key C-p previous-window
|
2014-08-31 23:59:02 +02:00
|
|
|
|
2015-05-19 22:06:00 +02:00
|
|
|
#Copy tmux buffer to CLIPBOARD
|
2015-05-19 22:46:38 +02:00
|
|
|
unbind C-y
|
2015-05-19 22:06:00 +02:00
|
|
|
bind-key y run-shell -b "tmux save-buffer - | xclip -i -selection clipboard"
|
|
|
|
#Copy CLIPBOARD to tmux buffer and paste-it in tmux
|
2015-05-19 22:46:38 +02:00
|
|
|
unbind C-v
|
2015-05-19 22:40:53 +02:00
|
|
|
bind-key C-v run "tmux set-buffer -- \"$(xclip -o -selection clipboard)\"; tmux paste-buffer"
|
2014-08-31 23:59:02 +02:00
|
|
|
|
2015-05-19 22:06:00 +02:00
|
|
|
# Copy-mode
|
2015-05-19 22:54:19 +02:00
|
|
|
unbind PPage
|
|
|
|
bind PPage copy-mode
|
2015-05-19 22:06:00 +02:00
|
|
|
bind-key -t vi-copy 'v' begin-selection
|
|
|
|
bind-key -t vi-copy 'y' copy-selection
|
|
|
|
|
2015-05-19 22:46:38 +02:00
|
|
|
# Paste buffer
|
|
|
|
unbind P
|
|
|
|
bind-key P run "tmux paste-buffer"
|
|
|
|
|
2015-05-19 22:07:47 +02:00
|
|
|
# Window selection by name
|
|
|
|
unbind b
|
2015-05-19 22:31:24 +02:00
|
|
|
bind-key b command-prompt "find-window -NT '%%'"
|
2015-05-19 22:07:47 +02:00
|
|
|
unbind C-b
|
2015-05-19 22:31:24 +02:00
|
|
|
bind-key C-b command-prompt "find-window -CNT '%%'"
|
2015-05-19 22:07:47 +02:00
|
|
|
|
2014-08-31 23:59:02 +02:00
|
|
|
# Détacher tmux
|
2015-05-19 22:40:53 +02:00
|
|
|
unbind C-d
|
|
|
|
bind C-d detach
|
2014-08-31 23:59:02 +02:00
|
|
|
|
2015-05-19 22:09:02 +02:00
|
|
|
# Zoom/Unzoom a pane
|
|
|
|
unbind f
|
|
|
|
bind-key f resize-pane -Z
|
|
|
|
unbind C-f
|
|
|
|
bind-key C-f resize-pane -Z
|
|
|
|
|
2014-08-31 23:59:02 +02:00
|
|
|
# Verrouiller tmux
|
2015-05-19 22:40:53 +02:00
|
|
|
unbind C-x
|
|
|
|
bind C-x lock-server
|
2014-08-31 23:59:02 +02:00
|
|
|
unbind x
|
|
|
|
bind x lock-server
|
|
|
|
|
|
|
|
# Activer/Désactiver la synchronisation des panels
|
2015-05-19 22:40:53 +02:00
|
|
|
unbind C-s
|
|
|
|
bind C-s set-window-option synchronize-panes
|
2014-08-31 23:59:02 +02:00
|
|
|
|
2015-09-22 15:42:36 +02:00
|
|
|
# Present a menu of URLs to open from visible pane
|
|
|
|
bind-key u capture-pane \;\
|
|
|
|
save-buffer ~/.tmux/.tmux-buffer \;\
|
|
|
|
split-window -l 15 "urlview ~/.tmux/.tmux-buffer"
|
2014-09-11 19:42:12 +02:00
|
|
|
|
2015-05-19 22:55:11 +02:00
|
|
|
# Create a new session
|
|
|
|
unbind C-t
|
|
|
|
bind C-t command-prompt "new-session "
|
|
|
|
|
2016-01-28 00:58:34 +01:00
|
|
|
# reload tmux settings
|
2015-05-19 22:40:53 +02:00
|
|
|
unbind R
|
2016-01-28 00:58:34 +01:00
|
|
|
bind-key R source-file ~/.tmux/tmux.conf\; display-message "tmux config reloaded"
|
2014-09-11 19:42:12 +02:00
|
|
|
|
2014-08-31 23:59:02 +02:00
|
|
|
## Nouveaux raccourcis clavier pour les terminaux
|
|
|
|
# Aller au terminal n°{1,12} avec les touches F{1-12}
|
|
|
|
#bind ... selectw -t:0
|
|
|
|
#bind C-& selectw -t:0
|
|
|
|
bind F1 selectw -t:1
|
|
|
|
bind F2 selectw -t:2
|
|
|
|
bind F3 selectw -t:3
|
|
|
|
bind F4 selectw -t:4
|
|
|
|
bind F5 selectw -t:5
|
|
|
|
bind F6 selectw -t:6
|
|
|
|
bind F7 selectw -t:7
|
|
|
|
bind F8 selectw -t:8
|
|
|
|
bind F9 selectw -t:9
|
|
|
|
bind F10 selectw -t:10
|
|
|
|
bind F11 selectw -t:11
|
|
|
|
bind F12 selectw -t:12
|
|
|
|
|
|
|
|
# Pour basculer entre les différents terminaux, directement avec les touches F{1,12} (sans utiliser CTRL+a), on peut utiliser ça:
|
|
|
|
#bind -n F1 select-window -t 1
|
|
|
|
#bind -n F2 select-window -t 2
|
|
|
|
#bind -n F3 select-window -t 3
|
|
|
|
#bind -n F4 select-window -t 4
|
|
|
|
#bind -n F5 select-window -t 5
|
|
|
|
#bind -n F6 select-window -t 6
|
|
|
|
#bind -n F7 select-window -t 7
|
|
|
|
#bind -n F8 select-window -t 8
|
|
|
|
#bind -n F9 select-window -t 9
|
|
|
|
#bind -n F10 select-window -t 10
|
|
|
|
#bind -n F11 select-window -t 11
|
|
|
|
#bind -n F12 select-window -t 12
|
|
|
|
|
|
|
|
|
|
|
|
## Nouveaux raccourcis clavier pour les splits/panels
|
2014-09-12 14:26:55 +02:00
|
|
|
# split windows comme herbsluft + bépo
|
2014-08-31 23:59:02 +02:00
|
|
|
# Définition des splits comme dans vim (s: vertical et v: horizontal)
|
|
|
|
#bind s split-window -v
|
2014-09-12 14:26:55 +02:00
|
|
|
bind Enter split-window -h
|
|
|
|
unbind Space
|
|
|
|
bind Space split-window
|
2014-08-31 23:59:02 +02:00
|
|
|
|
|
|
|
# Permet de se déplacer entre les panels avec les touches hjkl
|
|
|
|
# h: gauche
|
|
|
|
# j: bas
|
|
|
|
# k: haut
|
|
|
|
# l: droite
|
|
|
|
bind h select-pane -L
|
|
|
|
bind j select-pane -D
|
|
|
|
bind k select-pane -U
|
|
|
|
bind l select-pane -R
|
|
|
|
|
2014-09-12 14:26:55 +02:00
|
|
|
# Changer la réorganisation des panes
|
|
|
|
unbind .
|
|
|
|
bind . next-layout
|
|
|
|
|
2014-08-31 23:59:02 +02:00
|
|
|
# Redimentionnement des panels comme vim
|
|
|
|
# Possibilité de changer la valeur "2" par ce qu'on veut
|
|
|
|
# < : agrandissement vers la gauche
|
|
|
|
# > : agrandissement vers la droite
|
|
|
|
# - : agrandissement vers le bas
|
|
|
|
# + : agrandissement vers la haut
|
|
|
|
bind < resize-pane -L 2
|
|
|
|
bind > resize-pane -R 2
|
|
|
|
bind - resize-pane -D 2
|
|
|
|
bind + resize-pane -U 2
|
|
|
|
|
|
|
|
# Aller au panel suivant avec Tab
|
|
|
|
unbind Tab
|
|
|
|
bind Tab select-pane -t:.+
|
|
|
|
# Aller au panel précédent avec SHIFT+Tab
|
|
|
|
unbind BTab
|
|
|
|
bind BTab select-pane -t:.-
|
|
|
|
|
|
|
|
## Raccourcis clavier pour les sessions
|
|
|
|
# Proposer la liste des sessions avec choix possible
|
|
|
|
unbind _
|
2015-05-20 13:56:32 +02:00
|
|
|
bind _ switch-client -n
|
2014-08-31 23:59:02 +02:00
|
|
|
unbind C-_
|
|
|
|
bind C-_ choose-session
|
|
|
|
|
2016-01-28 21:11:49 +01:00
|
|
|
# toggle status bar
|
|
|
|
unbind c-h
|
|
|
|
bind c-h set -g status
|
|
|
|
|
2016-01-28 01:11:03 +01:00
|
|
|
### }}}
|
2014-08-31 23:59:02 +02:00
|
|
|
|
2016-01-28 01:11:03 +01:00
|
|
|
### Configuration {{{
|
2014-09-11 19:42:12 +02:00
|
|
|
# Numéroter les fenêtres et les splits à partir de 1
|
|
|
|
set -g base-index 1
|
|
|
|
set -g pane-base-index 1
|
2014-08-31 23:59:02 +02:00
|
|
|
|
|
|
|
# Verrouillage de la session après inactivité (en s)
|
|
|
|
set -g lock-after-time 1800
|
2015-11-25 22:44:03 +01:00
|
|
|
# pour que le lock marche sous linux (aptitude install vlock)
|
|
|
|
# Use both cmatrix (if available) and vlock
|
|
|
|
if 'command -v cmatrix' 'set -g lock-command "cmatrix -s && vlock"' 'set -g lock-command vlock'
|
2014-08-31 23:59:02 +02:00
|
|
|
|
|
|
|
# Initialize sessions
|
2016-01-28 00:58:34 +01:00
|
|
|
bind I source-file ~/.tmux/splitWORK\; display-message "tmux split for Work"
|
|
|
|
bind V source-file ~/.tmux/split101010\; display-message "tmux split for 101010"
|
|
|
|
bind H source-file ~/.tmux/splitHP\; display-message "tmux split for HP"
|
2014-08-31 23:59:02 +02:00
|
|
|
|
2016-01-28 01:11:03 +01:00
|
|
|
### }}}
|
|
|
|
|
2016-01-29 11:11:52 +01:00
|
|
|
### session {{{
|
|
|
|
## If run a local session, source additionnal file to overload some config
|
|
|
|
if '[ -z "${SSH_TTY}" ]' 'source-file $HOME/.tmux/tmux.conf.local'
|
|
|
|
|
2016-01-28 01:11:03 +01:00
|
|
|
### }}}
|