Skip to content

Instantly share code, notes, and snippets.

@iamdey
Last active August 1, 2017 08:11
Show Gist options
  • Save iamdey/888ec4527fb162984928 to your computer and use it in GitHub Desktop.
Save iamdey/888ec4527fb162984928 to your computer and use it in GitHub Desktop.
#from pmartin
# tmux > 2.0
# Bindings de keys
set -g prefix C-a
set-window-option -g mode-keys vi
bind-key C-a last-window
set -g mouse on
# Toggle mouse on with ^B m
bind m \
set -g mouse on \;\
display 'Mouse: ON'
# Toggle mouse off with ^B M
bind M \
set -g mouse off \;\
display 'Mouse: OFF'
#unbind +
#bind + \
# new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' \;\
# swap-pane -s tmux-zoom.0 \;\
# select-window -t tmux-zoom
#unbind -
#bind - \
# last-window \;\
# swap-pane -s tmux-zoom.0 \;\
# kill-window -t tmux-zoom
# 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 -g 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
set-window-option -g window-status-current-fg white
set-window-option -g window-status-current-bg red
# Splitting de window : vertical avec | et horizontal avec -
unbind %
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# 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