-
Previews files and directories in the terminal on macOS.
-
Can be used as a preview tool for lf file manager.
-
OCaml port of crpreview.
crpreview can preview the following formats:
| File type | Tool |
|---|---|
| archives1 | libarchive |
| images | Kitty unicode placeholders |
| libmupdf | |
| videos | ffmpeg thumbnails |
| text | bat |
| directories | eza |
- Terminal emulator that supports the kitty terminal graphics protocol
Try it out:
nix shell github:RisGar/mlpreviewInstall it as a profile:
nix profile install github:RisGar/mlpreviewInclude it in your config:
inputs = {
...
mlpreview.url = "github:RisGar/mlpreview";
mlpreview.inputs.nixpkgs.follows = "nixpkgs";
};
...
environment.systemPackages = [
mlpreview.packages.${pkgs.system}.default
];Ensure the following requirements are installed:
- OCaml 5.3
- libarchive
- mupdf
- bat
- eza
- ffmpeg
git clone https://github.com/RisGar/mlpreview
cd mlpreview
opam install . --deps-only
dune buildAdd the following lines to your lfrc:
set previewer /path/to/mlpreview/bin/mlpreview
map i $ /path/to/mlpreview/bin/mlpreview $f | less -R
Make sure to install the required decompressors for libarchive to list archive contents.
- Fork it (https://github.com/RisGar/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
Footnotes
-
Supported formats:
tar,7-zip,zip,bzip,bzip2,gunzip,xz,zstd,lzip↩