From 2aabf6bb5d873d41805cf98c0790d55388453859 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Sun, 19 Sep 2021 16:35:29 -0700 Subject: [PATCH] zsh: added more usage info to todo() --- .zshrc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.zshrc b/.zshrc index ce247c4..7053fc6 100644 --- a/.zshrc +++ b/.zshrc @@ -154,12 +154,16 @@ done } - # an improved way to manage the todo list + # a simple way to manage your todo list # Usage: - # todo -- edit ~/todo - # todo auto -- commit ~/todo and push with message 'todo' - # todo [git command string] -- manage todo for easy syncing, assuming ~/todo is + # todo -- edit ~/todo + # todo auto -- commit and push ~/todo with message 'todo' + # todo [any git command] -- manage todo for easy syncing, assuming ~/todo is # a symlink that points to a file in a git repo + # + # Suggested use: make a git repo for holding your todo list, then make + # a symlink called 'todo' that points to your todo list in your home directory + # todo() { ( # subshell to protect against directory changes todo_dir="$(dirname "$(realpath ~/todo)")" @@ -168,7 +172,8 @@ $EDITOR ~/todo elif [ "$@" = 'auto' ];then cd "$todo_dir" - git commit "$(realpath ~/todo)" -m 'todo' && todo push + git commit "$(realpath ~/todo)" -m 'todo' + git push else cd "$todo_dir" git $@ @@ -626,5 +631,6 @@ add-zsh-hook preexec mzc_termsupport_preexec # Optionally source the user's customized .zshrc [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" || return 0 -# vim:fdm=marker:fmr=>>>,<<<:et:ft=zsh:sw=3 +# filetype is sh for language server +# vim:fdm=marker:fmr=>>>,<<<:et:ft=sh:sw=3