A Kitty terminal PDF viewer with Vim-like keybindings and classical GUI-like usage.
Note that the colours in the overview above are corrupted because of GIF compression.
There are multiple in-terminal PDF viewers for the Kitty terminal but the main problem is that the end-user can interact only by viewing one page at a time. The user may have the need to zoom in and out of the PDF document to view details in the document. Another problem is viewing continuous content which is split between multiple pages. Therefore it was decided to develop such PDF viewer which can operates in the same way as a classical GUI PDF viewer but which can additionally be controlled by powerful Vim-like keybindings.
Warning
This project is currently under it's early development state; there can be many bugs and problems. The codebase is weak and going to be upgraded in the near future to minimize dependencies and possible bugs.
- Cargo
- Rust
- Kitty >= 0.20.0
Note
A Kitty terminal version larger than 0.20.0 is necessary for the viewer to work because of the cursor control feature in the protocol (#3411).
The project is easily built using Cargo:
$ cargo build
...and as easily installed:
$ cargo install --path .
To view a PDF file simply execute:
$ meowpdf <PATH TO PDF FILE>
There are a set of keybindings implemented in this viewer which are listed below:
- q: Quit
- a: Toggles alpha on PDF pages (Makes white background of PDF pages transparent)
- i: Toggles color inversion on PDF pages
- <S>+g: Jumps to the last page of the PDF document
- <left>: Move the document to the left
- <right>: Move the document to the right
- <up>: Move the pages up (& the document down)
- <down>: Move the pages down (& the document up)
- +: Zoom in
- -: Zoom out
One of the key-features of MeowPDF is it's high customizability. MeowPDF allows customization based on the following parameters:
- Scroll speed
- Static render precision for PDF pages
- Memory limit on rendered PDF pages
- Default document scale on enter (will be replaced by a dynamic one soon)
- Minimal allowed zoom out amount on the document
- Zoom amount
- Margin amount on the bottom of PDF pages
- Preloaded pages before and after the first displayed page
The configuration YAML file is found in ~/.config/meowpdf
.
- Remove heavy and inefficient regex dependency and move to nested switches.
- Implement or find a standard on parsing stdin key inputs.
- Allow for link clicking using the mouse.
- Allow custom remapping of keybindings.
- Implement auto-scaling of the PDF document on opening based on terminal size.
- Develop a customizable Vim-like bar illustrating page & document metrics.
All contributions are welcome to this project.
MeowPDF is available under MIT.
- Logo was made using Peeking Cat Vectors by Vecteezy.
- README design was inspired from areg-sdk.