-
-
Save baleen37/04859e3f4f623d1240b808cb777df3da to your computer and use it in GitHub Desktop.
Zettelkasten Workflow (WIP)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# zn - as zettell | |
# new export variables EDITOR for your editor and | |
#+ NOTES for your notes folder. | |
main () { | |
note_id=$(date +'%Y%m%d%H%M%S') | |
$EDITOR $NOTES/"$note_id".md | |
} | |
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# | |
# zs - is a zettel selector using fzf | |
# features: | |
# - it accepts multiple selection (using tab) | |
# - copy multiple selection to clipboard (mapped to ctrl-y) | |
# - clear selection (mapped to ctrl-l) | |
# - populates (n)vim quickfix list with zettel titles (enter) | |
# | |
SRC_FOLDER=$(pwd) | |
main() { | |
cd "$SRC_FOLDER" | |
grep --max-count=1 "^#[[:space:]][[:alnum:]]" *.md | sed 's/:#[[:space:]]/ | /g' | fzf --tac --multi \ | |
--layout=reverse \ | |
--preview "echo {} | sed 's/[[:space:]].*//g' | head | xargs bat --style=plain --color=always || xargs cat {}" \ | |
--preview-window=wrap \ | |
--bind '?:toggle-preview' \ | |
--bind 'ctrl-l:clear-selection' \ | |
--bind "ctrl-y:execute(printf '%s\n' {+} | sed 's/.md//g' | xclip -selection clipboard)" \ | |
--bind 'enter:execute(echo {+} | grep -o "[0-9]\+\.md" | xargs $EDITOR -c "silent bufdo grepadd ^\# %")' | |
} | |
main | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment