Skip to content

Instantly share code, notes, and snippets.

@FractalWire
Created September 26, 2019 12:21
Show Gist options
  • Save FractalWire/c1305be8fb1a9c37351188cfca4e33c1 to your computer and use it in GitHub Desktop.
Save FractalWire/c1305be8fb1a9c37351188cfca4e33c1 to your computer and use it in GitHub Desktop.
The fuzzy file explorer powered by fzf
#!/bin/bash
# A simple script to make fzf a fuzzy-file explorer
cur_folder=$(pwd)
while true
do
folder=$( ( echo -e '.\n..'; fd -t d --color=always ) \
| fzf --no-height --preview-window=right:50% \
--preview 'tree -L 2 -C {}')
test $? -ne 0 && break
cur_folder="$cur_folder/$folder"
cd "$cur_folder"
done
echo "$cur_folder"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment