From 39311ccb0c007b9ba78e10289d1cf77276323137 Mon Sep 17 00:00:00 2001 From: Nikita Ivanov Date: Sun, 12 Jun 2022 22:27:24 +0500 Subject: [PATCH] Add more built-in previews --- prev/colordiff.sh | 1 + prev/delta.sh | 1 + prev/diff_so_fancy.sh | 1 + prev/elinks.sh | 1 + prev/ls.sh | 1 + prev/lynx.sh | 1 + prev/torrent.sh | 1 + prev/w3m.sh | 1 + previews.h | 13 +++++++++++++ 9 files changed, 21 insertions(+) create mode 100644 prev/colordiff.sh create mode 100644 prev/delta.sh create mode 100644 prev/diff_so_fancy.sh create mode 100644 prev/elinks.sh create mode 100644 prev/ls.sh create mode 100644 prev/lynx.sh create mode 100644 prev/torrent.sh create mode 100644 prev/w3m.sh diff --git a/prev/colordiff.sh b/prev/colordiff.sh new file mode 100644 index 0000000..074dd38 --- /dev/null +++ b/prev/colordiff.sh @@ -0,0 +1 @@ +colordiff < "$f" diff --git a/prev/delta.sh b/prev/delta.sh new file mode 100644 index 0000000..2ffccb5 --- /dev/null +++ b/prev/delta.sh @@ -0,0 +1 @@ +delta < "$f" diff --git a/prev/diff_so_fancy.sh b/prev/diff_so_fancy.sh new file mode 100644 index 0000000..a9860f9 --- /dev/null +++ b/prev/diff_so_fancy.sh @@ -0,0 +1 @@ +diff-so-fancy < "$f" diff --git a/prev/elinks.sh b/prev/elinks.sh new file mode 100644 index 0000000..f659607 --- /dev/null +++ b/prev/elinks.sh @@ -0,0 +1 @@ +elinks -dump "$f" diff --git a/prev/ls.sh b/prev/ls.sh new file mode 100644 index 0000000..4681bd1 --- /dev/null +++ b/prev/ls.sh @@ -0,0 +1 @@ +ls --color --group-directories-first "$f" diff --git a/prev/lynx.sh b/prev/lynx.sh new file mode 100644 index 0000000..1d870cb --- /dev/null +++ b/prev/lynx.sh @@ -0,0 +1 @@ +lynx -dump -- "$f" diff --git a/prev/torrent.sh b/prev/torrent.sh new file mode 100644 index 0000000..91d2ba8 --- /dev/null +++ b/prev/torrent.sh @@ -0,0 +1 @@ +transmission-show -- "$f" diff --git a/prev/w3m.sh b/prev/w3m.sh new file mode 100644 index 0000000..5c1d12f --- /dev/null +++ b/prev/w3m.sh @@ -0,0 +1 @@ +w3m -dump "$f" diff --git a/previews.h b/previews.h index 3afd060..fbcce0d 100644 --- a/previews.h +++ b/previews.h @@ -18,6 +18,7 @@ Preview b_previews[] = { PR(NULL, NULL, NULL, any), PR("md", NULL, NULL, mdcat), + PR("torrent", NULL, NULL, torrent), PR(NULL, "text", NULL, bat), PR(NULL, "text", NULL, highlight), @@ -29,6 +30,18 @@ Preview b_previews[] = { PR(NULL, "application", "pdf", pdf), PR(NULL, "application", "json", jq), + PR(NULL, "inode", "directory", ls), + + PR(NULL, "text", "html", w3m), + PR(NULL, "text", "html", lynx), + PR(NULL, "text", "html", elinks), + + PR(NULL, "text", "x-diff", delta), + PR(NULL, "text", "x-patch", delta), + PR(NULL, "text", "x-diff", diff_so_fancy), + PR(NULL, "text", "x-patch", diff_so_fancy), + PR(NULL, "text", "x-diff", colordiff), + PR(NULL, "text", "x-patch", colordiff), };