Skip to content

Instantly share code, notes, and snippets.

@rubysolo
Created March 25, 2015 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubysolo/e4b1bbca6df6b71bec4c to your computer and use it in GitHub Desktop.
Save rubysolo/e4b1bbca6df6b71bec4c to your computer and use it in GitHub Desktop.
# $Id: vim-keys.conf,v 1.1 2010/01/17 16:24:09 nicm Exp $
#
# vim-keys.conf, v1.0 2010/01/15
#
# By Daniel Thau. Public domain.
#
# This configuration file binds many vi- and vim-like bindings to the
# appropriate tmux key bindings. Note that for many key bindings there is no
# tmux analogue.
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# reload config
bind r source-file ~/.tmux.conf
# send keys to all panes
bind C-s set-window-option synchronize-panes
bind C-q set-window-option synchronize-panes off
set -g status-bg blue
set -g status-fg white
setw -g window-status-current-attr underscore
# split windows like vim
# vim's definition of a horizontal/vertical split is reversed from tmux's
bind s split-window -v
bind v split-window -h
# move around panes with h, j, k, and l, a bit like vim
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resize panes like vim
# feel free to change the "1" to however many lines you want to resize by, only
# one at a time can be slow
bind < resize-pane -L 1
bind > resize-pane -R 1
bind - resize-pane -D 1
bind + resize-pane -U 1
# bind : to command-prompt like vim
# this is the default in tmux already
bind : command-prompt
# vi-style controls for copy mode
setw -g mode-keys vi
bind C-l pipe-pane -o 'cat >> ~/tmux-#I.#P.log'
# fix scrolling with page up / page down
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set-option -g default-command "reattach-to-user-namespace -l fish"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment