about summary refs log tree commit diff stats
path: root/ranger/data/scope.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/data/scope.sh')
-rwxr-xr-xranger/data/scope.sh22
1 files changed, 15 insertions, 7 deletions
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh
index ad14f5e5..ef5f8ff4 100755
--- a/ranger/data/scope.sh
+++ b/ranger/data/scope.sh
@@ -13,19 +13,27 @@
 mimetype=$(file --mime-type -Lb "$1")
 extension=$(echo "$1" | grep '\.' | grep -o '[^.]\+$')
 
+case "$extension" in
+	# Archive extensions:
+	tar|gz|tgz|bz|tbz|bz2|tbz2|Z|tZ|lzo|tzo|lz|tlz|xz|txz|7z|t7z|\
+	zip|jar|war|rar|lha|lzh|alz|ace|a|arj|arc|rpm|cab|lzma|rz|cpio)
+		atool -l "$1" || exit 1
+		exit 0;;
+	# HTML Pages:
+	htm|html|xhtml)
+		lynx -dump "$1" || elinks -dump "$1" || exit 1
+		exit 0;;
+esac
+
 case "$mimetype" in
-	text/*)
+	# Syntax highlight for text files:
+	text/* | */xml)
 		highlight --ansi "$1" || cat "$1" || exit 1
 		exit 0;;
+	# Ascii-previews of images:
 	image/*)
 		img2txt "$1" || exit 1
 		exit 0;;
 esac
 
-case "$extension" in
-	zip|gz)
-		atool -l "$1" || exit 1
-		exit 0;;
-esac
-
 exit 1