Tmux change scroll up / down

Currently, when I want to switch to scroll mode, press Ctrl+b and then [ . However, for now, I have to use the up and down keys to scroll up or down. I would prefer k for up and j for down.

How to change the scroll behavior so that the scroll down occurs when I press k and the scroll up occurs when I press j ?

+5
source share
1 answer

I am using a .tmux.conf file with something similar to the following, which I adapted to your question

 # Set tmux to Vi mode set-window-option -g mode-keys vi # Scroll up/down with j/k bind-key -t vi-copy 'j' page-up bind-key -t vi-copy 'k' page-down 

Although this seems unnecessary, as in vi mode hjkl works as expected and you scroll up / down with J/K ( Shift + J , Shift + K ), which work just fine

To make it even more like Vim, I add the following:

 bind-key -t vi-copy 'v' begin-selection bind-key -t vi-copy 'y' copy-selection 

How the visual selection of Vim and yank works

Note After setting up the file, you need to reload it, for example. with the tmux command :source ~/.tmux.conf

+5
source

All Articles