Skip to content

Instantly share code, notes, and snippets.

@pmartin
Last active July 4, 2020 12:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmartin/1b35fc2214b9cac8f205 to your computer and use it in GitHub Desktop.
Save pmartin/1b35fc2214b9cac8f205 to your computer and use it in GitHub Desktop.
# Bindings de keys
set -g prefix C-a
set-window-option -g mode-keys vi
bind-key C-a last-window
# setw -g mode-mouse on
# Toggle mouse on with ^B m
bind m \
set -g mode-mouse on \;\
set -g mouse-resize-pane on \;\
set -g mouse-select-pane on \;\
set -g mouse-select-window on \;\
display 'Mouse: ON'
# Toggle mouse off with ^B M
bind M \
set -g mode-mouse off \;\
set -g mouse-resize-pane off \;\
set -g mouse-select-pane off \;\
set -g mouse-select-window off \;\
display 'Mouse: OFF'
# Changement de fenêtre avec Maj + Flèches
bind -n S-Left previous-window
bind -n S-Right next-window
# Changement de panneau avec raccourcis style Vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Changement de panneau avec Alt + Flèches
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Changement de panneau à la souris
# set -g mouse-select-pane on
# Longueur de l'historique
set-option history-limit 16000
# Status bar
set-option -g status-justify "centre"
set -g status-fg white
set -g status-bg black
set -g status-left '#H#[default]'
set -g status-left-fg white
set -g status-left-bg blue
set -g status-right '#[fg=yellow,bold]#(cut -d " " -f 1-4 /proc/loadavg)#[default] #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default] '
set -g status-right-fg white
# default window title colors
set-window-option -g window-status-style fg=white
set-window-option -g -a window-status-style bg=default
set-window-option -g -a window-status-style dim
# active window title colors
set-window-option -g window-status-current-style fg=white
set-window-option -g -a window-status-current-style bg=default
set-window-option -g -a window-status-current-style bright
# Highlight active window
set-window-option -g -a window-status-current-style bg=red
# Splitting de window : vertical avec | et horizontal avec -
unbind %
bind | split-window -h
bind - split-window -v
# Set window notifications
setw -g monitor-activity off
set -g visual-activity off
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
# Ajouter à .bashrc pour avoir le nom du répertoire courant comme titres de fenêtres
# f(){ if [ "$PWD" != "$LPWD" ];then LPWD="$PWD"; tmux rename-window ${PWD//*\//}; fi }; export PROMPT_COMMAND=f;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment