Last active
March 10, 2022 15:27
-
-
Save jsvazic/199fdf8819fb6fe6a4ea1ad7fdfb21dc to your computer and use it in GitHub Desktop.
My .tmux.conf file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set prefix to Ctrl-a | |
set-option -g prefix C-a | |
unbind C-a | |
bind-key C-a send-prefix | |
# Use Alt-arrow keys 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 | |
# Use Shift-arrow to switch windows | |
bind -n S-Left previous-window | |
bind -n S-Right next-window | |
# vi mode | |
set-window-option -g mode-keys vi | |
# Mouse mode | |
set -g mouse on | |
# Set easier window split keys | |
bind-key v split-window -h -c "#{pane_current_path}" | |
bind-key h split-window -v -c "#{pane_current_path}" | |
bind-key c new-window -c "#{pane_current_path}" | |
# Easier config reload | |
bind-key r source-file ~/.tmux.conf \; display-message "tmux.conf reloaded." | |
# Lots of history | |
set-option -g history-limit 10000 | |
# Status bar settings | |
set-option -g status on | |
set-option -g status-interval 2 | |
set-option -g status-right-length 50 | |
set -g status-right "#([ -d /proc/sys/net/ipv4/conf/tun0 ] && echo \"$({ ip -4 -br a sh dev tun0 | awk {'print $3'} | cut -f1 -d/; } 2>/dev/null) 🬄 \")#{pane_width}x#{pane_height} 🬄 %a %Y-%m-%d %H:%M" |
Added the pane dimensions to the right status bar settings to make things easier when determining dimensions to set for PTTY sessions, etc.
Added a decent history-limit
setting and adjusted the status-right-length
to something reasonable.
Added vi mode for easier selecting of text for large blocks.
Added code to change the background colour of panes that are not in focus, to better indicate what's currently in use.
Removed the lines for background colours as they didn't work, and added some config setup to keep the current path when splitting panes or creating new windows.
Updated the status bar to include some separators as well as the IP for a tun0 interface, i.e. VPN for TryHackMe, etc.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After the
TERM
setting, add this to .bashrc:This will start
tmux
automatically when a terminal is created.