Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Preview

You can open the preview window by pressing p.

Preview window displays output of the jj show (or jj op show) command of the selected revision/file/operation.

You can specify commands to display the content of different item types in the preview window using the configuration options under the preview table in your configuration file.

The default commands are:

[preview]
revision_command = ["show", "--color", "always", "-r", "$change_id"]
oplog_command = ["op", "show", "$operation_id", "--color", "always"]
file_command = ["diff", "--color", "always", "-r", "$change_id", "$file"]

While the preview window is showing, you can press; ctrl+n to scroll one line down, ctrl+p to scroll one line up, ctrl+d to scroll half page down, ctrl+u to scroll half page up.

When mouse support is available in your terminal, you can also scroll the preview vertically and horizontally with the mouse wheel, and drag the preview border to resize it.

GIF

Configuration

By default preview window has the following configuration:

[keys.preview]
  mode = ["p"]
  toggle_bottom = ["P"]
  scroll_up = ["ctrl+p"]
  scroll_down = ["ctrl+n"]
  half_page_down = ["ctrl+d"]
  half_page_up = ["ctrl+u"]
  expand = ["ctrl+h"]
  shrink = ["ctrl+l"]
[preview]
  position = "auto" # auto, bottom, or right
  show_at_start = false
  width_percentage = 50.0
  width_increment_percentage = 5.0
  revision_command = ["show", "--color", "always", "-r", "$change_id"]
  oplog_command = ["op", "show", "$operation_id", "--color", "always"]
  file_command = ["diff", "--color", "always", "-r", "$change_id", "$file"]

Preview Window Position

Pressing P will move the preview window to the bottom of the screen, and pressing it again will move it back to the side.

You can control where the preview appears by default with the position field:

[preview]
position = "auto"   # one of: "auto", "bottom", "right"
show_at_start = true
  • auto (default): choose bottom in tall terminals, right in wide ones.
  • bottom: always show the preview at the bottom.
  • right: always show the preview on the right-hand side.