Skip to content

Instantly share code, notes, and snippets.

@mohclips
Created June 5, 2020 22:32
Show Gist options
  • Save mohclips/01805230ad0014dfdf6343fdfb879bff to your computer and use it in GitHub Desktop.
Save mohclips/01805230ad0014dfdf6343fdfb879bff to your computer and use it in GitHub Desktop.
tmux settings
#picked these up somewhere a long time back
# Tmux settings
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
# Enable mouse control (clickable windows, panes, resizable panes)
set -g mouse-select-window on
set -g mouse-select-pane on
set -g mouse-resize-pane on
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
# Set XTerm key bindings
setw -g xterm-keys on
# Set colors
set-option -g default-terminal "screen-256color"
# Set reload key to r
bind r source-file ~/.tmux.conf
# Count sessions start at 1
set -g base-index 1
# Use vim bindings
setw -g mode-keys vi
# Remap window navigation to vim
unbind-key j
bind-key j select-pane -D
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
bind-key l select-pane -R
# switch panes using Alt-arrow without prefix
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
# Set the title bar
set -g set-titles on
set -g set-titles-string '#(whoami) :: #h :: #(curl ipecho.net/plain;echo)'
# Set status bar
set -g status-utf8 on
set -g status-bg black
set -g status-fg white
set -g status-interval 5
set -g status-left-length 90
set -g status-right-length 60
set -g status-left "#[fg=Green]#(whoami)#[fg=white]::#[fg=blue]#(hostname -s)#[fg=white]::#[fg=yellow]#(curl ipecho.net/plain;echo)"
set -g status-justify left
set -g status-right '#[fg=Cyan]#S #[fg=white]%a %d %b %R'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment