Skip to content

Instantly share code, notes, and snippets.

@atomicstack
Created May 11, 2018 21:17
Show Gist options
  • Save atomicstack/55cd52438d6c8823e45026bd25bb024c to your computer and use it in GitHub Desktop.
Save atomicstack/55cd52438d6c8823e45026bd25bb024c to your computer and use it in GitHub Desktop.
tmux.conf
# Set the prefix to ^A.
unbind C-b
set -g prefix ^A
bind a send-prefix
# Bind appropriate commands similar to 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
bind-key j command-prompt -p "join pane from:" "join-pane -h -s ':%%'"
# bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'"
# next ^@ ^N sp n
unbind ^@
bind ^@ next-window
unbind ^N
bind ^N next-window
unbind " "
bind " " next-window
unbind n
bind n next-window
unbind N
bind N new-window -a
# 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"
unbind R
bind-key R source-file ~/.tmux.conf\; display-message "~/.tmux.conf is reloaded"
unbind &
bind & set-window-option synchronize-panes
# kill K k
unbind K
bind-key K confirm-before -p "kill-window #W? (y/n)" kill-window
unbind k
bind-key k confirm-before -p "kill-window #W? (y/n)" kill-window
# redisplay ^L l
unbind ^L
bind ^L refresh-client
# jump to last session
unbind l
bind l switch-client -l
# jump to last session
unbind L
bind-key L switch-client -l
unbind |
bind | split-window -h
unbind %
bind % split-window
unbind +
bind + run-shell $HOME/.tmux.d/tmux-create-tiled-layout
bind-key f command-prompt "find-window -N '%%'"
bind-key F command-prompt "find-window '%%'"
bind-key , command-prompt -p '(rename-window)' "rename-window '%%'"
bind-key . command-prompt -I '#I' -p '(move-window)' "move-window -t '%%'"
# :kB: focus up
# XXX broken? :(
# unbind ^I
# bind Tab down-pane
# unbind BTab
# bind BTab up-pane
# " windowlist -b
unbind '"'
bind '"' choose-window
unbind '<'
unbind '>'
bind-key '<' swap-window -t -1
bind-key '>' swap-window -t +1
unbind '{'
unbind '}'
bind-key '{' switch-client -p
bind-key '}' switch-client -n
unbind '('
unbind ')'
bind-key '(' swap-pane -U
bind-key ')' swap-pane -D
unbind '!'
bind-key '!' break-pane
bind-key C-O command-prompt -p ssh: "new-window -n %1 'tmux_sssh %1'"
# set-option -g aggressive-resize on
# set-window-option -g aggressive-resize on
# messages, input for ^A-:
set-option -g message-style fg=colour33
# default colors for status bar (session number, hostname, clock)
set-option -g status-fg yellow
set-option -g status-bg colour236
set-option -g status-left ''
set-option -g status-right "#[fg=$TMUX_HOST_COLOUR]$MY_HOSTNAME$SERVER_ROLE_PROMPT#[fg=default] #(nice $HOME/bin/generate_coloured_loadavg_persistently.pl) #[fg=colour40]%F #[fg=colour39]%T#[fg=default]"
set-option -g status-right-length 88
set-option -g status-interval 1
# panes (window splits)
set-option -g pane-border-fg colour236
set-option -g pane-active-border-fg colour33
# window names (kvmoff, kvmevent, ...)
set-window-option -g window-status-fg white
set-window-option -g window-status-bg colour236
# set-window-option -g window-status-attr dim
set-window-option -g window-status-current-fg colour33
set-window-option -g window-status-current-bg white
# set-window-option -g window-status-current-attr bright
# maybe this fixes weirdo vim fuckery with ^A?
set-option -g xterm-keys on
set-option -g default-terminal screen-256color
set-option -g mode-style "fg=colour255,bg=colour69"
# disable server locking
# set-option -g lock-server off
set-option -g history-limit 50000
bind-key H command-prompt -p 'save history to filename:' -I "~/tmux.%F-%T" 'capture-pane -S -50000 ; save-buffer %1 ; delete-buffer'
run-shell ~/.tmux.d/tmux-resurrect/resurrect.tmux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment