]> git.rmz.io Git - dotfiles.git/commitdiff
tmux: vi mode
authorSamir Benmendil <samir.benmendil@gmail.com>
Mon, 15 Jun 2015 01:53:29 +0000 (02:53 +0100)
committerSamir Benmendil <samir.benmendil@gmail.com>
Mon, 15 Jun 2015 01:53:29 +0000 (02:53 +0100)
tmux.conf

index 32d4fa3a572b9571addf8367c806ca496879690a..000fb3066496189c09cbff876bb0f4cf18471bd7 100644 (file)
--- a/tmux.conf
+++ b/tmux.conf
@@ -3,4 +3,38 @@ set -g utf8 on
 set -g set-titles on
 set -g mouse-utf8 on
 
 set -g set-titles on
 set -g mouse-utf8 on
 
-new -s weechat -n weechat weechat
+set -g mode-keys vi
+
+bind Escape copy-mode
+unbind p
+bind p paste-buffer
+bind -t vi-copy 'v' begin-selection
+bind -t vi-copy 'y' copy-selection
+bind -t vi-copy 'Space' halfpage-down
+bind -t vi-copy 'Bspace' halfpage-up
+
+# extra commands for interacting with the ICCCM clipboard
+bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"
+bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
+
+# easy-to-remember split pane commands
+bind | split-window -h
+bind - split-window -v
+unbind '"'
+unbind %
+
+# moving between panes with vim movement keys
+bind h select-pane -L
+bind j select-pane -D
+bind k select-pane -U
+bind l select-pane -R
+
+# moving between windows with vim movement keys
+bind -r C-h select-window -t :-
+bind -r C-l select-window -t :+
+
+# resize panes with vim movement keys
+bind -r H resize-pane -L 5
+bind -r J resize-pane -D 5
+bind -r K resize-pane -U 5
+bind -r L resize-pane -R 5