]> git.phdru.name Git - dotfiles.git/blobdiff - .tmux.conf
Remove bin/replace: Use `sed -i` instead
[dotfiles.git] / .tmux.conf
index 0984038332f49fecd547fe952efd7505c8fbffa3..72b57b5e6b7d94d09c99e813d0dcfb7d344f2148 100644 (file)
@@ -4,15 +4,16 @@ set-option -g pane-base-index 1
 # Renumber windows sequentially after closing any of them
 set-option -g renumber-windows on
 
+# Keyboard
+set-window-option -g mode-keys vi
 # Pass [Ctrl]+[PgUp/PgDn]
 set-window-option -g xterm-keys on
+# Don't wait for [Esc] to allow fast switching from insert mode to normal in vim
+# Set (and export) environment variable SLOWTERM to override.
+if-shell "test -z $SLOWTERM" "set-option -gs escape-time 0"
 
 # Mouse
-set-window-option -g mode-mouse on
-set-option -g mouse-select-pane on
-set-option -g mouse-resize-pane on
-# Mouse can be used to select windows (by clicking in the status bar)
-set-option -g mouse-select-window on
+#set-option -g mouse on
 
 # 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
@@ -43,7 +44,6 @@ set-window-option -g mode-style bg=black
 
 set-window-option -g window-status-activity-style fg=yellow
 set-window-option -g window-status-bell-style fg=red
-set-window-option -g window-status-content-style fg=magenta
 set-window-option -g window-status-current-style bg=blue,fg=white
 set-window-option -g window-status-style bg=cyan,fg=black
 
@@ -56,9 +56,6 @@ set-option -g status-right ''
 # Increase scrollback lines
 set-option -g history-limit 1000
 
-# <prefix> R to reload config without restart
-bind-key R source-file ~/.tmux.conf \; display "Reloaded!"
-
 # Set the command prefix to match GNU screen (CTRL+a)
 # set-option -g prefix C-a
 #
@@ -69,6 +66,33 @@ bind-key R source-file ~/.tmux.conf \; display "Reloaded!"
 # <prefix> C-a for last-window
 # bind-key C-a last-window
 
+# <prefix> R to reload config without restart
+bind-key R source-file ~/.tmux.conf \; display "Configuration reloaded!"
+
+# vim-like navigation
+unbind-key h; bind-key h select-pane -L
+unbind-key j; bind-key j select-pane -D
+unbind-key k; bind-key k select-pane -U
+unbind-key l; bind-key l select-pane -R
+
+bind H resize-pane -L 10
+bind J resize-pane -D 10
+bind K resize-pane -U 10
+bind L resize-pane -R 10
+
+bind -r C-h select-window -t :-
+bind -r C-l select-window -t :+
+
 # Use vertical and horizontal chars to split the screen
 bind-key | split-window -h
 bind-key - split-window -v
+
+bind-key -t vi-copy v begin-selection
+bind-key -t vi-copy y copy-selection
+bind-key -t vi-copy r rectangle-toggle
+bind P paste-buffer
+
+# Copy tmux copy buffer to X clipboard
+bind -t vi-copy C-y copy-pipe "xclip -i"
+# Copy X clipboard to tmux paste buffer
+bind C-p run-shell "xclip -o | tmux load-buffer -; tmux paste-buffer"