Makes ranger handle json better

Jonathan Hodgson 5 years ago
parent de7d5acc53
commit 503603d705
  1. 2
      ranger/.config/ranger/rc.conf
  2. 3
      ranger/.config/ranger/scope.sh

@ -87,7 +87,7 @@ set preview_images true
# * urxvt-full: # * urxvt-full:
# The same as urxvt but utilizing not only the preview pane but the # The same as urxvt but utilizing not only the preview pane but the
# whole terminal window. # whole terminal window.
set preview_images_method w3m set preview_images_method ueberzug
# Use a unicode "..." character to mark cut-off filenames? # Use a unicode "..." character to mark cut-off filenames?
set unicode_ellipsis false set unicode_ellipsis false

@ -121,6 +121,9 @@ case "$mimetype" in
try safepipe highlight --out-format=${highlight_format} "$path" && { dump | trim; exit 5; } try safepipe highlight --out-format=${highlight_format} "$path" && { dump | trim; exit 5; }
try safepipe pygmentize -f ${pygmentize_format} "$path" && { dump | trim; exit 5; } try safepipe pygmentize -f ${pygmentize_format} "$path" && { dump | trim; exit 5; }
exit 2;; exit 2;;
application/json )
jq -C '.' "$path" && exit 0 || echo "what's happening" && exit 0
;;
# Ascii-previews of images: # Ascii-previews of images:
image/*) image/*)
img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;; img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;;

Loading…
Cancel
Save