Skip to content

Instantly share code, notes, and snippets.

@gold24park
Created November 22, 2022 14:31
Show Gist options
  • Save gold24park/4524071d6fe87dfb22ccda4336d3316b to your computer and use it in GitHub Desktop.
Save gold24park/4524071d6fe87dfb22ccda4336d3316b to your computer and use it in GitHub Desktop.
tmux configuration
#set -g default-terminal "screen-256color"
#source-file "~/.tmux-current.conf"
#set-option -g default-shell /usr/bin/zsh
# prefix
set-option -g prefix C-'u'
#set-option -g prefix C-space
# escape
set -sg escape-time 5
# title
set-window-option -g automatic-rename on
set-option -g set-titles on
# history
set-option -g history-limit 10000
# save
#bind -n M-q send-keys "tmux show -g | sed 's/^/set-option -g /' > ~/.tmux-current.conf" C-m
# reload
bind-key r source-file "$ENVDIR/.tmux.conf"
bind -n M-r source-file "$HOME/.tmux.conf"
bind -n M-f source-file "$HOME/.tmux-home.conf"
# mouse
bind m \
set -g mouse on \;\
set -g mouse-select-pane on \;\
set -g mouse-select-window on \;\
display 'Mouse: ON'
bind M \
set -g mouse off \;\
set -g mouse-select-pane off \;\
set -g mouse-select-window off \;\
display 'Mouse: OFF'
# set -g mouse-resize-pane on \;\
# set -g mouse-resize-pane off \;\
# vi mode
setw -g mode-keys vi
#list-keys -t vi-copy
#bind-key -t vi-copy v begin-selection
#bind-key -t vi-copy y copy-selection
# activity window
#setw -g monitor-activity on
#setw -g window-status-activity-bg red
#setw -g window-status-activity-fg yellow
# window
bind c new-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
#set-window-option -g utf8 on
# Set status bar
#set -g status-bg dark-green
#set -g status-fg white
#set -g status-left '#[fg=blue]#H'
# Highlight active window
#set-window-option -g window-status-current-bg yellow
set -g window-status-current-style bg=yellow
bind < resize-pane -L 20
bind > resize-pane -R 20
bind -n M-D detach-client
bind -n M-'[' copy-mode
bind -n M-']' paste-buffer
bind -n M-':' command-prompt
bind j select-pane -D
bind k select-pane -U
bind h select-pane -L
bind l select-pane -R
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-h select-pane -L
bind -n M-l select-pane -R
bind J resize-pane -D 2
bind K resize-pane -U 2
bind H resize-pane -L 2
bind L resize-pane -R 2
bind -n M-J resize-pane -D 2
bind -n M-K resize-pane -U 2
bind -n M-H resize-pane -L 2
bind -n M-L resize-pane -R 2
bind o last-pane
bind -n M-o last-pane
bind p previous-window
bind n next-window
bind -n M-p previous-window
bind -n M-n next-window
bind c new-window -c "#{pane_current_path}"
bind -n M-'c' new-window -c "#{pane_current_path}"
bind -n M-Left previous-window
bind -n M-Right next-window
bind -n M-P previous-window
bind -n M-N next-window
bind -n M-O last-window
bind -n M-'s' split-window -v -c "#{pane_current_path}"
bind -n M-'v' split-window -h -c "#{pane_current_path}"
bind -n M-'{' swap-pane -U
bind -n M-'}' swap-pane -D
#bind -n M-'t' swap-window -t 0
bind -n M-S-Left swap-window -t -1\; select-window -t -1
bind -n M-S-Right swap-window -t +1\; select-window -t +1
bind -n M-'z' resize-pane -Z
#bind -n M-'w' choose-tree -u
bind -n M-'w' choose-tree
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment