Skip to content

Instantly share code, notes, and snippets.

@rohshall
Last active November 21, 2022 06:15
Show Gist options
  • Save rohshall/3eac521b30c61e7486449b3978d3d35c to your computer and use it in GitHub Desktop.
Save rohshall/3eac521b30c61e7486449b3978d3d35c to your computer and use it in GitHub Desktop.
unbind-key C-b
set -g prefix C-a
bind-key C-a send-prefix
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
set-option -g renumber-windows on
set -g mouse on
set -g set-clipboard on
# Scrollback buffer
set -g history-limit 10000
# reload configuration
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
## Clipboard integration
# ctrl+c to send to clipboard
bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"
# ctrl+v to paste from clipboard
bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
# Selection with mouse should copy to primary right away, in addition to the default action.
unbind -n -Tcopy-mode-vi MouseDragEnd1Pane
bind -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel\; run "tmux save-buffer - | xclip -i > /dev/null"
# Middle click to paste from the primary
unbind-key MouseDown2Pane
bind-key -n MouseDown2Pane run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer"
set-option -g automatic-rename on
set-option -g automatic-rename-format '#{b:pane_current_path}'
# allow for navigating between words with option
set-window-option -g xterm-keys on
# Set window notifications
set -g monitor-activity on
set -g visual-activity on
# Update files on focus (using for vim)
set -g focus-events on
set-option -sg escape-time 10
# tmux display things in 256 colors
# If ;checkhealth in nvim shows no errors, we are good.
set -g default-terminal "screen-256color"
set-option -sa terminal-overrides ',alacritty:RGB'
# status bar
set -g status-interval 2
# Make middle-mouse-click paste from the primary selection (without having to hold down Shift).
#bind-key -n MouseDown2Pane run "tmux set-buffer -b primary_selection \"$(xclip -o)\"; tmux paste-buffer -b primary_selection; tmux delete-buffer -b primary_selection"
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc"
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
set-environment -g COLORTERM "truecolor"
set -g window-status-format '#[bg=colour237,fg=#f8f8f2] #I: #W#F '
set -g window-status-current-format '#[bg=colour39,fg=black] #I: #W#F '
set -g status-left-length 40
set -g status-right-length 60
set -g status-position bottom
set -g status-fg white
set -g status-bg "colour234"
set -g status-left '#[fg=colour235,bg=colour252,bold] #S » #I #P '
set -g status-right '#[bg=colour252,fg=colour235,bold] %Y-%m-%d %H:%M:%S #[default]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment