Skip to content

Instantly share code, notes, and snippets.

@elulcao
Last active May 27, 2023 03:31
Show Gist options
  • Save elulcao/bb35f169bbaf05a57c63c45c81d3aa54 to your computer and use it in GitHub Desktop.
Save elulcao/bb35f169bbaf05a57c63c45c81d3aa54 to your computer and use it in GitHub Desktop.
tmux.conf favorite config
# Initial setup
unbind C-b # remap prefix from 'C-b' to 'C-a'
set -g prefix C-Space
bind-key C-Space send-prefix
set -g mouse on # toggle mous
set -g mode-keys vi # Use Vi key bindings instead of emacs.
set -g status-keys vi
set -g base-index 1 # start window numbering at 1
set -g pane-base-index 1 # start pane numbering at 1
set -g renumber-windows on # renumber windows when a window is closed
set -g set-titles on # set terminal title
set -g set-titles-string '#T'
set -g status-interval 10 # redraw status line every 11 seconds
set -g focus-events on
set -g history-limit 9999
set -g default-shell $SHELL
set -g default-terminal "screen-256color" # set terminal type to 256 color
set -ga terminal-overrides ",xterm*:Tc" # tell Tmux that outside terminal supports true color
unbind -T copy-mode-vi MouseDragEnd1Pane # copy mode
bind e new-window -n '~/.tmux.conf' "sh -c '\${EDITOR:-vim} ~/.tmux.conf && tmux source ~/.tmux.conf'" # edit configuration
bind s choose-tree -s -O name # search session by
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
bind '"' split-window -v -c "#{pane_current_path}" # PWD aware split
bind % split-window -h -c "#{pane_current_path}" # PWD aware split
bind C-c new-session # create session
bind C-l send-keys 'C-l' # clear screen
bind C-p previous-window # previous window
bind C-n next-window # next window
bind -n M-g display-popup -E "tmux new-session -A -s scratch" # create floating window
# keybindings
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
bind-key C-m set-option -g mouse \; display-message 'Mouse #{?mouse,on,off}'
bind-key r source-file ~/.tmux.conf \; display-message "tmux.conf reloaded" # reload config file
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'dracula/tmux'
# set -g @plugin 'catppuccin/tmux'
# Plugin conf
set -g @continuum-boot 'off'
set -g @continuum-restore 'on'
set -g @continuum-save-interval '60'
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-strategy-nvim 'session'
set -g @dracula-show-powerline true
set -g @dracula-show-flags true
set -g @dracula-refresh-rate 5
set -g @dracula-show-left-icon session
set -g @dracula-left-icon-padding 1
set -g @dracula-border-contrast true
set -g @dracula-plugins "cpu-usage ram-usage battery"
set -g @dracula-ram-usage-label "RAM"
set -g @dracula-cpu-usage-label "CPU"
set -g @dracula-show-empty-plugins false
set -g @dracula-show-location false
# set -g @catppuccin_flavour "mocha"
# set -g @catppuccin_host "off"
# set -g @catppuccin_right_separator ""
# set -g @catppuccin_left_separator ""
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment