~cezelot/dotfiles

1fd6defaa0d23ee0d188556284d3037ae9f1687b — IsmaĆ«l Benjara 3 months ago 0644c93
Add tmux configuration file
1 files changed, 123 insertions(+), 0 deletions(-)

A .tmux.conf
A .tmux.conf => .tmux.conf +123 -0
@@ 0,0 1,123 @@
# If running inside tmux ($TMUX is set), then change the status line to red
#%if #{TMUX}
#set -g status-bg red
#%endif

# Set scrollback buffer to 10000
#set -g history-limit 10000

# Enable RGB colour if running in xterm(1)
set-option -sa terminal-overrides ',xterm*:Tc'

# Change the default $TERM to tmux-256color
set -g default-terminal 'tmux-256color'

# Keep windows around after they exit
#set -g remain-on-exit on

# Set the prefix to C-a
set -g prefix C-a
unbind C-b
bind C-a send-prefix

# Turn the mouse on, but without copy mode dragging
set -g mouse on
#unbind -n MouseDrag1Pane
#unbind -Tcopy-mode MouseDrag1Pane
bind -Tcopy-mode MouseDragEnd1Pane send -X copy-selection
#bind -Tcopy-mode MouseDragEnd1Pane send -X copy-selection-no-clear

# Set the key bindings for copy mode to vi
set -g mode-keys vi
# Set the key bindings for the command prompt to vi
set -g status-keys vi

# A key to toggle between smallest and largest sizes if a window is visible in
# multiple places
#bind F set -w window-size

# Keys to toggle monitoring activity in a window and the synchronize-panes option
#bind m set monitor-activity
#bind y set synchronize-panes\; display 'synchronize-panes #{?synchronize-panes,on,off}'

# Use M-Arrow keys to switch panes
bind -n M-Up select-pane -U
bind -n M-Left select-pane -L
bind -n M-Down select-pane -D
bind -n M-Right select-pane -R

# Use S-Arrow keys to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window

# Set easier window split keys
bind-key v split-window -h
bind-key h split-window -v
unbind '"'
unbind %

# Reload config file
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded."

# Don't rename windows automatically
#set-option -g allow-rename off


######################
### DESIGN CHANGES ###
######################

# Loud or Quiet?
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none

# Modes
#setw -g clock-mode-colour colour5
#setw -g mode-style 'fg=colour1 bg=colour18 bold'

# Panes
#set -g pane-border-style 'fg=colour19 bg=colour0'
#set -g pane-active-border-style 'bg=colour0 fg=colour9'

# Statusbar
#set -g status-position bottom
#set -g status-justify left
set -g status-style 'bg=black fg=green'
#set -g status-left ''
set -g status-right '%H:%M'
#set -g status-right '#[fg=colour233,bg=colour19] %d/%m #[fg=colour233,bg=colour8] %H:%M:%S '
#set -g status-right-length 50
#set -g status-left-length 20

setw -g window-status-current-style 'underscore'
#setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249]#F '

#setw -g window-status-style 'fg=colour9 bg=colour18'
#setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '

#setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold'

# Messages
#set -g message-style 'fg=colour232 bg=colour16 bold'

# Smart pane switching with awareness of Vim splits.
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
    | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?|fzf)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h'  'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j'  'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k'  'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l'  'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
    "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\'  'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
    "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\'  'select-pane -l'"

bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l