# Change command key binding unbind C-b set -g prefix C-t # Ensure you can send C-t to the terminal via C-t C-t bind C-t send-prefix # fix the escape key delay set -s escape-time 0 # Make new tmux panes and windows go to the same directory as current window | pane # splitting panes with | and - # This is more logical than the " and % bind c new-window -c "#{pane_current_path}" bind - split-window -c "#{pane_current_path}" bind | split-window -h -c "#{pane_current_path}" # "It causes tmux to resize a window based on the smallest client actually viewing it, not on the smallest one attached to the entire session." # Source: https://wiki.archlinux.org/index.php/Tmux#Start_tmux_on_every_shell_login setw -g aggressive-resize on # Set default shell # set-option -g default-shell /bin/zsh # Force tmux to use 256 colors so that vim works properly with tmux # This also ensures that italics works normally # source: https://rsapkf.netlify.app/blog/enabling-italics-vim-tmux set -g default-terminal "tmux-256color" # Force utf-8 # Source: https://github.com/gpakosz/.tmux/blob/master/.tmux.conf set -q -g status-utf8 on setw -q -g utf8 on # reload configuration when you use C-r # Source: https://github.com/gpakosz/.tmux/blob/master/.tmux.conf bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced' # C-e: edit configuration # Source: https://github.com/gpakosz/.tmux/blob/master/.tmux.conf bind e new-window -n "~/.tmux.conf" "sh -c '\${EDITOR:-vi} ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display \"~/.tmux.conf sourced\"'" # Enable mouse support set -g mouse on # Make window index start with 1 instead of 0, like most window managers # source: https://mutelight.org/practical-tmux set -g base-index 1 # Set the base index for panes to 1 instead of 0 setw -g pane-base-index 1 # Make windows resize to the active window not the smallest window # source: https://mutelight.org/practical-tmux setw -g aggressive-resize on # set the status line's colors set -g status-style fg=black,bg=white # set the color of the window list setw -g window-status-style fg=black,bg=white # set colors for the active window setw -g window-status-current-style fg=black,bg=cyan # Command / message line setw -g message-style fg=black,bold,bg=white # Status line right side - 50% | 31 Oct 13:37 set -g status-right " #[fg=black, bold][%Y-%m-%d %R]" # Kill window bind k kill-window # Additional map to open 10th window bind 0 select-window -t 10 # Use vim style copy mode by default set-window-option -g mode-keys vi # Use vim style select and copy in copy mode bind-key -T copy-mode-vi 'v' send -X begin-selection bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel # Paste tmux copy buffer data into Linux copy buffer bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xsel -ib' # pane movement # source: http://unix.stackexchange.com/questions/14300/ddg#14301 bind-key S command-prompt -p "join pane from:" "join-pane -s '%%'" bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'" # move cursor to different windows bind-key j select-pane -D bind-key c-j select-pane -D bind-key k select-pane -U bind-key c-k select-pane -U bind-key l select-pane -R bind-key c-l select-pane -R bind-key h select-pane -L bind-key c-h select-pane -L # last window bind-key b last-window # kill window using X, just as you kill pane using x bind-key X kill-window # use clipboard? set -s set-clipboard on