0

I use tmux, iTerm2 and zsh and I want to be able to scroll through the recent zsh history with Vim-like keybindings, something like ^+j or Alt+j. Additionally, I would like to scroll the screen with a keybinding, maybe similar to Vim's ^+u ^+d.

I want to prevent using the arrow keys, especially when I am using Vim and then I switch to another pane because I want to compile the program. Suddenly, I have to use the arrow keys to get the most recent command. Furthermore, I want to scroll the output of any command with something other than the mouse.

Maybe this is possible by default and I just didn't find it.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
simba
  • 1
  • 1
  • 2
    zsh: ^P/^N. tmux: Prefix+[, then j/k (quit with q). For your specific usecase: You can make a vim binding to call `tmux send-keys` to recompile your project without having to leave your vim pane. – L3viathan Dec 06 '19 at 12:43
  • Thanks for the help! Somehow tmux won't let me scroll with j/k, just with the arrow keys. I also tried using the command ```set-window-option -g mode-keys vi``` in my .tmux.conf. But still no movement with j/k. – simba Dec 06 '19 at 14:11

1 Answers1

0

I found a solution for everyone else who wants to navigate in tmux with h/j/k/l.

At least in my case, I had a little bit more stuff to specify, and found the code in "vim keybindings for tmux".

It is not enough to set the vi key bindings, additionally, you need to rebind the h/j/k/l keys for scrolling up and down.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
simba
  • 1
  • 1