Skip to content

Instantly share code, notes, and snippets.

@marcelocra
Created March 30, 2015 01:33
Show Gist options
  • Save marcelocra/36f235a1984f8b0ce0de to your computer and use it in GitHub Desktop.
Save marcelocra/36f235a1984f8b0ce0de to your computer and use it in GitHub Desktop.
Tmux basic configuration
# Set Ctrl-a as the default prefix key combination and unbind Ctrl-b.
set -g prefix C-a
unbind C-b
# Change default delay time.
set -sg escape-time 1
# Change base index to 1 (in status bar and panes).
set -g base-index 1
setw -g pane-base-index 1
# Reload the configuration file.
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Use send-prefix to pass C-a through to application.
bind C-a send-prefix
# Use PREFIX '|' to split window horizontally and PREFIX '-' to split vertically.
bind | split-window -h
bind - split-window -v
# Map VIM movement keys as pane movement keys.
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Use C-h and C-l to cycle through panes.
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# Resize panes using PREFIX H, J, K, L.
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# Explicitly enable/disable mouse control (only the first one is necessary
# to disable the mouse. The others are necessary to enable things).
setw -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
# Set default terminal to use all available colors (options: xterm, screen, etc.).
set -g default-terminal "screen-256color"
# Set color for status bar.
set -g status-bg cyan
set -g status-fg black
# Set status for inactive window.
setw -g window-status-fg black
setw -g window-status-bg default
setw -g window-status-attr dim
# Set style for active window.
setw -g window-status-current-fg black
setw -g window-status-current-bg white
setw -g window-status-current-attr bright
# Configure pane border colors settings.
set -g pane-border-fg white
set -g pane-border-bg black
set -g pane-active-border-fg brightred
set -g pane-active-border-bg black
# Change tmux command line colors.
set -g message-fg white
set -g message-bg black
set -g message-attr bright
# Change status line settings.
set -g status-left-length 40
set -g status-left "#[fg=black][#S]" # Show session name.
set -g status-right "#[fg=black]%d %b %R" # Show time.
# Accept unicode chars in status bar.
set -g status-utf8 on
# Frequency to refresh status bar (in seconds).
set -g status-interval 60
# Center window list.
set -g status-justify centre
# Visual notification of activity in other windows.
setw -g monitor-activity on
set -g visual-activity on
# Use UTF8.
set -g utf8
setw -g utf8 on
# Set scrollback history to 10000 lines.
set -g history-limit 10000
# Make the current window the first window.
bind T swap-window -t 1
# Use VIM keybindings in copy mode.
setw -g mode-keys vi
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
bind -t vi-copy 'V' rectangle-toggle
# Create a session.
new -s work -n bash
#splitw -h
# neww -n git
# neww -n repl
# neww -n server
# neww -n test
# selectw -t 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment