aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-01-22 23:20:31 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-01-22 23:20:31 +0530
commitd224016011c4500074c29609dbc157fe7cedac09 (patch)
tree70973f102744863722be2ddf241d013245909db9 /plugins
parent60dfb79b8d5dfa3e1b3708d2349ee58fe7645b97 (diff)
downloadnnn-d224016011c4500074c29609dbc157fe7cedac09.tar.gz
nuke: add glow to preview markdown
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/nuke11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/nuke b/plugins/nuke
index d0223c3..e1c1a22 100755
--- a/plugins/nuke
+++ b/plugins/nuke
@@ -45,6 +45,7 @@
# audio: mocplay (nnn plugin using MOC), mpv, mediainfo, exiftool
# torrent: rtorrent, transmission-show
# odt|ods|odp|sxw: odt2txt
+# md: glow (https://github.com/charmbracelet/glow)
# htm|html|xhtml: w3m, lynx, elinks
# json: jq, python (json.tool module)
# Multimedia by mime:
@@ -165,6 +166,14 @@ handle_extension() {
fi
exit 1;;
+ ## Markdown
+ md)
+ if which glow >/dev/null 2>&1; then
+ glow -sdark "${FPATH}" | less -R
+ exit 0
+ fi
+ ;;
+
## HTML
htm|html|xhtml)
## Preview as text conversion
@@ -375,7 +384,7 @@ handle_mime() {
## Text
text/* | */xml)
vi "${FPATH}"
- exit 1;;
+ exit 0;;
## Syntax highlight
# if [[ "$( stat --printf='%s' -- "${FPATH}" )" -gt "${HIGHLIGHT_SIZE_MAX}" ]]; then
# exit 2