crpreview
Preview script made for the lf file manager. May work with other terminal file manageres after some configuration.
Features
crpreview
can preview files of the following formats:
| File type | Tool |
| ------------ | ------------------ |
| archives[^1] | tar (libarchive)
|
| markdown | glow
|
| images | chafa
|
| pdf | pdftoppm
|
| text | bat
|
[^1]: Supported formats: tar
, 7-zip
, zip
, bzip
,bzip2
, gunzip
, xz
, zstd
, lzip
, lrzip
Requirements
Any of the above mentioned preview tools you wish to use.
Installation
MacOS
Download the lastest MacOS build archive from GitHub and add it to a directory in your $PATH
.
FreeBSD
Download the lastest FreeBSD build archive from Cirrus CI and add it to a directory in your $PATH
.
Ubuntu
Download the lastest Ubuntu build archive from GitHub and add it to a directory in your $PATH
.
Don't forget to install the libarchive
version of tar
, as crpreview depends on it.
From source (Other Unix systems)
- Build the executable using `make``
- Copy the path to this working directory on your system`
Usage
Add the following lines to your lfrc
:
set previewer /path/to/crpreview/bin/crpreview
map i $ /path/to/crpreview/bin/crpreview $f | less -R
Development
Required Libraries
- chafa
- imagemagick (MagickWand)
- glib2
Contributing
- Fork it (https://github.com/your-github-user/crpreview/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Rishab Garg - creator and maintainer