aboutsummaryrefslogtreecommitdiff
path: root/files/.lessfilter.sh
diff options
context:
space:
mode:
authorAnton Bobov <abobov@gmail.com>2016-08-20 23:44:55 +0500
committerAnton Bobov <abobov@gmail.com>2016-08-23 08:45:21 +0500
commitd73894fc1ab71a441080b860c2d101b9fbfb3992 (patch)
tree8898056665a8ecbe7c8cc98dedac4bc5630956ee /files/.lessfilter.sh
parent54f121265ece225dfd8e069af1a44878c01730c2 (diff)
[zhs] Alias and LESS filter.
* add LESS file filter * don't use grc if not installed * fix aliases with sudo and watch * source fzf (https://github.com/junegunn/fzf) if found
Diffstat (limited to 'files/.lessfilter.sh')
-rwxr-xr-xfiles/.lessfilter.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/files/.lessfilter.sh b/files/.lessfilter.sh
new file mode 100755
index 0000000..86d6833
--- /dev/null
+++ b/files/.lessfilter.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+case $1 in
+ *.xml) if [ -x `which xmlstarlet 2>/dev/null` ]; then exec xmlstarlet fo "$1"; fi ;;
+ *.json) if [ -x `which jq 2>/dev/null` ]; then exec jq -C . "$1"; fi ;;
+ *.md) if [ -x `which pandoc 2>/dev/null` ]; then exec pandoc -t plain "$1"; fi ;;
+esac
+
+exit 1