Mod4 + i
#"cd ~/doc/drafts && drafts_prepend && gvim -c NERDTreeFind drafts.md"
"cd ~/doc/drafts && drafts_prepend && gvim drafts.md"
+ Mod4 + d + Shift
+"cd ~/doc/drafts && gvim $(draft)"
Mod4 + d
"cd ~/doc/notes && notes_prepend && gvim -c NERDTreeFind notes.md"
Mod4 + n
--- /dev/null
+#! /bin/bash
+
+set -euo pipefail
+
+bar() {
+ local -r len="${1:-80}" # 1st arg or 80.
+ local -r char="${2:--}" # 2nd arg or a dash.
+
+ seq -s "$char" "$len" | sed -E 's/[0-9]+//g'
+}
+
+main() {
+ local -r title_given='Untitled'
+ local -r title_lower=$(echo "$title_given" | tr '[:upper:]' '[:lower:]')
+ local -r title_lower_dashed=$(echo "$title_lower" | sed 's/\s\+/-/g')
+ local -r base="${HOME}/doc/drafts/adhoc"
+ local -r timestamp="$(date --iso-8601=ns)"
+ local -r file="${base}/${timestamp}--${title_lower_dashed}.md"
+
+ mkdir -p "$base"
+ if [[ ! -a "$file" ]]
+ then
+ touch "$file"
+ {
+ echo "$title_given"
+ bar 80 '='
+ echo "started: $timestamp"
+ printf '\n\n'
+ } > "$file"
+ fi
+ echo "$file"
+}
+
+main "$@"