# ~/.config/tmux/tmux.conf, or .dotfiles/config/tmux/tmux.conf # # Contains configuration from the follwing sources: # - https://tmuxguide.readthedocs.io/en/latest/tmux/tmux.html # - https://github.com/dreamsofcode-io/tmux/blob/main/tmux.conf # ╭──────────────────────────────────────────────────────────╮ # │ Bindings │ # ╰──────────────────────────────────────────────────────────╯ # Set to Control + Space unbind C-b set -g prefix C-Space bind C-Space send-prefix # Vim style pane selection bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R # Use Alt-arrow keys without prefix key to switch panes bind -n M-Left select-pane -L bind -n M-Right select-pane -R bind -n M-Up select-pane -U bind -n M-Down select-pane -D # Control-Tab & Control-Shift-Tab to switch windows bind -n C-Tab previous-window bind -n C-S-Tab next-window # Reload tmux config with + r bind r source-file ~/.dotfiles/config/tmux/tmux.conf \; display "tmux cfg reloaded!" # Open a new window with + N bind N new-window # Set default directory for new windows in this session to current directory: bind M-c attach-session -c "#{pane_current_path}" # Open a new window in the current directory bind C new-window -c "#{pane_current_path}" # 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 '"' split-window -v -c "#{pane_current_path}" bind '!' split-window -h -c "#{pane_current_path}" # synchronize all panes in a window bind y setw synchronize-panes #### copy mode : vim #### # copy mode using 'Esc' unbind [ bind Escape copy-mode # start selection with 'space' and copy using 'y' #bind -t vi-copy 'y' copy-selection # paste using 'p' unbind p bind p paste-buffer # ╭──────────────────────────────────────────────────────────╮ # │ Settings │ # ╰──────────────────────────────────────────────────────────╯ # Expose window title set-option -g set-titles on # Mouse support set -g mouse on # Make delay shorter set -sg escape-time 0 # 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 # set vi-mode set-window-option -g mode-keys vi # Set theme to tokyonight source-file ~/.dotfiles/config/tmux/tokyonight_storm.tmux # ╭──────────────────────────────────────────────────────────╮ # │ Plugins related configurations │ # ╰──────────────────────────────────────────────────────────╯ # Plugin that lets you suspend local tmux session, # so that you can work with nested remote tmux session painlessly. # https://github.com/MunifTanjim/tmux-suspend set -g @suspend_key 'F12' ## A plugin to name your tmux windows smartly. ## https://github.com/ofirgall/tmux-window-name ### Maximum name length of a window set -g @tmux_window_name_max_name_len "30" ### Replace $HOME with ~ in window names set -g @tmux_window_name_use_tilde "True" ## https://github.com/tmux-plugins/tmux-continuum set -g @continuum-restore 'on' set -g @continuum-boot 'on' set -g @continuum-boot-options 'alacritty' ## https://github.com/tmux-plugins/tmux-resurrect set -g @resurrect-strategy-nvim 'session' set -g @resurrect-dir '$HOME/.local/state/tmux/tmux-resurrect' # Modified from tokyonight_storm to include tmux_mode_indicator set -g status-right "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#1f2335] #{prefix_highlight} #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d  %H:%M #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#1d202f,bg=#7aa2f7,bold] #h #{tmux_mode_indicator}" # ╭──────────────────────────────────────────────────────────╮ # │ Plugins │ # ╰──────────────────────────────────────────────────────────╯ run-shell ~/.dotfiles/config/tmux/plugins/tmux-sensible/sensible.tmux run-shell ~/.dotfiles/config/tmux/plugins/tmux-resurrect/resurrect.tmux run-shell ~/.dotfiles/config/tmux/plugins/tmux-continuum/continuum.tmux run-shell ~/.dotfiles/config/tmux/plugins/tmux-sessionist/sessionist.tmux run-shell ~/.dotfiles/config/tmux/plugins/tmux-mode-indicator/mode_indicator.tmux run-shell ~/.dotfiles/config/tmux/plugins/tmux-suspend/suspend.tmux run-shell ~/.dotfiles/config/tmux/plugins/tmux-yank/yank.tmux run-shell ~/.dotfiles/config/tmux/plugins/tmux-window-name/tmux_window_name.tmux