I've been able to turn-on the vi-mode inside tmux successfully by pressing C-a :
(I've changed default prefix) and then typing set-window-option mode-keys vi
. However, I can't make it stick by adding into ~/.tmux.conf
. Here is my config:
# Change default prefix key to C-a
unbind-key C-b
set -g prefix 'C-a'
bind-key 'C-a' send-prefix
# Configure Vim mode for navigating text and selection
set-window-option -g mode-keys vi
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
# Allow navigating panes with vi-like commands.
bind k selectp -U
bind j selectp -D
bind h selectp -L
bind l selectp -R
Notably, navigating panes using kjhl
keys also doesn't work. Perhaps this is because tmux fails to execute set-window-option earlier in the script. What's wrong here?
Default keybinding to get into copy mode is prefix+[ . If you are a vim user you will likely want to use vi style keys, add this to your ~/. tmux. conf file to enable vi mode.
set-window-option (alias setw ) is used to configure window options ( allow-rename , mode-keys , synchronize-panes , etc.)
tmux offers a set of vi-like bindings for navigating a buffer in a window. These allow you to not only navigate through the buffer beyond what your screen is currently showing, but also to search all the output generated thus far, and to select and copy text that can be pasted in any other window in the tmux session.
Try using setw -g mode-keys vi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With