Skip to content

Instantly share code, notes, and snippets.

Created September 19, 2017 17:43
What would you like to do?
#!/usr/bin/env bash
set -e
main() {
file_to_edit=`select_file $previous_file`
if [ -n "$file_to_edit" ] ; then
"$EDITOR" "$file_to_edit"
main "$file_to_edit"
select_file() {
fzf --preview="cat {}" --preview-window=right:70%:wrap --query="$given_file"
main ""
Copy link

SamDc73 commented Apr 30, 2022

Thanks to this amazing idea, I created this small script to manage notes in the Zettelkasten method, using fzf, the silver searcher and bat.

the link to your project is dead

Copy link

guychouk commented Apr 30, 2022

the link to your project is dead

Fixed it @SamDc73, thanks for the heads up!

Copy link

Thank you Casey for the idea and the nice article which led me to this script.

As a tribute, I can suggest a simplification. Since version 0.10 fzf supports --bind with execute:

alias fuz=fzf --preview="cat {}" --preview-window=right:70%:wrap --bind 'enter:execute($EDITOR {})'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment