Skip to content

Instantly share code, notes, and snippets.

@aerosol
Created September 7, 2018 06:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aerosol/309cd68d1d93196276664d232201456e to your computer and use it in GitHub Desktop.
Save aerosol/309cd68d1d93196276664d232201456e to your computer and use it in GitHub Desktop.
#!/usr/bin/env zsh
function edit() {
mkdir -p "$(dirname "$1")" && $EDITOR "$1"
}
function pick() {
note=$(rg . | fzf --preview "cat \$(echo {} | tr ':' '\n' | head -n1)" | awk -F: '{print $1}')
if [[ -n $note ]]
then
less $note | xsel --clipboard --input
fi
}
function count() {
ls "$1" | wc -l
}
notesdir=~/notes
(cd $notesdir && $*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment