Permalink
Browse files

tmux: use vim binding for copy and paste

  • Loading branch information...
1 parent 8b20893 commit 564ddeb7f66003510b1a51705bd051d70c7fdff9 @jduan committed Feb 25, 2012
Showing with 25 additions and 3 deletions.
  1. +25 −3 .tmux.conf
View
@@ -17,15 +17,37 @@ bind r source-file ~/.tmux.conf
# THEME
set -g status-bg black
set -g status-fg white
-set -g status-interval 60
-set -g status-left-length 30
-set -g status-left '#[fg=green]#H'
+set -g status-left ""
+set -g status-right "#[fg=green]#H"
+# set -g status-interval 60
+# set -g status-left-length 30
+# set -g status-left '#[fg=green]#H'
# set -g status-left '#[fg=green](#S) #(whoami)@#H#[default]'
# set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=blue]%H:%M#[default]'
# Highlight active window
set-window-option -g window-status-current-bg red
+# Rather than constraining window size to the maximum size of any client
+# connected to the *session*, constrain window size to the maximum size of any
+# client connected to *that window*. Much more reasonable.
+setw -g aggressive-resize on
+
+# scrollback and copy
+set -g history-limit 5000
+unbind [
+bind Escape copy-mode
+unbind p
+bind p paste-buffer
+bind-key -t vi-copy 'v' begin-selection
+bind-key -t vi-copy 'y' copy-selection
+# to copy the whole scrollback window
+# 1. Prefix Esc
+# 2. v: start visual selection
+# 3. gg: to capture everything in the scrollback
+# 4. y: yank it to the buffer
+# 5. Prefix p: paste it in another window
+
# pane movement: act like vim
setw -g mode-keys vi
bind h select-pane -L

0 comments on commit 564ddeb

Please sign in to comment.