From ef0e9731345b020eccbb67d511d958bc92f7fb89 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Wed, 10 Jun 2020 22:33:59 +0530 Subject: Add hx as alternative hex viewer --- plugins/hexview | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins/hexview') diff --git a/plugins/hexview b/plugins/hexview index 60b3428..ce17a60 100755 --- a/plugins/hexview +++ b/plugins/hexview @@ -1,11 +1,15 @@ #!/usr/bin/env sh # Description: View a file in hex -# Dependencies: xxd and $PAGER +# Dependencies: hx (https://github.com/krpors/hx)/xxd and $PAGER # # Shell: POSIX compliant # Author: Arun Prakash Jana if ! [ -z "$1" ]; then - xxd "$1" | $PAGER + if which hx >/dev/null 2>&1; then + hx "$1" + else + xxd "$1" | $PAGER + fi fi -- cgit v1.2.3-70-g09d2