This commit is contained in:
Nikita Ivanov 2022-06-16 03:29:09 +05:00
parent d6642a19dc
commit 80bb87b899
No known key found for this signature in database
GPG Key ID: 6E656AC5B97B5133

View File

@ -32,6 +32,7 @@
. .
. .
.TH CTPV 1 "June 2022" Linux "User Manuals" .TH CTPV 1 "June 2022" Linux "User Manuals"
.
.SH NAME .SH NAME
ctpv \- terminal previewer ctpv \- terminal previewer
. .
@ -84,7 +85,8 @@ Add this snippet to
.I lf .I lf
configuration file (usually located at configuration file (usually located at
.IR \(ti/.config/lf/lfrc ). .IR \(ti/.config/lf/lfrc ).
.IP .PP
.
.Ex .Ex
set previewer ctpv set previewer ctpv
set cleaner ctpvclear set cleaner ctpvclear
@ -167,7 +169,6 @@ Commands are separated by newlines.
Comments start with number sign Comments start with number sign
.RB ( # ) .RB ( # )
like in many other formats. like in many other formats.
.PP
. .
.SS Defining custom previews .SS Defining custom previews
. .
@ -179,8 +180,8 @@ A preview itself is a shell script enclosed within double curly
braces (this particular one utilizes the famous braces (this particular one utilizes the famous
.I cowsay .I cowsay
program): program):
.
.PP .PP
.
.Ex .Ex
preview cow .moo {{ preview cow .moo {{
\& cowsay < "$f" \& cowsay < "$f"
@ -193,8 +194,8 @@ Running
where where
.I file.moo .I file.moo
contains \(lqsome text\(rq will produce the following output: contains \(lqsome text\(rq will produce the following output:
.
.PP .PP
.
.Ex .Ex
\# ___________ \# ___________
\# < some text > \# < some text >
@ -248,8 +249,8 @@ command (see
. .
You can specify MIME type instead of filename extension You can specify MIME type instead of filename extension
in preview definition: in preview definition:
.
.PP .PP
.
.Ex .Ex
preview json_example application/json {{ preview json_example application/json {{
\& # preview json files \& # preview json files
@ -260,8 +261,8 @@ preview json_example application/json {{
And you also can omit subtype part of the MIME type And you also can omit subtype part of the MIME type
by replacing it with by replacing it with
.BR * . .BR * .
.
.PP .PP
.
.Ex .Ex
preview any_text_example text/* {{ preview any_text_example text/* {{
\& # this one applies to all text files \& # this one applies to all text files
@ -275,14 +276,15 @@ will make the preview above work for any file which MIME type starts with
.BR text/ . .BR text/ .
. .
.SS Setting priority .SS Setting priority
.
If there are several previews that apply to the same file type, If there are several previews that apply to the same file type,
only the top one in the list is chosen (see only the top one in the list is chosen (see
.IR "How previews are selected" ). .IR "How previews are selected" ).
To alter this behavior, you can use To alter this behavior, you can use
.B priority .B priority
command to change preview priority: command to change preview priority:
.
.PP .PP
.
.Ex .Ex
priority cat priority cat
.Ee .Ee
@ -297,8 +299,8 @@ to set priority other than 1 (may also be negative).
. .
.B remove .B remove
command simply removes a preview (also works for built-in ones): command simply removes a preview (also works for built-in ones):
.
.PP .PP
.
.Ex .Ex
remove cat remove cat
.Ee .Ee