Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tmux Scroll Up/Down Page using Ctrl-b and Ctrl-f

Once in scroll-mode, how do I use Ctrl+b and Ctrl+f to scroll up and down pages?

These commands currently move back and forth between characters.

.tmux.conf

set -g default-terminal "screen-256color"
setw -g xterm-keys on
set -g status-bg black
set -g status-fg white
set -g history-limit 999999999

bind C-d detach
bind r source-file ~/.tmux.conf

set -g prefix C-z 

if-shell 'test "$(tmux -V)" = "tmux 1.5"' 'set -g prefix C-a,C-z'
if-shell 'test "$(tmux -V)" = "tmux 1.6"' 'set -g prefix2 C-a'
if-shell 'test "$(tmux -V)" = "tmux 1.7"' 'set -g prefix2 C-a'

unbind C-b 
bind C-a send-keys C-a 
bind C-z send-keys C-z 

# These are available in iTerm by default, but need to be explicitly configured
# in Terminal.app.
# S-Up:    ^[[1;2A
# S-Down:  ^[[1;2B
# S-Right: ^[[1;2C
# S-Left:  ^[[1;2D
bind -n S-Up copy-mode
bind -n S-Down command-prompt
bind -n S-Right next-window
bind -n S-Left previous-window

#set -g base-index 1

set-window-option -g mode-keys vi
like image 643
Dru Avatar asked Jan 13 '13 04:01

Dru


People also ask

How do you scroll up and down on tmux?

You can scroll up and down in Tmux by using the following: Press Ctrl + B keys followed by the [ key. Now use the normal navigation keys on the keyboard like up arrow/down arrow, page up, page down, etc. to navigate the Tmux interface.

How do I change Ctrl-B to tmux?

The first command unbind C-b removes the current Ctrl-b binding, the second command set-option -g prefix C-a set Ctrl-a as the main tmux command binding.

Why can't I scroll in tmux?

Scrolling with keys is enabled by default in Tmux. Just press ctrl + b then [ to move around with the arrow keys. Just as with the mouse settings you have to add them to your .


1 Answers

Add below into .tmux.conf, you can move like in vim use hjkl, Ctrl+D/Ctrl+U(PageDown/Up) in the tmux scroll mode. Even more, you can use / to search.

setw -g mode-keys vi
set -g status-keys vi
bind-key -t vi-edit Up   history-up
bind-key -t vi-edit Down history-down

Hope this will help you :)

like image 135
Browny Lin Avatar answered Sep 22 '22 13:09

Browny Lin