Files
dotfiles/tmux/.tmux.conf

240 lines
6.1 KiB
Bash

# tmux settings
# http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/tmux.1#x4f5054494f4e53
# ----------------------------------------------------------------------
# | General Settings |
# ----------------------------------------------------------------------
# Make a new session, all you need is to run tmux a all the time then
new-session
# Make window index start at 1
set -g base-index 1
# Make pane index start at 1
setw -g pane-base-index 1
# Remove delay when sending commands
# (default is 500 milliseconds)
set -sg escape-time 1
# If you want to enable mouse scrolling & cut-n-paste, uncomment the following:
#set -g mouse on
#bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
#bind -n WheelDownPane select-pane -t= \; send-keys -M
#bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
#bind -t vi-copy C-WheelUpPane halfpage-up
#bind -t vi-copy C-WheelDownPane halfpage-down
#bind -t emacs-copy C-WheelUpPane halfpage-up
#bind -t emacs-copy C-WheelDownPane halfpage-down
set -g history-limit 30000
# ----------------------------------------------------------------------
# | Key Mappings |
# ----------------------------------------------------------------------
# Change the key combination for the PREFIX key to `ctrl-a`
set -g prefix C-a
unbind-key C-b
# Make tmux send the PREFIX to an application running
# within tmux simply by pressing PREFIX key twice
bind C-a send-prefix
bind a send-prefix
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Remap the copy & paste keys to work as in vim
unbind [
bind Escape copy-mode
# use P instead of p because of screen compatibility
unbind P
bind P paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# [ PREFIX + - ] Split window horizontally
bind - split-window -v
# [ PREFIX + | ] Split window vertically
bind | split-window -h
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# [ PREFIX + h/j/k/l ] Move from pane to pane
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# [ PREFIX + H/J/K/L ] Resize pane
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
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# [ PREFIX + r ] Reload tmux config
bind r source-file ~/.tmux.conf \; display 'tmux configs reloaded'
# ----------------------------------------------------------------------
# | Status bar |
# ----------------------------------------------------------------------
# Notified when something happens in one of the other windows
#setw -g monitor-activity on
#set -g visual-activity on
# Periodically refresh the status bar
set -g status-interval 60
# Turn on UTF-8 support
set -g status-utf8 on
# Customize what is displayed
set -g status-justify left
set -g status-left-length 50
set -g status-left " %R | "
# └─ current time
set -g status-right " #S "
# └─ current session name
# ----------------------------------------------------------------------
# | Visual Styling |
# ----------------------------------------------------------------------
# Display things in 256 colors
set -g default-terminal 'screen-256color'
# Solarized theme
#### COLOUR (Solarized 256)
# default statusbar colors
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244 #base0
set-window-option -g window-status-bg default
#set-window-option -g window-status-attr dim
# active window title colors
set-window-option -g window-status-current-fg colour166 #orange
set-window-option -g window-status-current-bg default
#set-window-option -g window-status-current-attr bright
# pane border
set-option -g pane-border-fg colour235 #base02
set-option -g pane-active-border-fg colour240 #base01
# message text
set-option -g message-bg colour235 #base02
set-option -g message-fg colour166 #orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour colour64 #green
# bell
# compatiblity with older tmux versions
#set-window-option -g window-status-bell-style fg=colour235,bg=colour160 #base02, red
# ----------------------------------------------------------------------
# | Compatiblity with screen |
# ----------------------------------------------------------------------
# lockscreen ^X x
unbind ^X
bind ^X lock-server
unbind x
bind x lock-server
# screen ^C c
unbind ^C
bind ^C new-window
unbind c
bind c new-window
# detach ^D d
unbind ^D
bind ^D detach
# displays *
unbind *
bind * list-clients
# next ^@ ^N sp n
unbind ^@
bind ^@ next-window
unbind ^N
bind ^N next-window
unbind " "
bind " " next-window
unbind n
bind n next-window
# title A
unbind A
bind A command-prompt "rename-window %%"
# other ^A
unbind ^A
bind ^A last-window
# prev ^H ^P p ^?
unbind ^H
bind ^H previous-window
unbind ^P
bind ^P previous-window
unbind p
bind p previous-window
unbind BSpace
bind BSpace previous-window
# windows ^W w
unbind ^W
bind ^W list-windows
unbind w
bind w list-windows
# quit \
unbind '\'
bind '\' confirm-before "kill-server"
# kill K k
unbind K
bind K confirm-before "kill-window"
unbind k
bind k confirm-before "kill-window"
# redisplay ^L l
unbind ^L
bind ^L refresh-client
unbind l
bind l refresh-client
# :kB: focus up
unbind Tab
bind Tab select-pane -t:.+
unbind BTab
bind BTab select-pane -t:.-
# " windowlist -b
unbind '"'
bind '"' choose-window