diff options
| author | Mitsuo Tokumori <[email protected]> | 2023-11-21 16:58:40 -0500 |
|---|---|---|
| committer | Mitsuo Tokumori <[email protected]> | 2023-11-21 16:58:40 -0500 |
| commit | a00e90f5c964bc84fc2aef08110c549ff4234b3d (patch) | |
| tree | a783813d27ec1be301ca6b88a0e91f8793d40e32 /tmux | |
| parent | 2756d3189374174f1e07a6df0f47d679fdc6e791 (diff) | |
| download | dotfiles-a00e90f5c964bc84fc2aef08110c549ff4234b3d.tar.gz dotfiles-a00e90f5c964bc84fc2aef08110c549ff4234b3d.tar.bz2 dotfiles-a00e90f5c964bc84fc2aef08110c549ff4234b3d.zip | |
Add vim-like bindings to tmux
Diffstat (limited to 'tmux')
| -rw-r--r-- | tmux/tmux.conf | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 89bdc1f..b171190 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -2,17 +2,62 @@ # Ref.: https://thevaluable.dev/tmux-config-mouseless/ # remap prefix from 'C-b' to 'C-a' -unbind C-b set-option -g prefix C-a bind-key C-a send-prefix +unbind C-b # Start window numbering at 1 set -g base-index 1 +setw -g pane-base-index 1 +# Navigate history with vi keybindings set-window-option -g mode-keys vi +set -g history-limit 10000 # From NeoVim advice: # Fix 'escape-time' from 500ms to 10ms (better experience in Vim) set-option -sg escape-time 10 # focus-events (idk what this does) set-option -g focus-events on + +# Vim friendly tmux config +# Ref.: https://gist.github.com/Lartza/6a7a62466a8a3e436234412d9b1c5066 + +setw -g monitor-activity on +set -g visual-activity on + +# FIXME: https://unix.stackexchange.com/a/131187/347754 +# y and p as in vim +bind Escape copy-mode +unbind p +bind p paste-buffer +bind-key -T copy-mode-vi 'v' send -X begin-selection +bind-key -T copy-mode-vi 'y' send -X copy-selection +#bind-key -T copy-mode-vi 'Space' send -X halfpage-down +#bind-key -T copy-mode-vi 'Bspace' send -X 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 |
