Skip to content

Instantly share code, notes, and snippets.

@BaseCase
Created September 19, 2017 17:43
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save BaseCase/c45299e4f8474119881d708a4b728fbf to your computer and use it in GitHub Desktop.
Save BaseCase/c45299e4f8474119881d708a4b728fbf to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
main() {
previous_file="$1"
file_to_edit=`select_file $previous_file`
if [ -n "$file_to_edit" ] ; then
"$EDITOR" "$file_to_edit"
main "$file_to_edit"
fi
}
select_file() {
given_file="$1"
fzf --preview="cat {}" --preview-window=right:70%:wrap --query="$given_file"
}
main ""
@alichtman
Copy link

https://github.com/alichtman/fzf-notes

I've fleshed this out into a more complete note taking tool and thought I'd share. It now supports multiple notebooks.

@BaseCase
Copy link
Author

Hey @alichtman that's really cool! I'll have to pull down your tool and try it out later today :)

@guychouk
Copy link

guychouk commented Mar 2, 2021

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

Copy link

ghost 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

@guychouk
Copy link

guychouk commented Apr 30, 2022

the link to your project is dead

Fixed it @SamDc73, thanks for the heads up!

@rudchenkos
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