Skip to content

Instantly share code, notes, and snippets.

@h4n0sh1
Created January 12, 2021 00:56
Show Gist options
  • Save h4n0sh1/b2b8c064f3f82ad63b816e4ea2449208 to your computer and use it in GitHub Desktop.
Save h4n0sh1/b2b8c064f3f82ad63b816e4ea2449208 to your computer and use it in GitHub Desktop.
Spicy waterfall
#The simpler, the deadlier.
# Session cycling
bind p switch-client -p
bind n switch-client -n
# Clear
bind -n C-e send-keys 'C-l'
# Fashion v1ct1m
set-window-option -g window-status-current-style bg=red
set -g pane-active-border-style "bg=default fg=red"
set -g pane-border-style default
# Enable mouse & Copy/Paste - Requirements: xclip
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind -T copy-mode-vi C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-vi C-WheelDownPane send-keys -X halfpage-down
bind -T copy-mode-emacs C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down
# # Use vim keybindings in copy mode
setw -g mode-keys vi
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection c"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
# Window arrangment
set -g base-index 1
bind & select-window -t:1
bind é select-window -t:2
bind '"' select-window -t:3
bind "'" select-window -t:4
bind ( select-window -t:5
bind - select-window -t:6
bind è select-window -t:7
bind _ select-window -t:8
bind ç select-window -t:9
bind à select-window -t:10
# Reload tmux config
bind r source-file ~/.tmux.conf
bind-key v split-window -h
bind-key s split-window -v
bind-key J resize-pane -D 10
bind-key K resize-pane -U 10
bind-key H resize-pane -L 10
bind-key L resize-pane -R 10
bind-key M-j resize-pane -D
bind-key M-k resize-pane -U
bind-key M-h resize-pane -L
bind-key M-l resize-pane -R
# Vim style pane selection
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Use Ctrl-vim keys without prefix key to switch panes
bind -n C-h select-pane -L
bind -n C-j select-pane -D
bind -n C-k select-pane -U
bind -n C-l select-pane -R
# Use Ctrl-arrow keys without prefix key to switch panes
bind -n C-Left select-pane -L
bind -n C-Right select-pane -R
bind -n C-Up select-pane -U
bind -n C-Down select-pane -D
# Alt-arrow to switch windows
bind -n M-Left prev
bind -n M-Right next
# No delay for escape key press
set -sg escape-time 0
# Rebind inhuman prefix key
set -g prefix C-a
bind C-a send-prefix
unbind C-b
# Use the only mode really
#setw -g mode-keys vi
set -g status-keys vi
set -g history-limit 100000
set -g allow-rename off
# Send/join pane to/from window
bind-key j command-prompt -p "Join pane from:" "join-pane -s :'%%'"
bind-key k command-prompt -p "Send pane to:" "join-pane -t :'%%'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment