summaryrefslogtreecommitdiff
path: root/fzo
diff options
context:
space:
mode:
Diffstat (limited to 'fzo')
-rwxr-xr-xfzo14
1 files changed, 14 insertions, 0 deletions
diff --git a/fzo b/fzo
new file mode 100755
index 0000000..576125e
--- /dev/null
+++ b/fzo
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+: "${EDITOR:=${VISUAL:=vi}}"
+
+file=$(
+ find . -maxdepth 5 -type f -readable \
+ -not -path '*/.git/*' 2>/dev/null |
+ sed 's|^\./||' |
+ sort --ignore-case --unique |
+ fzf --prompt="Open file > " \
+ --preview 'sed -n "1,200p" {}'
+)
+
+[ -n "$file" ] && "$EDITOR" "$file"