Skip to content

Instantly share code, notes, and snippets.

@groteck
Last active March 30, 2017 16:54
Show Gist options
  • Save groteck/3341700 to your computer and use it in GitHub Desktop.
Save groteck/3341700 to your computer and use it in GitHub Desktop.
my tmux configuration
# $Id: screen-keys.conf,v 1.7 2010/07/31 11:39:13 nicm Exp $
#
# By Nicholas Marriott. Public domain.
#
# This configuration file binds many of the common GNU screen key bindings to
# appropriate tmux key bindings. Note that for some key bindings there is no
# tmux analogue and also that this set omits binding some commands available in
# tmux but not in screen.
#
# Note this is only a selection of key bindings and they are in addition to the
# normal tmux key bindings. This is intended as an example not as to be used
# as-is.
# Set the prefix to ^A.
unbind C-b
set -g prefix ^A
bind a send-prefix
# Disable timeout for escape key
set-option -sg escape-time 0
# 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
#bind 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
# split -v |
unbind |
bind | split-window
# :kB: focus up
unbind Tab
bind Tab select-pane -t:.+
unbind BTab
bind BTab select-pane -t:.-
# " windowlist -b
unbind '"'
bind '"' choose-window
# scrolling fix
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
etw -g xterm-keys on
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
new-session
unbind-key M-k ; bind-key -n M-k next-window
unbind-key M-j ; bind-key -n M-j previous-window
#set-window-option -g window-status-current-format ' #I:#W '
# set first window to index 1 (not 0) to map more to the keyboard layout...
set-option -g base-index 1
set-window-option -g pane-base-index 1
set -g default-terminal "screen-256color"
source ~/.solarized/tmux-colors-solarized/tmuxcolors-256.conf
source ~/.tmux.powerline
if-shell 'test -z "$POWERLINE_CONFIG_COMMAND"' 'set-environment -g POWERLINE_CONFIG_COMMAND powerline-config'
# Don’t version-check for this core functionality -- anything too old to
# support these options likely won’t work well with powerline
set -g status on
set -g status-utf8 on
set -g status-interval 2
set -g status-left-length 20
set -g status-right '#(eval $POWERLINE_COMMAND tmux right -R pane_id=`tmux display -p "#D"`)'
set -g status-right-length 150
set -g window-status-format "#[fg=colour244,bg=colour234] #I #[fg=colour240] #[default]#W "
set -g window-status-current-format "#[fg=colour234,bg=colour31]#[fg=colour117,bg=colour31] #I  #[fg=colour231,bold]#W #[fg=colour31,bg=colour234,nobold]"
# Legacy status-left definition to be overwritten for tmux Versions 1.8+
set -g status-left '#[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour234,nobold]#(eval $POWERLINE_COMMAND tmux left)'
# Simplify tmux version checking by using multiple config files. Source these
# config files based on the version in which tmux features were added and/or
# deprecated. By splitting these configuration options into separate files,
run-shell 'eval $POWERLINE_CONFIG_COMMAND tmux source'
# vim: ft=tmux
#### 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment