Zathura: 使用键盘操作的极简文档查看器
PDF 文档查看器
![](/data/attachment/album/202306/20/093244dofs3kcszz7rozsd.jpg)


文档查看器是每个 Linux 发行版的必备软件，可以用来阅读 PDF 等格式的文件。


Ubuntu 等发行版上的文档查看器一般是 [GNOME 中的 Evince](https://wiki.gnome.org/Apps/Evince)（LCTT 译注：读作 [/ɪˈvɪns/](https://en.wiktionary.org/wiki/evince)）。Evince 支持多种文件格式，非常方便。


但是除了 Evince，还有很多其他的文档阅读应用。比如 Linux 上优秀的电子书阅读应用 [Foliate](https://itsfoss.com/foliate-ebook-viewer/)（LCTT 译注：读作 [/ˈfəʊlɪɪt/](https://en.wiktionary.org/wiki/foliate)）。


最近我又发现了另一个文档查看器：Zathura。


### 用 Zathura 获得摆脱鼠标的阅读体验


[Zathura](https://pwmt.org/projects/zathura/) 是一个高度可定制的文档查看器，基于 [girara 用户界面](https://git.pwmt.org/pwmt/girara) 和几个文档库。girara 实现了一个简单、最小的用户界面。


Zathura 的加载速度极快。它极其简约，没有侧边栏、菜单栏等元素。（LCTT 译注：其实 Zathura 的界面没有那么单一，按 `Tab` 键可以显示索引页；Zathura 有一个 `guioptions` 选项来设置是否显示命令行、状态栏、水平滚动条、垂直滚动条等 GUI 元素。）


![Zathura 文档查看器界面](/data/attachment/album/202306/20/093335pjaqpbll4v44opo4.png)


按 `:` 键可以打开 Zathura 的命令行提示符，按 `Esc` 键可以退出命令行。


如果要新建书签，可以输入 `:bmark` 后面跟想要对这个书签设置的索引号。


![Zathura 中的书签](/data/attachment/album/202306/20/093335i5ua85bzuzbczo05.png)


按 `F` 键可以高亮所有链接，每条链接附带一个序号，并且界面底部会显示命令行提示符。在命令行中输入链接对应的序号，按下回车可以用系统默认的浏览器打开该链接。


![高亮及打开文档中的链接](/data/attachment/album/202306/20/093336tlryn0q0i7o55o54.png)


Zathura 还支持自动重新载入。如果文件被其他应用修改（LCTT 译注：比如在修改 LaTeX 源文件并重新编译得到新的 PDF 之后）， Zathura 会自动重载修改后的文件。


你还可以安装 [插件](https://pwmt.org/projects/zathura/plugins/) 来扩展 Zathura 的功能，比如阅读 <ruby> 漫画 <rt>  comics </rt></ruby> 或 PostScript 文件。


但 Zathura 有一个问题，它的界面上没有任何文档或帮助选项，初次使用会有点困难。


你可以从其 Zathura 的 [手册页](https://itsfoss.com/linux-man-page-guide/) 获取默认键盘快捷键信息。以下是其中的一部分：


* `R`：旋转
* `D`：在单页和双页查看模式之间切换
* `F`：高亮当前屏幕内的链接
* `H` `J` `K` `L`：使用 Vim 类型键移动（LCTT 译注：HJKL 分别为左、下、上、右）
* `↑` `↓` `←` `→` 键或 `PgUp`/`PgDown` 或鼠标/触摸板：上下移动
* `/`：搜索文本，按 `n` 或 `N` 移动到下一个或上一个搜索（类似于 `less` 命令）
* `Q`：关闭


Zathura 的项目网站提供了 [如何配置该软件的文档](https://pwmt.org/projects/zathura/documentation/)，不过我觉得写得不太清晰。（LCTT 译注：安装 Zathura 之后，可以使用 `man zathurarc` 查看本地的 Zathura 配置手册。）


### 在 Linux 上安装 Zathura


大多数 Linux 发行版的软件仓库都包含了 Zathura，比如 Ubuntu、Fedora、Arch 和 Debian（查找自 [pkgs.org 网站](https://pkgs.org/)）。你可以使用你的发行版上的包管理器或软件中心来安装它。


在 Debian 和 Ubuntu 系发行版上可以使用下面的命令安装 Zathura：



```
sudo apt install zathura

```

在 Fedora 上可以使用:



```
sudo dnf install zathura

```

[在 Arch Linux 上使用 pacman 安装 Zathura](https://itsfoss.com/pacman-command/):



```
sudo pacman -Sy zathura

```

如果你想查看 Zathura 的源代码，可以访问它在 GitLab 上的软件仓库：



> 
> **[Zathura 源代码](https://git.pwmt.org/pwmt/zathura)**
> 
> 
> 


### 总结


坦诚地说，我并不喜欢不使用鼠标的工具，所以我更喜欢 Nano 而不是 Vim，因为我记不住 Vim 上数不清的快捷键。（LCTT 译注：其实 Zathura 对鼠标是有一定支持的，单击鼠标左键可以打开链接，按住鼠标左键可以选中并复制文本，按住鼠标中键可以拖动视图，`Ctrl` + 滚动滑轮可以缩放视图。）


我知道有很多人坚信键盘比鼠标更高效。但我并不愿意专门学习如何配置文档查看器，主要是因为我在桌面上很少阅读大量文档，当我偶尔需要查看 PDF 时，默认的应用已经够用了。


当然，我不是说 Zathura 没有用处。如果你需要处理大量 PDF 或 LaTeX 等的文档，而且偏爱于键盘操作，Zathura 可能会成为你下一个最喜爱的工具。


*（题图：MJ/80da04de-1312-43c1-86d7-3be340b12bd7）*




---


via: <https://itsfoss.com/zathura-document-viewer/>


作者：[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[tanloong](https://github.com/tanloong) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
Every Linux distribution comes with a document viewer app that lets you read PDF and other documents.

Most of the time, it is [Evince from GNOME](https://wiki.gnome.org/Apps/Evince) that is displayed as Document Viewer in Ubuntu and some other distributions. Evince is a handy tool and supports a wide variety of document formats.

However, there are other applications for reading documents. Take [Foliate](https://itsfoss.com/foliate-ebook-viewer/) for example. It’s an excellent [application for reading ebooks on Linux](https://itsfoss.com/best-ebook-readers-linux/).

I recently came across another document viewer called Zathura.

## Enjoy a mouse-free document reading experience with Zathura

[Zathura](https://pwmt.org/projects/zathura/) is a highly customizable document viewer based on the [girara user interface](https://git.pwmt.org/pwmt/girara) and several document libraries. girara implements a simple and minimalist user interface.

Zathura sure feels to load fast. It is minimalist, so you just get an application window with no sidebar, application menu or anything of that sort.

![zathura document viewer interface](https://itsfoss.com/content/images/wordpress/2021/07/Zathura-Document-Viewer-Interface-800x492.png)

You may open its command line prompt by pressing the : key. You may close the CLI prompt with Esc key.

If you want to create a bookmark, type :bmark and then provide an index number to the bookmarked page.

![bookmarking in zathura](https://itsfoss.com/content/images/wordpress/2021/07/bookmarking-in-zathura-800x639.png)

You may highlight all the links by pressing the F key. It will also display a number beside the highlighted URL and the command line prompt will appear at the bottom. If you type the URL number and press enter, the URL will be opened in the default web browser.

![follow link in zathura](https://itsfoss.com/content/images/wordpress/2021/07/Follow-link-in-Zathura-800x639.png)

Zathura also has automatic reloading feature. So if you make some changes to the document with some other application, the changes will be reflected as Zathura reloads the document.

You may also install additional plugins to improve the capabilities of Zathura and use it for reading comics or PostScript.

The problem with Zathura is that you won’t see any documentation or help option anywhere on the application interface. This makes things a bit more difficult if you are not already familiar with the tool.

You may get the default keyboard shortcuts information from its [man page](https://itsfoss.com/linux-man-page-guide/). Here are a few of them:

- R: Rotate
- D: Toggle between single and double page viewing mode
- F: Highlight all links on the current screen
- HJKL: Moving with the Vim type keys
- Arrows or PgUp/PgDown or the mouse/touchpad for moving up and down
- / and search for text, press n or N for moving to next or previous search (like less command)
- Q: Close

You may find the documentation on the project website to learn about configuration, but I still found it confusing.

## Installing Zathura on Linux

Zathura is available in the repositories of the most Linux distributions. I could see it available for Ubuntu, Fedora, Arch and Debian, thanks to the [pkgs.org website](https://pkgs.org/). This means that you can use the [package manager of your distribution](https://itsfoss.com/package-manager/) or the software center to install it.

On Debian and Ubuntu based distributions, use this command to install Zathura:

`sudo apt install zathura`


On Fedora, use:

`sudo dnf install zathura`


[Use pacman command on Arch Linux](https://itsfoss.com/pacman-command/):

`sudo pacman -Sy zathura`


And if you want to have a look at its source code, you may visit its GitLab repository:

## Conclusion

I’ll be honest with you. I am not a fan of mouse-free tools. This is why I prefer Nano over Vim as I cannot remember so many shortcuts.

I know there are people who swear by their keyboards. However, I would prefer not to spend time learning to configure a document viewer. This is more because I do not read too many documents on my desktop and for the limited PDF viewing, the default application is sufficient.

It’s not that Zathura does not have it usage. If you are someone who has to deal a lot with documents, be it PDF or LaTex, Zathura could be your next favorite tool if you are a keyboard love.