Skip to content

Instantly share code, notes, and snippets.

@FINCTIVE
Created Oct 2, 2021
Embed
What would you like to do?
my tmux conf 2021-10
# NOTE: tmux will reload files when ALL the tmux panes are closed!
# please use this shortcut to config tmux
bind r source-file ~/.tmux.conf
unbind C-b
set-option -g prefix C-j
bind-key C-j send-prefix
# reference: https://gist.github.com/spicycode/1229612
# Set new panes to open in current directory
bind-key | split-window -h -c "#{pane_current_path}"
bind-key - split-window -v -c "#{pane_current_path}"
# 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
bind -n M-c new-window -c "#{pane_current_path}"
bind -n M-n previous-window
bind -n M-p next-window
# No delay for escape key press
set -sg escape-time 0
# copy selected text
# and drag panes with mouse
set-option -g mouse on
# use only tmux buffer (`ctrl+b ]`) to paste
# default option is : copy-selection-and-cancel, which will scroll to the bottom
# bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-selection
# use system clipboard(dependency: xclip)
# there is no output if xclip is not a valid command(other os)
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "xclip -se c -i"
# press y to copy
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
set -g status-keys vi
setw -g mode-keys vi
set -g history-limit 10000
setw -g monitor-activity on
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
# correct color
set -g terminal-overrides ",xterm-256color:Tc"
set -g default-terminal screen-256color
# theme(copied from nord tmux theme plugin)
# Colors
# set -g status-bg default
set-option -g status-style bg=default
# set -g status-bg colour235
set -g status-fg white
# Panes
set -g pane-border-style bg=black
set -g pane-border-style fg=black
set -g pane-active-border-style bg=black
set -g pane-active-border-style fg=brightblack
set -g display-panes-colour black
set -g display-panes-active-colour brightblack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment