timotheecour
timotheecour

Reputation: 3691

how to scroll to beginning/end of scroll buffer in tmux?

^b+page up/down scrolls up/down one page of scroll buffer, but how do we scroll to beginning ?

like wise with end (besides pressing ^C to kill scrolling)

Upvotes: 29

Views: 18898

Answers (2)

Lungang Fang
Lungang Fang

Reputation: 1537

This depends on the binding of "mode-keys". If you have set-option -g mode-keys emacs in your ~/.tmux.conf file (actually, this should be the default), then you can go to the beginning and the end of the buffer using corresponding emacs keys:

  1. Enter the copy mode using: ctrl-b + [
  2. Go to the beginning using: Alt + shift + , (or, in emacs' notation: M-<)

Similarly, going to the end is achieved by M->

If instead you prefer vi keybindings, you can put set-option -g mode-keys vi in your ~/.tmux.conf file, and then you have:

  1. Enter the copy mode using: ctrl-b + [
  2. Go to the beginning using gg, go to the bottom using G

Please note that configuration in ~/.tmux.conf only takes effect after the tmux server restarts. That is when you kill all sessions and then restart tmux.

Upvotes: 25

Ahmad Ismail
Ahmad Ismail

Reputation: 13942

You can use like:

bind-key -T copy-mode C-S-Home send -X history-top # Ctrl+Shift+Home
bind-key -T copy-mode C-S-End send -X history-bottom # Ctrl+Shift+End

This way when you are in copy mode Ctrl+Shift+Home will take you to the beginning of scroll buffer and Ctrl+Shift+End will take you to the end of scroll buffer.

Upvotes: 0

Related Questions