# tmux\_config

TMUX CONFIG

## ---------------------

## Configuration

## ---------------------

## -- general -------------------------------------------------------------------

set -g default-terminal "screen-256color" # colors! setw -g xterm-keys on set -s escape-time 10 # faster command sequences set -sg repeat-time 600 # increase repeat timeout set -s focus-events on

set -g prefix2 C-a # GNU-Screen compatible prefix bind C-a send-prefix -2

set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2) setw -q -g utf8 on

set -g history-limit 5000 # boost history

## -- urlview -------------------------------------------------------------------

bind U run "cut -c3- \~/.tmux.conf | sh -s \_urlview #{pane\_id}"

## remap prefix from 'C-b' to 'C-a'-----------------------------------------------

## unbind C-b

## set-option -g prefix C-a

## bind-key C-a send-prefix

## split panes using | and -

bind split-window -h bind - split-window -v unbind '"' unbind %

## 0 is too far from \` ;)

set -g base-index 1

## reload config file (change file location to your the tmux.conf you want to use)

bind r source-file \~/.tmux.conf

## switch panes using Alt-arrow without prefix

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

## Increase scrollback history limit

set -g history-limit 1500

## Enable mouse mode (tmux 2.1 and above)

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

## To copy, left click and drag to highlight text in yellow,

## once you release left click yellow text will disappear and will automatically be available in clibboard

## # 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"

## don't rename windows automatically

set-option -g allow-rename off

bind Enter copy-mode # enter copy mode

run -b 'tmux bind -t vi-copy v begin-selection 2> /dev/null || true' run -b 'tmux bind -T copy-mode-vi v send -X begin-selection 2> /dev/null || true' run -b 'tmux bind -t vi-copy C-v rectangle-toggle 2> /dev/null || true' run -b 'tmux bind -T copy-mode-vi C-v send -X rectangle-toggle 2> /dev/null || true' run -b 'tmux bind -t vi-copy y copy-selection 2> /dev/null || true' run -b 'tmux bind -T copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/null || true' run -b 'tmux bind -t vi-copy Escape cancel 2> /dev/null || true' run -b 'tmux bind -T copy-mode-vi Escape send -X cancel 2> /dev/null || true' run -b 'tmux bind -t vi-copy H start-of-line 2> /dev/null || true' run -b 'tmux bind -T copy-mode-vi H send -X start-of-line 2> /dev/null || true' run -b 'tmux bind -t vi-copy L end-of-line 2> /dev/null || true' run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true'

## Open Panes

## bind-key M-h new-window -n hax \\; \\

## split-window -v -p 50 -t 1 hax \\; \\

## send-keys -t hax 'tmux select-pane -P 'fg=Blue'' 'Enter' \\; \\

## split-window -h -p 50 -t 2 hax \\; \\

## send-keys -t hax 'tmux select-pane -P 'fg=Purple'' 'Enter' \\; \\

## THEME

set -g status-bg black set -g status-fg white set -g window-status-current-bg white set -g window-status-current-fg black set -g window-status-current-attr bold set -g status-interval 60 set -g status-left-length 30 set -g status-left '#[fg=green](https://github.com/0xdecaf2bad/OSCP-Study-Notes/tree/5950b95bf853436015c8435c28c9eebf23767aac/99-to%20file/Items%20to%20Install%20in%20Kali/tmux/Commands--tmux_2--tmux_config.md#S) #(whoami)' set -g status-right '#\[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#\[default] #\[fg=white]%H:%M#\[default]'

## List of plugins

set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @plugin 'nhdaly/tmux-better-mouse-mode' set -g @plugin 'tmux-plugins/tmux-yank' set -g @plugin 'tmux-plugins/tmux-copycat' set -g @plugin 'tmux-plugins/tmux-open'

## Other examples:

## set -g @plugin 'github\_username/plugin\_name'

## set -g @plugin '<git@github.com>/user/plugin'

## set -g @plugin '<git@bitbucket.com>/user/plugin'

## Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)

run -b '\~/.tmux/plugins/tpm/tpm'
