tmux.conf

#63
Raw
Author
winny
Created
Sept. 10, 2020, 10:26 p.m.
Expires
Never
Size
2.3 KB
Hits
179
Syntax
None
# tmux.conf

# Emacs keys
set -g mode-keys emacs

set -g mouse off

# Appearance of bar
set -g status-justify left # default
set -g status-left '#{=10:session_name}@#{=10:host_short} #{?#{!=:#{selection_present},},#[bg=yellow]#[align=centre] COPY MODE ,}'
set -g status-left-length 30
set -g status-right ''

set -g status-right-length 50
set -g window-status-current-format "(#I:#W#F)"

# XXX
#set -g status-style 'bg=#{?#{!=:#{selection_present},},yellow,blue},fg=black'

set -g status-justify right

# XTerm titles
set -g set-titles on
set -g set-titles-string "#{session_name}@#{host_short}: #{pane_title}"

# Set terminal appropriately. May need to change this for hosts that
# don't install all the terminfo from ncurses.
set -g default-terminal "tmux-256color"

set-option -g history-limit 5000

# Use Control-t to send commands to tmux
unbind C-b
set -g prefix C-t
bind C-t send-prefix

# See for more info:
# https://superuser.com/questions/470130/tmux-prompt-to-select-window-for-join-pane-while-still-seeing-window-numbers-an
bind < split-window -h \; choose-window 'kill-pane ; join-pane -hs %%'

bind o select-pane -t :.+
bind O select-pane -t :.-

# bind j select-pane -D
# bind k select-pane -U
# bind h select-pane -L
# bind l select-pane -R

bind | split-window -h
bind - split-window -v

bind l last-pane
bind L last-window

# bind -r J resize-pane -D 5
# bind -r K resize-pane -U 5
# bind -r H resize-pane -L 5
# bind -r L resize-pane -R 5

# source .tmux.conf file
bind r source-file ~/.tmux.conf \; display "Configuration Reloaded!"

# switch between sessions
bind -r ( switch-client -p
bind -r ) switch-client -n

# copy to system clipboard
bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"

# paste from system clipboard
bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"

# Better indication of current pane
set -g pane-border-style fg=green
set -g pane-active-border-style bg=green,fg=green
#set -g status-style bg=green,fg=black

# Number windows & panes from one, not zero
set -g base-index 1
setw -g pane-base-index 1

# Via https://unix.stackexchange.com/a/10259/59894
bind-key H pipe-pane "exec cat >>$HOME/'#W-tmux.log'" \; display-message 'Started logging to $HOME/#W-tmux.log'
bind-key h pipe-pane \; display-message 'Ended logging to $HOME/#W-tmux.log'