Skip to content

Instantly share code, notes, and snippets.

@NunoSempere
Created April 7, 2022 02:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NunoSempere/cd51ef27b57e284b553b02f6df9ab73a to your computer and use it in GitHub Desktop.
Save NunoSempere/cd51ef27b57e284b553b02f6df9ab73a to your computer and use it in GitHub Desktop.
# Shortcuts
## At the recommendation of
## https://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# No delay for escape key press
set -sg escape-time 0
# mouse mode (fixes text selection issues)
# set -g mouse on
## vim mode
setw -g mode-keys vi
# selection
# set -s set-clipboard external
## https://www.rockyourcode.com/copy-and-paste-in-tmux/
set-option -g mouse on
set-option -s set-clipboard off
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
# bind-key -T copy-mode-vi y send-keys -X rectangle-toggle
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -se c -i'
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel 'xclip -se c -i'
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -se c -i'
## a long, long history
set-option -g history-limit 5000
# set -s copy-command 'xsel -i'
# set -s set-clipboard off
# bind -Tcopy-mode-vi C-j send -X copy-pipe-and-cancel 'xsel -i'
# bind -Tcopy-mode-vi Enter send -X copy-pipe-and-cancel 'xsel -ip'
# bind -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel 'xsel -is'
# bind -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel 'xsel -i'
# bind-key -T copy-mode-vi 'v' send -X begin-selection
# bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# don't rename windows automatically
set-option -g allow-rename off
setw -g automatic-rename off
# split panes using \|/ and -
bind / split-window -h
bind - split-window -v
unbind '"'
unbind %
## split panes into the same directory
## maybe not working rn.
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
## bind c new-window -c "#{pane_current_path}"
# 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
# Use Alt-vim keys without prefix key to switch panes
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# reload config
bind r source-file ~/.tmux.conf
# enable italics
# set -g default-terminal "tmux"
# THEME
set -g default-terminal "xterm-256color"
set -ag terminal-overrides ",xterm-256color:Tc"
## set -g default-terminal "screen-256color"
set -g @plugin 'tmux-plugins/tpm'
## set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'dracula/tmux'
set -g @dracula-show-fahrenheit false
## set -g @plugin 'dracula/tmux'
## set -g @dracula "pink dark_gray"
## set -g @dracula-show-left-icon session
## set -g @dracula-show-fahrenheit false
## set -g @dracula-cpu-usage-colors "pink dark_gray"
## set -g @dracula-military-time true
## set -g @dracula-cpu-usage-label "CPU"
## set -g @dracula-ram-usage-label "RAM"
## reload with C-a I
run '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment