Mercurial > dotfiles.old
changeset 7:4f1add3c7606
Make tmux act like vim
author | zegervdv <zegervdv@me.com> |
---|---|
date | Sun, 23 Feb 2014 18:32:49 +0100 |
parents | d35280c9b023 |
children | d20278638011 |
files | tmux.conf |
diffstat | 1 files changed, 37 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/tmux.conf Sun Feb 23 18:52:12 2014 +0100 +++ b/tmux.conf Sun Feb 23 18:32:49 2014 +0100 @@ -1,18 +1,46 @@ +# $Id: vim-keys.conf,v 1.2 2010-09-18 09:36:15 nicm Exp $ +# +# vim-keys.conf, v1.2 2010/09/12 +# +# 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. This is intended for tmux 1.3, which handles pane selection +# differently from the previous versions + +# 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 hjkl, as one would in vim after pressing ctrl-w +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 + set -g prefix C-a unbind C-b bind C-a send-prefix - set -g default-terminal "screen-256color" -set-option -g status-left '' -set-option -g status-right " #[bg=cyan] %d %b %Y %H:%M " -set -g mode-mouse on -set -g mouse-select-pane on -set -g mouse-select-window on -set -g terminal-overrides 'xterm*:smcup@:rmcup@' - -setw -g mode-keys vi bind -t vi-copy 'v' begin-selection bind -t vi-copy 'y' copy-pipe "reattach-to-user-namespace pbcopy"