Skip to content

Instantly share code, notes, and snippets.

@arsaccol
Last active September 1, 2022 17:09
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 arsaccol/ee2ddd7ffb19676720053fa13dbb98a4 to your computer and use it in GitHub Desktop.
Save arsaccol/ee2ddd7ffb19676720053fa13dbb98a4 to your computer and use it in GitHub Desktop.
Very comfy tmux
# Blessed C-a instead of C-b
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# press "prefix, r" to reload config
bind r source-file ~/.tmux.conf
# press alt-c to create window
bind -n M-c new-window
# press "alt-," to rename window
bind -n M-, command-prompt -I "#W" "rename-window '%%'"
# alt-v, alt-s to split: like vim split and vsplit
bind -n M-s split-window
bind -n M-v split-window -h
# open find-window with alt-w without prefix
bind -n M-w choose-window -Z
# switch to session with alt-number
bind -r M-0 choose-session -t 0
bind -r M-1 choose-session -t 1
bind -r M-2 choose-session -t 2
bind -r M-3 choose-session -t 3
bind -r M-4 choose-session -t 4
bind -r M-5 choose-session -t 5
bind -r M-6 choose-session -t 6
bind -r M-7 choose-session -t 7
bind -r M-8 choose-session -t 8
bind -r M-9 choose-session -t 9
# vim-like pane resizing
bind -r C-k resize-pane -U
bind -r C-j resize-pane -D
bind -r C-h resize-pane -L
bind -r C-l resize-pane -R
# vim-like pane switching
bind -r k select-pane -U
bind -r j select-pane -D
bind -r h select-pane -L
bind -r l select-pane -R
# vim-like pane switching without tmux prefix using alt key
bind -n M-k select-pane -U
bind -n M-j select-pane -D
bind -n M-h select-pane -L
bind -n M-l select-pane -R
# move to next and previous windows without tmux prefix using alt key
bind -n M-n next-window
bind -n M-p previous-window
# and now unbind keys
unbind Up
unbind Down
unbind Left
unbind Right
unbind C-Up
unbind C-Down
unbind C-Left
unbind C-Right
set-option -g set-titles on
set-window-option -g aggressive-resize
#set-window-option -g mode-keys vi
set -g mouse on
#source ~/.tmux.style.conf
#source ~/.tmux-tokyo-night/tokyonight.tmuxtheme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment