Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
235 lines (175 sloc) 9.18 KB
##############################################################################
# tmux(1) configuration file. ┌─┬─┐ #
# Made for tmux 2.7 or highter │ ├─┤ #
# MacLemon, https://maclemon.at/ └─┴─┘ #
##############################################################################
# Command keys are case-sensitive.
# Prefix Key
# Default: C-b
# C-b is inconvenient to reach on the keyboard and also vim uses it.
# This frees the key for other functions
unbind-key C-b
# C-y is very convenient to reach on a german keyboard, YMMV.
# I don't like to use C-a because it's a readline binding to go to the
# beginning of the line.
set-option -g prefix C-y
# secondary Prefix key
#set-option -g prefix2 C-b
# To quickly toggle between the last two windows, set the last-window command
# to the same key as the $PREFIX.
bind-key C-y last-window
# Allows us to use PREFIX <character> <command> to send commands to a tmux(1)
# session inside another tmux(1) session. (eg:Nesting a remote tmux(1)
# session over ssh(1) in your local tmux(1) session.
# I keep this the same character as PREFIX but without the control key.
bind-key y send-prefix
# Set the command sending delay to 0. Makes everything more responsive and
# longer delays may interfere with command line tools like vim(1).
set -sg escape-time 1
##############################################################################
# Status line
##############################################################################
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ ┃
# ┃ ┃
# ┃ ┃
# ┃ ┃
# ┃ ┃
# ┃ ┃
# ┃ ┃
# ┃ ┃
# ┃ ┃
# ┃host │ 1 window │ 2 window │ host.example.com HH:MM 2018-07-04 👻 ┃
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
# Position of the status line
set-option -g status-position bottom # top | bottom
# Update the status line every n-seconds.
set -g status-interval 30
# Keep the window list left-aligned
set -g status-justify left
# Set status bar (can only be a single line high)
# Set status bar background color,foreground color
set -g status-style bg=blue,fg=white
# Set maximum length of the left status area (in characters)
set-option -g status-left-length 50
# Set maximum length of the right status area (in characters)
set-option -g status-right-length 60
# Left status bar contents and functionality:
# When status info doesn't fit within status-left-length it gets cut off,
# when it is shorter, the status area is just shorter.
set -g status-left "#{?client_prefix,#[reverse]#[fg=brightyellow]#S#[noreverse],#[fg=brightyellow]#S}#[fg=brightwhite]#[fg=default]│"
# #{?client_prefix,#[reverse]#[fg=brightyellow]
# Invert the left-status area when PREFIX has been detected to indicate
# that the next keystroke goes to tmux(1). Handy with nested sessions.
# Uses green text on status-bg color (set above).
# Uses yellow highlight to indicate prefix, since all status messages
# and the command-prompt of tmux are yellow as well.
# #S#[noreverse],#[fg=brightyellow]#S}
# Displays the current Session name in yellow on status-bg color.
# #[fg=default]%H:%M #[fg=default]│"
# Displays a space character the system time in HH:MM format.
# Right status bar contents and functionality:
set -g status-right " #[fg=brightgreen]#H#[fg=white]│%H:%M %Y-%m-%d#{?client_utf8, 👻 ,}"
# #[fg=brightgreen]#H
# Displays the full hostname.example.com in green on default background.
# followed by a space to separate from the following text.
# #[fg=white] %Y-%m-%d#{?client_utf8, 👻 ,}"
# Displays the date in ISO8601 format and an emoji (because my Terminal can,
# If your terminal cannot display UTF-8 it will put nothing there.).
# Highlight active window
set-window-option -g window-status-current-bg brightgreen
set-window-option -g window-status-current-fg black
set-window-option -g window-status-current-attr bright
# Very subtle hint which was your last active window for easy switching
# back and forth between two windows
set-window-option -g window-status-last-style "fg=brightyellow"
# Character that separats windows from each other in the status bar.
# this is not a pipe | but a box drawing character │ U-2502
set-window-option -g window-status-separator │
# Lengthen the amount of time status messages are displayed
set-option -g display-time 2000
set-option -g display-panes-time 3000
########################################
# Window handling and Session nesting. #
########################################
# Start numbering windows and panes at index 1
# Because that's how numbers are layed out on the keyboard
# Makes for an idiomatic spacial layout cue.
#
# ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬──────┐
# │ ^ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ? │ ´ │ Bspc │
# └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴──────┘
# Window indexing begins at 1 (not 0)
set -g base-index 1
# For consistency pane indexing begins at 1 as well.
set-window-option -g pane-base-index 1
# Make 0 accesss window 10, since we are 1 based, this follows the order of
# the number keys from left to right
unbind 0
bind-key 0 select-window -t :10
# Window activity monitor
# Turns on activity monitoring (aka if there is output)
setw -g monitor-activity on
# Visually marks windows with unread output
set -g visual-activity on
# Display the Clock in amber colour
set-window-option -g clock-mode-colour yellow
# Use 24h format, everything else doesn't make sense.
set-window-option -g clock-mode-style 24
# Keeps tmux from auto renaming windows
set-option -g allow-rename off
###############################################################
# Panes
###############################################################
# ┌───┐ Splitting windows into panes with memorizable commands
# ┝━━━┥ A vertical split positions panes up and down.
# └───┘ Think of PREFIX - as the separating line.
unbind '"'
bind-key - split-window -v
# ┌─┰─┐ Splitting windows into panes with memorizable commands
# │ ┃ │ A horizontal split positions panes left and right.
# └─┸─┘ Think of PREFIX | (pipe symbol) as the separating line.
unbind %
bind-key | split-window -h
# You can move between panes using PREFIX arrow keys
# You can move between panes using vim motion commands
# You can repeat these keys.
bind-key -r h select-pane -L
bind-key -r j select-pane -D
bind-key -r k select-pane -U
bind-key -r l select-pane -R
bind-key -r S-Left select-pane -L
bind-key -r S-Down select-pane -D
bind-key -r S-UP select-pane -U
bind-key -r S-Right select-pane -R
# You can resize panes using PREFIX SHIFT arrow keys
# You can resize panes using vim motion commands in CAPS
# You can repeat these keys.
bind-key -r H resize-pane -L
bind-key -r J resize-pane -D
bind-key -r K resize-pane -U
bind-key -r L resize-pane -R
bind-key -r S-Left resize-pane -L
bind-key -r S-Down resize-pane -D
bind-key -r S-UP resize-pane -U
bind-key -r S-Right resize-pane -R
# Split Highlighting
set-option -g pane-border-fg brightblack
set-option -g pane-active-border-fg blue
#####################################################
# Handling Mouse events like clicking, dragging and scrolling
# Activate mouse event supportin tmux.
set -g mouse on
#" sane scrolling:
bind-key -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"
#####################################################
# for vim
set-window-option -g xterm-keys on
# Options
set-option -g status-keys vi
# Tell the terminal that we can use 256 colours.
set -g default-terminal "xterm-256color"
# Reload config with capital R
bind-key R source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded."
##############################################################
# EOF
You can’t perform that action at this time.