Zathura - cool PDF viewer with Vim bindings

Oct 22, 2022

A pleasant find of recent days for me is Zathura - open source, lightweight, minimalistic, highly customizable PDF viewer with Vim hotkeys support. Sounds good, doesn’t it?

I read regularly quite a lot of books and documentation in PDF, so I am very glad to discover this tool. Here’s what it looks like for me after a little tweaking.

Zathura PDF viewer

Installation

Installation of Zathura looks pretty trivial:

~ sudo apt-get install zathura

I also installed zathura-djvu to read DjVu documents:

~ sudo apt-get install zathura-djvu

Basics

As I mentioned above, Zathura uses Vim bindings, so if you’re familiar with this editor, you’ll feel very comfortable with Zathura. If you are not familiar with Vim, here is a short description of the keys:

  • j, k, h, l for navigation
  • gg to jump to the beginning of the document
  • G to go to the end of the document
  • J, K to go to the next and previous pages respectively
  • / to search
  • n, N to move between search results
  • q to close the application
  • : for entering commands, for example :bmark for creating bookmarks or :blist to view the list of bookmarks.

There are also additional hotkeys such as:

  • TAB to see content of the document
  • d to toggle between single and double page view
  • r to rotate document
  • F11 to open fullscreen.

For more information about keyboard shortcuts check man or the project website.

Other Features

In addition to the fact that the viewer itself looks quite minimalistic, it also has other benefits. For example, Zathura is able to reload an open file automatically if it was updated. This can be very useful for example when you work with LaTeX documents and see the result immediately.

Also, I would like to note the ability to install plugins for different formats of documents. I’ve only tried DjVu so far, but here you can see more options.

Configuration

To configure Zathura you can edit ~/.config/zathura/zathurarc file. For example, here’s mine:

#open files in maximized window
set window-height 3000
set window-width 3000

set font "inconsolata 15"

# copy selection to system clipboard
set selection-clipboard clipboard

#stop at page boundries
set scroll-page-aware "true"
set smooth-scroll "true"
set scroll-full-overlap 0.01
set scroll-step 100

#setup dark theme
set default-bg "#000000"
set default-fg "#F7F7F6"

set statusbar-fg "#B0B0B0"
set statusbar-bg "#202020"

set inputbar-bg "#151515"
set inputbar-fg "#FFFFFF"

set notification-error-bg "#AC4142"
set notification-error-fg "#151515"

set notification-warning-bg "#AC4142"
set notification-warning-fg "#151515"

set highlight-color "#F4BF75"
set highlight-active-color "#6A9FB5"

set completion-highlight-fg "#151515"
set completion-highlight-bg "#90A959"

set completion-bg "#303030"
set completion-fg "#E0E0E0"

set notification-bg "#90A959"
set notification-fg "#151515"

set recolor "true"
set recolor-lightcolor "#000000"
set recolor-darkcolor "#E0E0E0"
set recolor-reverse-video "true"
set recolor-keephue "true"

set render-loading "false"

Summarizing

Zathura looks like as the main tool that I will use for viewing PDF and DjVu documents. And I would like to recommend you try it too!