You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Pipe the result of :pipe-sh to :vsplit
[keys.normal]
C-n = [":pipe-sh ~/vault/personal/new_note.sh", ":vsplit"]
Let's take a script called new_note.sh, which returns a filename.
#!/bin/bash# Folder with notes
folder="~/vault/personal"# Filename for a new note
filename="$folder/$(date +%Y%m%d%H%M%S).md"
touch "$filename"# Unix timestamp ID
timestamp=$(date +%s)# Write the to the file
cat <<EOF > "$filename"---date: $(date +"%Y-%m-%d %H:%M:%S")tags: -urls: -id: $timestamp---#EOF# Return the file nameecho -n "$filename"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Pipe commands and their output
Let's take a script called
new_note.sh
, which returns a filename.Or maybe
Beta Was this translation helpful? Give feedback.
All reactions