Skip to content

Instantly share code, notes, and snippets.

@oca159
Last active March 1, 2026 04:36
Show Gist options
  • Select an option

  • Save oca159/69f7aab040d3f462cc26accabbd4ea67 to your computer and use it in GitHub Desktop.

Select an option

Save oca159/69f7aab040d3f462cc26accabbd4ea67 to your computer and use it in GitHub Desktop.
tmux
# Set terminal colors
set-option -sa terminal-overrides ",xterm*:Tc"
# Enable mouse support
set -g mouse on
# don't exit from tmux when closing a session
set -g detach-on-destroy off
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# kill pane
bind-key x kill-pane
# Pane resizing
bind -n M-h resize-pane -L
bind -n M-l resize-pane -R
bind -n M-k resize-pane -U
bind -n M-j resize-pane -D
# Move window to the left
bind -n M-i swap-window -t -1
# Move window to the right
bind -n M-o swap-window -t +1
# Set vi mode
set-window-option -g mode-keys vi
# Use visual selection mode as vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
# Save and restore session
set -g @resurrect-save 'S'
set -g @resurrect-restore 'R'
# Tmux theme
set -g @catppuccin_flavour 'mocha'
set -g @catppuccin_right_separator "█"
set -g @catppuccin_left_separator "█"
set -g @catppuccin_window_tabs_enabled "on"
TMUX_FZF_ORDER="session|window|pane|command|keybinding"
TMUX_FZF_OPTIONS="-p -w 90% -h 70% -m"
bind-key "T" run-shell "sesh connect \"$(
sesh list --icons | fzf-tmux -p 80%,70% \
--no-sort --ansi --border-label ' sesh ' --prompt '⚡ ' \
--header ' ^a all ^t tmux ^g configs ^x zoxide ^d tmux kill ^f find' \
--bind 'tab:down,btab:up' \
--bind 'ctrl-a:change-prompt(⚡ )+reload(sesh list --icons)' \
--bind 'ctrl-t:change-prompt(🪟 )+reload(sesh list -t --icons)' \
--bind 'ctrl-g:change-prompt(⚙️ )+reload(sesh list -c --icons)' \
--bind 'ctrl-x:change-prompt(📁 )+reload(sesh list -z --icons)' \
--bind 'ctrl-f:change-prompt(🔎 )+reload(fd -H -d 2 -t d -E .Trash . ~)' \
--bind 'ctrl-d:execute(tmux kill-session -t {2..})+change-prompt(⚡ )+reload(sesh list --icons)' \
--preview-window 'right:55%' \
--preview 'sesh preview {}'
)\""
# more options here: https://github.com/sainnhe/tmux-fzf/issues/6#issuecomment-578750879
# bind w run-shell -b "~/.config/tmux/plugins/tmux-fzf/scripts/window.sh switch"
# Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'dreamsofcode-io/catppuccin-tmux'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @resurrect-strategy-nvim 'session'
run '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment