diff options
Diffstat (limited to 'fzo')
| -rwxr-xr-x | fzo | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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" |
