diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2020-06-10 22:33:59 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2020-06-10 22:33:59 +0530 |
commit | ef0e9731345b020eccbb67d511d958bc92f7fb89 (patch) | |
tree | daa2d196a1e44c615105bc88ee0d3956f8731132 /plugins/hexview | |
parent | 92ff1447c010b450b3dc4004e9976b972841003d (diff) | |
download | nnn-ef0e9731345b020eccbb67d511d958bc92f7fb89.tar.gz |
Add hx as alternative hex viewer
Diffstat (limited to 'plugins/hexview')
-rwxr-xr-x | plugins/hexview | 8 |
1 files changed, 6 insertions, 2 deletions
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 |