From b5cbb3dd3928c7efbe567801dbe55e8e1294bd1a Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 30 Jul 2016 19:20:24 +0800 Subject: tmux: update copy mode settings with vi keybindings --- _tmux.conf | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/_tmux.conf b/_tmux.conf index 348f74b..dcaf80d 100644 --- a/_tmux.conf +++ b/_tmux.conf @@ -1,9 +1,10 @@ ## ## ~/.tmux.conf +## See tmux(1) for details. ## ## Aaron LI ## Created: 2015-01-22 -## Updated: 2016-07-26 +## Updated: 2016-07-30 ## ## References: ## [1] tmux: Productive Mouse-Free Development (by Brian P. Hogan) @@ -25,15 +26,16 @@ unbind-key C-b set-option -g prefix C-a -## Start window numbering at 1 +## Use 'vi' key bindings in copy and choice modes +set-window-option -g mode-keys vi + +## Start window and pane numbering at 1 set-option -g base-index 1 +set-window-option -g pane-base-index 1 ## Renumber the windows when a window is closed set-option -g renumber-windows on -## Start pane numbering at 1 -set-window-option -g pane-base-index 1 - # URxvt tab like window control bind-key -n S-Down new-window bind-key -n S-Left previous-window @@ -44,6 +46,13 @@ bind-key -n C-Right swap-window -t +1 ## Detach tmux instead of exit bind-key -n C-d detach +## Copy mode settings +bind-key p paste-buffer +bind-key -t vi-copy "v" begin-selection +bind-key -t vi-copy "y" copy-selection +# toggle between line- and column-wise selection +bind-key -t vi-copy "V" rectangle-toggle + ## Mouse control (>= v2.1) set-option -g mouse on bind-key m set-option -g mouse on \; display "Mouse: ON" @@ -107,7 +116,7 @@ set-window-option -g monitor-activity off ###### Tmux Plugins ###### -# List of plugins +## List of plugins set-option -g @plugin "tmux-plugins/tpm" # Basic tmux settings everyone can agree on set-option -g @plugin "tmux-plugins/tmux-sensible" @@ -124,6 +133,10 @@ set-option -g @plugin "tmux-plugins/tmux-pain-control" # Tmux key bindings for quick opening of a highlighted file or URL set-option -g @plugin "tmux-plugins/tmux-open" +## Plugin settings +# tmux-yank: +set-option -g @shell_mode 'vi' + # Automatic TPM installation # Credit: https://github.com/tmux-plugins/tpm/blob/master/docs/automatic_tpm_installation.md if "test ! -d ~/.tmux/plugins/tpm" \ -- cgit v1.2.2