aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--alias1
-rwxr-xr-xtools/wiki/diary17
2 files changed, 13 insertions, 5 deletions
diff --git a/alias b/alias
index 5cab1e0..0e270db 100644
--- a/alias
+++ b/alias
@@ -255,6 +255,7 @@ ww() { entry="${1:-guideline}"; vim ~/vimwiki/${entry%%.md}.md; }
255wg() { grep -r "$@" --exclude-dir=logseq/ ~/vimwiki; } 255wg() { grep -r "$@" --exclude-dir=logseq/ ~/vimwiki; }
256wi() { cat ~/vimwiki/${1%%.md}.md; } 256wi() { cat ~/vimwiki/${1%%.md}.md; }
257alias dia='diary' 257alias dia='diary'
258alias diaa='diary p'
258 259
259# crontab 260# crontab
260alias ce='crontab -e' 261alias ce='crontab -e'
diff --git a/tools/wiki/diary b/tools/wiki/diary
index 06124bd..c82f040 100755
--- a/tools/wiki/diary
+++ b/tools/wiki/diary
@@ -19,14 +19,21 @@ pick_date() {
19 vim -c 'Goyo' $FILE 19 vim -c 'Goyo' $FILE
20} 20}
21 21
22print_today() {
23 cat ~/vimwiki/diary/$(date --iso-8601).md
24}
25
22add_entry() { 26add_entry() {
23 set -x 27 set -x
24 echo - "$@" >>~/vimwiki/diary/$(date --iso-8601).md 28 echo - "$@" >>~/vimwiki/diary/$(date --iso-8601).md
25 set +x 29 set +x
26} 30}
27 31
28if [ $# -eq 0 ]; then 32case "$1" in
29 pick_date 33 "")
30else 34 pick_date ;;
31 add_entry "$@" 35 p)
32fi 36 print_today ;;
37 *)
38 add_entry "$@" ;;
39esac